Font – official webfonts plugin of Fonts For Web. NO CODING! Just click & change font size, color and font face visually! - Version 7.1.9

Version Description

-Fixed launching compatibility mode when jQuery completely overwritten

=

Download this release

Version 7.1.9

Files changed (82) hide show
  1. .htaccess +19 -0
  2. AjaxProxy.php +24 -0
  3. Font.php +968 -0
  4. configAlt/.htaccess +25 -0
  5. configAlt/AjaxProxy.php +24 -0
  6. css/colorpicker.css +161 -0
  7. css/fontsforwebstyle.css +852 -0
  8. css/start/images/ui-bg_flat_55_999999_40x100.png +0 -0
  9. css/start/images/ui-bg_flat_75_aaaaaa_40x100.png +0 -0
  10. css/start/images/ui-bg_glass_45_0078ae_1x400.png +0 -0
  11. css/start/images/ui-bg_glass_55_f8da4e_1x400.png +0 -0
  12. css/start/images/ui-bg_glass_75_79c9ec_1x400.png +0 -0
  13. css/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png +0 -0
  14. css/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png +0 -0
  15. css/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png +0 -0
  16. css/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  17. css/start/images/ui-icons_0078ae_256x240.png +0 -0
  18. css/start/images/ui-icons_056b93_256x240.png +0 -0
  19. css/start/images/ui-icons_d8e7f3_256x240.png +0 -0
  20. css/start/images/ui-icons_e0fdff_256x240.png +0 -0
  21. css/start/images/ui-icons_f5e175_256x240.png +0 -0
  22. css/start/images/ui-icons_f7a50d_256x240.png +0 -0
  23. css/start/images/ui-icons_fcd113_256x240.png +0 -0
  24. css/start/jquery-ui-1.8.14.custom.css +535 -0
  25. font_files_contents/.htaccess +10 -0
  26. images/3d-XYSlider.png +0 -0
  27. images/add.png +0 -0
  28. images/arrow.png +0 -0
  29. images/back.png +0 -0
  30. images/blank.gif +0 -0
  31. images/colorpicker_background.png +0 -0
  32. images/colorpicker_hex.png +0 -0
  33. images/colorpicker_hsb_b.png +0 -0
  34. images/colorpicker_hsb_h.png +0 -0
  35. images/colorpicker_hsb_s.png +0 -0
  36. images/colorpicker_indic.gif +0 -0
  37. images/colorpicker_overlay.png +0 -0
  38. images/colorpicker_rgb_b.png +0 -0
  39. images/colorpicker_rgb_g.png +0 -0
  40. images/colorpicker_rgb_r.png +0 -0
  41. images/colorpicker_select.gif +0 -0
  42. images/colorpicker_submit.png +0 -0
  43. images/custom_background.png +0 -0
  44. images/custom_hex.png +0 -0
  45. images/custom_hsb_b.png +0 -0
  46. images/custom_hsb_h.png +0 -0
  47. images/custom_hsb_s.png +0 -0
  48. images/custom_indic.gif +0 -0
  49. images/custom_rgb_b.png +0 -0
  50. images/custom_rgb_g.png +0 -0
  51. images/custom_rgb_r.png +0 -0
  52. images/custom_submit.png +0 -0
  53. images/delete.png +0 -0
  54. images/edit.png +0 -0
  55. images/effects.png +0 -0
  56. images/font_settings.png +0 -0
  57. images/font_ver.png +0 -0
  58. images/forward.png +0 -0
  59. images/logo_slide.png +0 -0
  60. images/pick.png +0 -0
  61. images/pick_add.png +0 -0
  62. images/pro.png +0 -0
  63. images/pro_settings.png +0 -0
  64. images/save.png +0 -0
  65. images/select.png +0 -0
  66. images/select2.png +0 -0
  67. images/slider.png +0 -0
  68. images/snc_settings.png +0 -0
  69. images/tinymce_icon.png +0 -0
  70. js/colorpicker.js +487 -0
  71. js/editor_plugin.js +29 -0
  72. js/jquery-1.10.2.min.js +6 -0
  73. js/jquery-ui-1.9.2.custom.min.js +6 -0
  74. js/jquery.fcarousel.min.js +52 -0
  75. js/jquery.fontPlugin.js +2854 -0
  76. js/jquery.ui.slider.js +603 -0
  77. js/pluginscripts.js +267 -0
  78. loadinfo.net.gif +0 -0
  79. menu_item.png +0 -0
  80. readme.txt +290 -0
  81. screenshot-1.png +0 -0
  82. screenshot-2.jpg +0 -0
.htaccess ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Allow from all
2
+
3
+ <IfModule mod_env.c>
4
+ SetEnv MODSEC_ENABLE Off
5
+ PassEnv MODSEC_ENABLE
6
+ </IfModule>
7
+
8
+ <IfModule mod_security.c>
9
+ SecFilterEngine Off
10
+ SecFilterScanPOST Off
11
+ </IfModule>
12
+
13
+ # webfont mime types
14
+ <IfModule mod_mime.c>
15
+ AddType application/vnd.ms-fontobject eot
16
+ AddType font/truetype ttf
17
+ AddType font/opentype otf
18
+ AddType application/x-font-woff woff
19
+ </IfModule>
AjaxProxy.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Takes all ajax FONT requests and thanks to .htaccess file next to it should avoid mod security errors like in admin-ajax.php
4
+ */
5
+ define( 'DOING_AJAX', true );
6
+ define( 'WP_ADMIN', true );
7
+ require_once('../../../wp-load.php');
8
+ /** Load WordPress Administration APIs */
9
+ require_once( ABSPATH . 'wp-admin/includes/admin.php' );
10
+ /** Load Ajax Handlers for WordPress Core */
11
+ //require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
12
+ //send_origin_headers();
13
+ @header('Access-Control-Allow-Origin: *');
14
+ @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
15
+ @header( 'X-Robots-Tag: noindex' );
16
+ send_nosniff_header();
17
+ nocache_headers();
18
+ do_action( 'admin_init' );
19
+ if (is_user_logged_in())
20
+ do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions
21
+ else
22
+ do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions
23
+ // Default status
24
+ die('Memento mori');
Font.php ADDED
@@ -0,0 +1,968 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Font
4
+ Plugin URI: http://fontsforweb.com
5
+ Description: Now go to your home page. And click on "Font settings" in admin bar and choose some exciting font out of 1000+ availabile! And that's just the beginning!
6
+ Version: 7.1.9
7
+ Author: Paweł Misiurski
8
+ Author URI: http://fontsforweb.com
9
+ License: Copyright (C) 2012 Pawel Misiurski
10
+ This program is free software; you can redistribute it and/or
11
+ modify it under the terms of the GNU General Public License
12
+ as published by the Free Software Foundation; either version 2
13
+ of the License, or (at your option) any later version.
14
+ This program is distributed in the hope that it will be useful,
15
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ GNU General Public License for more details.
18
+ You should have received a copy of the GNU General Public License
19
+ along with this program; if not, write to the Free Software
20
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
+ */
22
+ @error_reporting(E_NONE);//just to make sure no notices will come out in older versions
23
+ class FontPlugin {
24
+ public $pluginName = 'Font';
25
+ public $baseUrl = 'http://fontsforweb.com';
26
+ public $version = '7.1.9';
27
+ //url parts for requesting css for elements
28
+ private $titleUrlPart;
29
+ private $headerUrlPart;
30
+ private $tinymceStylesLoaded;
31
+ public $fontAllIds = array();
32
+ private $optionsName = 'FontSettings';
33
+ private $options = array();
34
+ private $editorStyles = array();
35
+ //initizalize
36
+ function __construct() {
37
+ //get options(to $this->options array)
38
+ $this->getOptions();
39
+ //check if last installed version in user's WP installation has changed
40
+ if($this->get_plugin_version() != $this->version) {
41
+ $this->font_activate(true);
42
+ $this->set_plugin_version($this->version);
43
+ $this->set_upgrade_notice();
44
+ }
45
+ /*
46
+ PHP ACTIONS
47
+ */
48
+ add_action('admin_menu', array(&$this, 'admin_menu'));
49
+ add_filter('wp_insert_post_data', array(&$this, 'regenerateEditorCSS'), '99', 2);
50
+ //activate plugin
51
+ register_activation_hook( __FILE__, array(&$this, 'font_activate'));
52
+ add_action('admin_menu', array(&$this, 'admin_menu_link'));
53
+ //filter post content to get ids
54
+ add_filter('the_posts', array(&$this, 'loadPostFonts'));
55
+ //add font definitions from extracted ids
56
+ add_action('wp_head', array(&$this, 'attachHeaders'));
57
+ //add link to fonts for web at the bottom of page
58
+ add_action('wp_footer', array(&$this, 'addFFWLink'));
59
+ //add scripts to a page
60
+ add_action('wp_enqueue_scripts', array(&$this, 'addScripts'));
61
+ add_action('admin_enqueue_scripts', array(&$this, 'addAdminScripts'));
62
+
63
+ // hack to run function after plugins are loaded to fix error:
64
+ // Call to undefined function wp_get_current_user
65
+ //add_action('plugins_loaded', array(&$this, 'addScripts'));
66
+
67
+ //add admin bar customization
68
+ add_action('wp_before_admin_bar_render', array(&$this, 'admin_bar_customize'));
69
+
70
+ // init process for button control
71
+ add_action('init', array(&$this, 'myplugin_addbuttons'));
72
+ //if no api key tell to go to "Font settings"
73
+ $settings = $this->getJsonSettings();
74
+ if(isset($this->options['fontConnectionError']) && $this->options['fontConnectionError']) {
75
+ add_action('admin_notices', array(&$this, 'showConnectionErrorMessage'));
76
+ } else if(!isset($settings->apikey) || !$settings->apikey || $settings->apikey == '') {
77
+ add_action('admin_notices', array(&$this, 'showAdminMessages'));
78
+ }
79
+
80
+ // show upgrade notice
81
+ if(isset($this->options['upgradeNotice']) && $this->options['upgradeNotice']) {
82
+ add_action('admin_notices', array(&$this, 'showUpgradeNotice'));
83
+ }
84
+
85
+ /*
86
+ JS SCRIPTS
87
+ */
88
+ //init js file
89
+ wp_register_script('jquery-fcarousel', plugins_url('/js/jquery.fcarousel.min.js', __FILE__), 'jquery');
90
+ //jquery ui file
91
+ //wp_register_script( 'jquery-ui', plugins_url('/js/jquery-ui-1.8.14.custom.min.js', __FILE__), 'jquery' );
92
+ //slider
93
+ wp_register_script( 'jquery-ui-slider', plugins_url('/js/jquery.ui.slider.js', __FILE__), array('jquery-ui-core', 'jquery-ui-mouse', 'jquery-ui-widget'));
94
+ //jquery font plugin
95
+ wp_register_script('font-plugin', plugins_url('/js/jquery.fontPlugin.js?pver=' . $this->version, __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-ui-sortable'));
96
+ //jquery ui file
97
+ wp_register_script('colorpicker2', plugins_url('/js/colorpicker.js', __FILE__), 'jquery');
98
+ wp_register_script('pluginscripts', plugins_url('/js/pluginscripts.js?pver=' . $this->version, __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-ui-sortable'));
99
+ /*
100
+ AJAX HANDLERS
101
+ */
102
+ add_action('wp_ajax_get_font_settings', array(&$this, 'get_font_settings_callback'));
103
+ add_action('wp_ajax_set_font_settings', array(&$this, 'set_font_settings_callback'));
104
+ add_action('wp_ajax_cross_domain_request', array(&$this, 'ajax_cross_domain_request'));
105
+ /*
106
+ STYLES
107
+ */
108
+ wp_register_style('fontsforwebstyle', plugins_url('/css/fontsforwebstyle.css?pver=' . $this->version, __FILE__));
109
+ wp_register_style('jquery-ui', plugins_url('/css/start/jquery-ui-1.8.14.custom.css', __FILE__));
110
+ wp_register_style('colorpicker2', plugins_url('/css/colorpicker.css', __FILE__));
111
+
112
+ // save activation output
113
+ add_action('activated_plugin','save_error');
114
+ function save_error(){
115
+ update_option('plugin_error', 'Activation result: ' . ob_get_contents());
116
+ }
117
+ }
118
+ function getApikey () {
119
+ $settings = $this->getJsonSettings();
120
+ if(!isset($settings->apikey) || !$settings->apikey || $settings->apikey == '') {
121
+ return false;
122
+ } else {
123
+ return $settings->apikey;
124
+ }
125
+ }
126
+ function ajax_cross_domain_request () {
127
+ if(isset($_POST['serialized'])) {
128
+ parse_str($_POST['serialized'], $serializedArr);
129
+ } else {
130
+ $serializedArr = array(0);
131
+ }
132
+
133
+ if(is_array($_POST['data'])) {
134
+ $dataArr = $_POST['data'];
135
+ } else {
136
+ parse_str($_POST['data'], $dataArr);
137
+ }
138
+ $contents = $this->file_get_contents2($_POST['url'], array_merge($dataArr, $serializedArr));
139
+ if(!$contents) {
140
+ $response = new StdClass;
141
+ $response->success = 'false';
142
+ $response->message = $this->errorMessage;
143
+ header('content-type: application/json; charset=utf-8');
144
+ echo json_encode($response);
145
+ die();
146
+ }
147
+ //file get contents to get through security
148
+ echo $contents;
149
+ die();
150
+ }
151
+ /*
152
+ * Executed on activation
153
+ */
154
+ function font_activate ($update) {
155
+ // test connection
156
+ if($this->file_get_contents2($this->baseUrl . '/api/testconnection') != 'works') {
157
+ $this->options['fontConnectionError'] = true;
158
+ $this->saveAdminOptions();
159
+ return false;
160
+ }
161
+
162
+ //if new installation
163
+ if(!$this->get_plugin_version()) {
164
+ $this->file_get_contents2($this->baseUrl . '/api/init?blogurl=' . urlencode(get_bloginfo('wpurl')) . '&version=' . $this->version . '&action=INSTALLING');
165
+ } else if($update) { //if updating
166
+ $this->file_get_contents2($this->baseUrl . '/api/init?blogurl=' . urlencode(get_bloginfo('wpurl')) . '&version=' . $this->version . '&action=UPDATING');
167
+ } else {
168
+ $this->file_get_contents2($this->baseUrl . '/api/init?blogurl=' . urlencode(get_bloginfo('wpurl')) . '&version=' . $this->version . '&action=REACTIVATING');
169
+ }
170
+
171
+ $settings = $this->get_font_settings();
172
+ $maxRepeats = 20;
173
+ if($settings) {
174
+ while(!is_object(json_decode(trim($settings, ' \'"'))) || $maxRepeats > 0) {
175
+ $maxRepeats--;
176
+ $settings = stripslashes($settings);
177
+ }
178
+ $settObj = trim($settings, ' \'"');
179
+
180
+ if(is_object(json_decode($settObj))) {
181
+ //re-download fonts
182
+ $this->set_font_settings($settObj);
183
+ }
184
+ }
185
+ }
186
+ /*
187
+ AJAX HANDLERS
188
+ */
189
+ function get_font_settings_callback() {
190
+ echo stripslashes($this->get_font_settings());
191
+ die();
192
+ }
193
+ /*
194
+ * get font settings
195
+ */
196
+ function get_font_settings () {
197
+ if (!$this->options['fontPluginSettings']) {
198
+ $this->generateDefaultSettings();
199
+ }
200
+ return $this->options['fontPluginSettings'];
201
+ }
202
+ /*
203
+ * delete all settings
204
+ */
205
+ function delete_font_settings() {
206
+ $this->options = false;
207
+ $this->saveAdminOptions();
208
+ $this->getOptions();
209
+ }
210
+ /*
211
+ * generate default settings
212
+ */
213
+ function generateDefaultSettings() {
214
+ $settings = array();
215
+ $settings['presets'] = array();
216
+ $preset = $settings['presets'][] = new stdClass();
217
+ $preset->name = 'PICK AN ELEMENT';
218
+ //if title id is set migrate to new plugin
219
+ $preset->fontid = '';
220
+ $preset->fontName = '';
221
+ $preset->selector = 'PICK AN ELEMENT NOW - or type CSS selector(advanced)';
222
+ //$preset->selector = '#header h1, #header h1 a, #header h1 a:visited, #header h2 a, #header h2 a:visited,#page-header h1, #page-header h1 a, #page-header h1 a:visited, #site-title, #site-title span a, #site-title span a:visited';
223
+ $preset->styles = new stdClass();
224
+ $preset->styles->fontSize = '30';
225
+ $preset->styles->color = '#444';
226
+
227
+ $settings['settingFields'] = array();
228
+ $settingsField = $settings['settingFields'][] = new stdClass();
229
+ $settingsField->type = 'text';
230
+ $settingsField->label = 'Selector';
231
+ $settingsField->name = 'selector';
232
+ $settingsField->settingType = 'general';
233
+ $settingsField->settingName = 'selector';
234
+ $settingsField->extendWith = 'selectorPicker';
235
+ $settingsField = $settings['settingFields'][] = new stdClass();
236
+ $settingsField->type = 'text';
237
+ $settingsField->label = 'Font size';
238
+ $settingsField->name = 'font-size';
239
+ $settingsField->settingType = 'css';
240
+ $settingsField->settingName = 'fontSize';
241
+ $settingsField->extendWith = 'slider';
242
+ $settingsField->unit = 'px';
243
+ $settingsField = $settings['settingFields'][] = new stdClass();
244
+ $settingsField->type = 'text';
245
+ $settingsField->label = 'Color';
246
+ $settingsField->name = 'color';
247
+ $settingsField->settingType = 'css';
248
+ $settingsField->settingName = 'color';
249
+ $settingsField->extendWith = 'colorPicker';
250
+ $this->set_font_settings(json_encode($settings));
251
+ }
252
+ /*
253
+ * get plugin version
254
+ */
255
+ function get_plugin_version() {
256
+ if(!isset($this->options['fontPluginVersion'])) {
257
+ return false;
258
+ } else {
259
+ return $this->options['fontPluginVersion'];
260
+ }
261
+ }
262
+ // show upgrade notice
263
+ function set_upgrade_notice() {
264
+ $this->options['upgradeNotice'] = true;
265
+ }
266
+ /*
267
+ * set plugin version
268
+ */
269
+ function set_plugin_version ($ver) {
270
+ $this->options['fontPluginVersion'] = $ver;
271
+ $this->saveAdminOptions();
272
+ }
273
+ /*
274
+ * Set plugin options
275
+ */
276
+ function set_font_settings_callback() {
277
+ $settings = $_POST['fontPluginSettings'];
278
+ $response = $this->set_font_settings($settings);
279
+ header('content-type: application/json; charset=utf-8');
280
+ echo json_encode($response);
281
+ die();
282
+ }
283
+ /*
284
+ * Set plugin options
285
+ */
286
+ function set_font_settings($settings) {
287
+ $setObj = json_decode(stripslashes($settings));
288
+ $presets = array();
289
+ $styles = '';
290
+ $response = new StdClass;
291
+ for ($i = 0; $i < count($setObj->presets); $i++) {
292
+ $preset = $setObj->presets[$i];
293
+ if ($preset->fontid && $preset->fontName) {
294
+ if(!$this->downloadFont($preset->fontid, $preset->fontName)) {
295
+ $response->message = $this->errorMessage;
296
+ $response->success = 'false';
297
+ return $response;
298
+ }
299
+ }
300
+ $presets[] = $preset;
301
+ }
302
+ // generate css for all presets
303
+ $styles .= $this->getAllRules($presets);
304
+
305
+ $this->options['fontPluginSettings'] = $settings;
306
+ $this->options['fontGeneratedCSS'] = $styles;
307
+
308
+ $this->saveAdminOptions();
309
+ // clear supercache if present
310
+ if(function_exists('wp_cache_clear_cache')) {
311
+ wp_cache_clear_cache();
312
+ }
313
+
314
+ //$response->message = 'Unable to save settings';
315
+ $response->success = 'true';
316
+ return $response;
317
+ }
318
+ //get font face for array of fonts of given id from fontsforweb.com
319
+ function getAllRules($presetsArr) {
320
+ //$jsonPreset = json_encode($preset);
321
+ $presetsStr = urlencode(serialize($presetsArr));
322
+ $blogUrl = get_bloginfo('wpurl');
323
+ $postData = array('presets' => $presetsStr);
324
+ $gotFontFace = $this->file_get_contents2($this->baseUrl . '/api/getallfontfaces?blogurl=' . urlencode($blogUrl), $postData);
325
+ return $gotFontFace;
326
+ }
327
+ //add task to a list
328
+ function addCSSGenerationTask($fontId, $fontName) {
329
+ //if font with this id doesn't exists
330
+ if (isset($this->generationTasks) && $this->generationTasks) {
331
+ foreach ($this->generationTasks as $font) {
332
+ foreach ($font as $key => $val) {
333
+ if ($key == $fontId)
334
+ return;
335
+ }
336
+ }
337
+ }
338
+ $this->generationTasks[] = array($fontId => $fontName);
339
+ }
340
+ //ask server to generate rules
341
+ function executeCSSGenerationTasks() {
342
+ //$jsonPreset = json_encode($preset);
343
+ $blogUrl = get_bloginfo('wpurl');
344
+ //get fonts to be generated
345
+ foreach ($this->generationTasks as $font) {
346
+ foreach ($font as $key => $val) {
347
+ $queryArr[] = 'font[' . $val . ']=' . $key;
348
+ }
349
+ }
350
+ $queryStr = implode('&', $queryArr);
351
+ $dbKey = str_replace(array('[', ']', '&', '='), '', str_replace('[', '', $queryStr));
352
+ if (!isset($this->options['generatedPostsCSS']) || !$this->options['generatedPostsCSS'] || !is_array($this->options['generatedPostsCSS'])) {
353
+ $this->options['generatedPostsCSS'] = array();
354
+ }
355
+ //check if CSS already in cache
356
+ if (!isset($this->options['generatedPostsCSS'][$dbKey])) {
357
+ $gotFontFace = $this->file_get_contents2($this->baseUrl . '/api/getpostfontfaces?blogurl=' . urlencode($blogUrl) . '&' . $queryStr);
358
+ $this->options['generatedPostsCSS'][$dbKey] = $gotFontFace;
359
+ $this->saveAdminOptions();
360
+ }
361
+ return $this->options['generatedPostsCSS'][$dbKey];
362
+ }
363
+ //get ids from currently displayed post
364
+ function loadPostFonts($content) {
365
+ $fontPairs = array();
366
+ foreach ($content as $post) {
367
+ preg_match_all('/fontplugin_fontid_([0-9]*)_([a-zA-Z0-9]*)/', $post->post_content, $searchResults);
368
+ $fontsIds = array_values(array_unique($searchResults[1]));
369
+ $fontsNames = array_values(array_unique($searchResults[2]));
370
+ for ($i = 0; $i < count($fontsIds); $i++) {
371
+ $fontPairs[$fontsIds[$i]] = $fontsNames[$i];
372
+ }
373
+ }
374
+ //get files and generate css
375
+ if (count($fontPairs)) {
376
+ foreach ($fontPairs as $fontId => $fontName) {
377
+ //download font file
378
+ $this->downloadFont($fontId, $fontName);
379
+ //add task to create font-face for given fontid and name
380
+ $this->addCSSGenerationTask($fontId, $fontName);
381
+ }
382
+ $this->editorStyles[] = $this->executeCSSGenerationTasks();
383
+ }
384
+ return $content;
385
+ }
386
+ //get fonts ids from content OLD VERSION NOW FILTERING OF get_posts DOES THE JOB
387
+ function loadAdminPostFonts($data = false) {
388
+ global $wp_query;
389
+ if ($data) {
390
+ if (!$data['post_content'])
391
+ return;
392
+ $post_content = $data['post_content'];
393
+ } else {
394
+ if (is_object($wp_query) && is_object($wp_query->post) && $wp_query->post->ID)
395
+ $post = wp_get_single_post($wp_query->post->ID);
396
+ else if (isset($_GET['post']) && is_numeric($_GET['post']))
397
+ $post = wp_get_single_post($_GET['post']);
398
+ else if (isset($_GET['page']) && is_numeric($_GET['page']))
399
+ $post = wp_get_single_post($_GET['page']);
400
+ else if (isset($_GET['p']) && is_numeric($_GET['p']))
401
+ $post = wp_get_single_post($_GET['page']);
402
+ else
403
+ return;
404
+ $post_content = $post->post_content;
405
+ }
406
+ preg_match_all('/fontplugin_fontid_([0-9]*)_([a-zA-Z0-9]*)/', $post_content, $searchResults);
407
+ $fontsIds = array_values(array_unique($searchResults[1]));
408
+ $fontsNames = array_values(array_unique($searchResults[2]));
409
+ for ($i = 0; $i < count($fontsIds); $i++) {
410
+ $fontPairs[$fontsIds[$i]] = $fontsNames[$i];
411
+ }
412
+ return $fontPairs;
413
+ }
414
+ function writeTest($string) {
415
+ $pluginPath = dirname(__FILE__);
416
+ $fontsFolder = $pluginPath . '/font_files/';
417
+ $testFile = $fontsFolder . 'writetest.txt';
418
+ if(!@file_put_contents($testFile, $string)) {
419
+ $old = umask(0);
420
+ if(!chmod($fontsFolder, 0755) || !chown($fontsFolder, get_current_user())) {
421
+ $this->errorMessage = 'Fonts folder is not writable and attempt to make it writable has failed! Change permissions for font_files folder';
422
+ return false;
423
+ }
424
+ umask($old);
425
+ }
426
+ }
427
+ /*
428
+ * download font from fontsforweb
429
+ */
430
+ function downloadFont($fontId, $fontName) {
431
+ if(!is_numeric($fontId) || !$fontName || trim($fontName) == '') {
432
+ return false;
433
+ }
434
+ $pluginPath = dirname(__FILE__);
435
+ //copy ttf
436
+ $ttfUrl = $this->baseUrl . '/public/fonts/' . $fontId . '/' . $fontName . '.ttf';
437
+ //check if fonts folder exists
438
+ $fontsFolder = $pluginPath . '/font_files';
439
+ if(!file_exists($fontsFolder)) {
440
+ //create font folder
441
+ $old = umask(0);
442
+ mkdir($fontsFolder, 0777);
443
+ umask($old);
444
+ //copy htaccess
445
+ $htaccess = file_get_contents($fontsFolder . '_contents/.htaccess');
446
+ file_put_contents($fontsFolder . '/.htaccess', $htaccess);
447
+ }
448
+ //folder target
449
+ $fontsFolder = $pluginPath . '/font_files/';
450
+ $testFile = $fontsFolder . 'writetest.txt';
451
+ if(!@file_put_contents($testFile, ' ')) {
452
+ $old = umask(0);
453
+ if(!chmod($fontsFolder, 0755) || !chown($fontsFolder, get_current_user())) {
454
+ $this->errorMessage = 'Fonts folder is not writable and attempt to make it writable has failed! Change permissions for font_files folder';
455
+ return false;
456
+ }
457
+ umask($old);
458
+ }
459
+ unset($testFile);
460
+ $ttfNewPath = $fontsFolder . $fontName . '.ttf';
461
+ if (!file_exists($ttfNewPath)) {
462
+ if(!$this->downloadRemoteFile($ttfUrl, $ttfNewPath)){
463
+ $this->errorMessage = 'Cannot download ttf file';
464
+ return false;
465
+ }
466
+ }
467
+ //copy eot
468
+ $eotUrl = $this->baseUrl . '/public/fonts/' . $fontId . '/' . $fontName . '.eot';
469
+ $eotNewPath = $pluginPath . '/font_files/' . $fontName . '.eot';
470
+ if (!file_exists($eotNewPath)) {
471
+ if(!$this->downloadRemoteFile($eotUrl, $eotNewPath)) {
472
+ $this->errorMessage = 'Cannot download eot file';
473
+ return false;
474
+ }
475
+ }
476
+ //copy woff
477
+ $woffUrl = $this->baseUrl . '/public/fonts/' . $fontId . '/' . $fontName . '.woff';
478
+ $woffNewPath = $pluginPath . '/font_files/' . $fontName . '.woff';
479
+ if (!file_exists($woffNewPath)) {
480
+ if(!$this->downloadRemoteFile($woffUrl, $woffNewPath)) {
481
+ $this->errorMessage = 'Cannot download woff file';
482
+ return false;
483
+ }
484
+ }
485
+ return true;
486
+ }
487
+ //download remote file
488
+ function downloadRemoteFile($src, $destination) {
489
+ $fileContents = $this->file_get_contents2($src);
490
+ if(!$fileContents) {
491
+ return false;
492
+ }
493
+ $putting = file_put_contents($destination, $fileContents);
494
+ if(!$putting) {
495
+ $this->errorMessage = 'Error saving font file';
496
+ return false;
497
+ }
498
+ return $fileContents;
499
+ }
500
+ //file get contetns 2 - bulletproof remote request
501
+ function file_get_contents2($src, $postData = false) {
502
+ if ((ini_get('allow_url_fopen') == 1 || ini_get('allow_url_fopen') == 'on')) {
503
+ $this->downloadMethod = 'fopen';
504
+ } else if (in_array('curl', get_loaded_extensions())) {
505
+ $this->downloadMethod = 'curl';
506
+ } else if (function_exists("fsockopen")) {
507
+ $this->downloadMethod = 'sockets';
508
+ } else {
509
+ $this->downloadMethod = false;
510
+ }
511
+ switch ($this->downloadMethod) {
512
+ case 'fopen':
513
+ //get cookie from file
514
+ $cookieFile = dirname(__FILE__) . "/fgccookie.txt";
515
+ if(!file_exists($cookieFile)) {
516
+ $fh = fopen($cookieFile, "w");
517
+ fwrite($fh, "");
518
+ fclose($fh);
519
+ }
520
+ $cookieArr = unserialize(file_get_contents($cookieFile));
521
+ if(!is_array($cookieArr)) {
522
+ $cookieArr = array();
523
+ }
524
+ $cookieQuery = str_replace('&', '; ', http_build_query($cookieArr, '', '&'));
525
+ if($postData) {
526
+ $postQuery = http_build_query($postData, '', '&');
527
+ //set context
528
+ $opts = array(
529
+ 'http'=>array(
530
+ 'method'=>"POST",
531
+ 'header'=>"Content-type: application/x-www-form-urlencoded\r\n" .
532
+ "Accept-language: en\r\n" .
533
+ "Cookie: " . $cookieQuery . "\r\n",
534
+ 'content' => $postQuery
535
+ )
536
+ );
537
+ } else {
538
+ //set context
539
+ $opts = array(
540
+ 'http'=>array(
541
+ 'method'=>"GET",
542
+ 'header'=>"Accept-language: en\r\n" .
543
+ "Cookie: " . $cookieQuery . "\r\n"
544
+ )
545
+ );
546
+ }
547
+ $context = stream_context_create($opts);
548
+ // suppress error if no file found
549
+ $fileContents = @file_get_contents($src, false, $context);
550
+ if($fileContents) {
551
+ //get cookie
552
+ $cookies = array();
553
+ foreach ($http_response_header as $hdr) {
554
+ if (preg_match('/^Set-Cookie:\s*([^;]+)/', $hdr, $matches)) {
555
+ parse_str($matches[1], $tmp);
556
+ $cookies += $tmp;
557
+ }
558
+ }
559
+ //serialize cookie and save
560
+ file_put_contents($cookieFile, serialize($cookies));
561
+ }
562
+ //var_dump($cookies);
563
+ break;
564
+ case 'curl':
565
+ $ch = curl_init();
566
+ curl_setopt($ch, CURLOPT_URL, "{$src}");
567
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
568
+ if($postData) {
569
+ $dataString = http_build_query($postData, '', '&');
570
+ curl_setopt($ch,CURLOPT_POST, count($postData));
571
+ curl_setopt($ch,CURLOPT_POSTFIELDS, $dataString);
572
+ }
573
+ $cookieFile = dirname(__FILE__) . "/ffwsession.txt";
574
+ if(!file_exists($cookieFile)) {
575
+ $fh = fopen($cookieFile, "w");
576
+ fwrite($fh, "");
577
+ fclose($fh);
578
+ }
579
+ // Set the COOKIE files
580
+ curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);
581
+ curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
582
+
583
+ $fileContents = curl_exec($ch);
584
+ curl_close($ch);
585
+ break;
586
+ case 'sockets':
587
+ $fileContents = $this->fsockdownload($src, $postData);
588
+ break;
589
+ default:
590
+ $this->errorMessage = 'S**t! No way to download files! Ask your admin to enable CURL or allow_url_fopen or fsockopen';
591
+ return false;
592
+ }
593
+ return $fileContents;
594
+ }
595
+ //save file from url using fsockopen
596
+ function fsockdownload($source, $postData = false) {
597
+ //remove http
598
+ $parsedUrl = parse_url($source);
599
+ $source = str_replace('http://', '', $source);
600
+ $fh = fsockopen($parsedUrl['host'], 80, $errno, $errstr, 300);
601
+ if (!$fh) {
602
+ die("error downloading");
603
+ } else {
604
+ //if has post data add
605
+ if($postData) {
606
+ $content = http_build_query($postData, '', '&');
607
+ if(!isset($parsedUrl['query'])) {
608
+ $parsedUrl['query'] = '';
609
+ }
610
+ $hdr = "POST " . $parsedUrl['path'] . '?' . $parsedUrl['query'] . " HTTP/1.0\r\n";
611
+ $hdr .= "Host: " . str_replace('ssl://', '', $parsedUrl['host']) . "\r\n";
612
+ $hdr .= "Content-Type: application/x-www-form-urlencoded\r\n";
613
+ $hdr .= "Content-Length: " . strlen($content) . "\r\n\r\n";
614
+ //add post data
615
+ $hdr .= $content;
616
+ } else {
617
+ $hdr = '';
618
+ $file_cont = '';
619
+ $hdr .= "GET " . $parsedUrl['path'] . '?' . $parsedUrl['query'] . " HTTP/1.0\r\n";
620
+ $hdr .= "Host: " . $parsedUrl['host'] . "\r\n";
621
+ $hdr .= "Connection: close\r\n\r\n";
622
+ }
623
+ $file_cont = '';
624
+ fwrite($fh, $hdr);
625
+ while (!feof($fh) && ($debug = fgets($fh)) != "\r\n"); // ignore headers
626
+ while (!feof($fh)) {
627
+ $file_cont .= fgets($fh, 128);
628
+ }
629
+ //Return the file as a string
630
+ return $file_cont;
631
+ }
632
+ }
633
+ //run when displaying header
634
+ function attachHeaders() {
635
+ wp_enqueue_style('fontsforwebstyle');
636
+ wp_enqueue_style('jquery-ui');
637
+ wp_enqueue_script('jquery-ui-draggable');
638
+ wp_enqueue_script('jquery-ui-sortable');
639
+ wp_enqueue_script('jquery-ui-slider');
640
+ wp_enqueue_style('colorpicker2');
641
+ $editorStyles = '';
642
+ if (count($this->editorStyles)) {
643
+ $editorStyles = implode('', $this->editorStyles);
644
+ }
645
+ //echo plugin styles
646
+ echo '<style type="text/css">' . $this->options['fontGeneratedCSS'] . $editorStyles . '</style>';
647
+ }
648
+ //admin settings
649
+ function admin_menu() {
650
+ add_action('media_buttons', array(&$this, 'media_buttons'));
651
+ wp_enqueue_script('jquery-fcarousel');
652
+ //wp_enqueue_script( 'jquery-ui');
653
+ wp_enqueue_script('jquery-ui-draggable');
654
+ wp_enqueue_script('jquery-ui-slider');
655
+ wp_enqueue_script('colorpicker2');
656
+ wp_enqueue_script('font-plugin');
657
+ wp_enqueue_script('pluginscripts');
658
+ wp_enqueue_style('fontsforwebstyle');
659
+ wp_enqueue_style('jquery-ui');
660
+ wp_enqueue_style('colorpicker2');
661
+ $this->loadTinymceStyles();
662
+ }
663
+ //regenerateEditorCSS
664
+ function regenerateEditorCSS($data, $postarr) {
665
+ //var_dump('loaded or not: ' . $this->tinymceStylesLoaded);
666
+ if ($data && $data['post_content'] && $data['post_status'] != 'inherit') {
667
+ //var_dump($data);
668
+ $fontPairs = $this->loadAdminPostFonts($data);
669
+ if (count($fontPairs)) {
670
+ //get files and generate css
671
+ foreach ($fontPairs as $fontId => $fontName) {
672
+ //download font file
673
+ $this->downloadFont($fontId, $fontName);
674
+ //add task to create font-face for given fontid and name
675
+ $this->addCSSGenerationTask($fontId, $fontName);
676
+ }
677
+ $this->options['editorCSS'] = $this->executeCSSGenerationTasks();
678
+ $this->tinymceStylesLoaded = true;
679
+ $this->saveAdminOptions();
680
+ }
681
+ }
682
+ return $data;
683
+ }
684
+ //load FontsForWeb for tinyMce
685
+ function loadTinymceStyles() {
686
+ if (!$this->tinymceStylesLoaded) {
687
+ $fontPairs = $this->loadAdminPostFonts();
688
+ if (count($fontPairs)) {
689
+ foreach ($fontPairs as $fontId => $fontName) {
690
+ //download font file
691
+ $this->downloadFont($fontId, $fontName);
692
+ //add task to create font-face for given fontid and name
693
+ $this->addCSSGenerationTask($fontId, $fontName);
694
+ }
695
+ $this->options['editorCSS'] = $this->executeCSSGenerationTasks();
696
+ $this->saveAdminOptions();
697
+ }
698
+ }
699
+ //add custom CSS - PHP generated in Font plugin
700
+ if (!function_exists('font_plugin_css')) {
701
+ $editorCSS = $this->options['editorCSS'];
702
+
703
+ // regenerate CSS file
704
+ file_put_contents(dirname(__FILE__) . '/generatedEditorCSS.css', $editorCSS);
705
+
706
+ function font_plugin_css($wp) {
707
+ $wp .= ',' . trailingslashit(plugin_dir_url(__FILE__)) . 'generatedEditorCSS.css?ver=' . time(); //?' . implode('&' . $fontPairsUrlArr);
708
+ return $wp;
709
+ }
710
+ }
711
+ add_filter('mce_css', 'font_plugin_css');
712
+ /* Custom CSS styles on WYSIWYG Editor – Start
713
+ ======================================= */
714
+ if (!function_exists('myCustomTinyMCE')) :
715
+ function myCustomTinyMCE($init) {
716
+ $init['theme_advanced_buttons2_add_before'] = 'styleselect'; // Adds the buttons at the begining. (theme_advanced_buttons2_add adds them at the end)
717
+ $init['theme_advanced_styles'] = 'Float Left=fleft,Float Right=fright';
718
+ return $init;
719
+ }
720
+ endif;
721
+ /* add_filter('tiny_mce_before_init', 'myCustomTinyMCE' );
722
+ add_filter( 'mce_css', 'tdav_css' );
723
+ // incluiding the Custom CSS on our theme.
724
+ function mycustomStyles(){
725
+ wp_enqueue_style( 'myCustomStyles', $this->baseUrl . '/font/generatecss/?cached=true&id=777', ",",'all' );
726
+ }
727
+ add_action('init', 'mycustomStyles'); */
728
+ /* Custom CSS styles on WYSIWYG Editor – End
729
+ ======================================= */
730
+ }
731
+ //add button in Upload/Insert menu bar
732
+ function media_buttons() {
733
+ //$title = __('Show fonts', 'button1000fonts');
734
+ echo '<a href="#" id="FFW_chooseFontButton"><img src="' . plugins_url('/menu_item.png', __FILE__) . '" alt="fonts" /></a>';
735
+ }
736
+ //TINYMCE PLUGIN
737
+ function myplugin_addbuttons() {
738
+ // Don't bother doing this stuff if the current user lacks permissions
739
+ if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
740
+ return;
741
+ // Add only in Rich Editor mode
742
+ if (get_user_option('rich_editing') == 'true') {
743
+ add_filter("mce_external_plugins", array(&$this, "add_myplugin_tinymce_plugin"));
744
+ add_filter('mce_buttons', array(&$this, 'register_myplugin_button'));
745
+ }
746
+ }
747
+ //add ffw button
748
+ function register_myplugin_button($buttons) {
749
+ array_push($buttons, "separator", 'FFWButton');
750
+ return $buttons;
751
+ }
752
+ // Load the TinyMCE plugin : editor_plugin.js (wp2.5)
753
+ function add_myplugin_tinymce_plugin($plugin_array) {
754
+ $plugin_array['ffwbutton'] = plugins_url('/js/editor_plugin.js', __FILE__);
755
+ return $plugin_array;
756
+ }
757
+ //add admin scripts
758
+ function addAdminScripts () {
759
+ ?>
760
+ <script type="text/javascript">
761
+ var ajaxproxy = '<?php echo plugins_url('/AjaxProxy.php', __FILE__); ?>';
762
+ var ajaxproxy2 = '<?php echo plugins_url('/configAlt/AjaxProxy.php', __FILE__); ?>';
763
+ var ajaxproxy3 = '<?php echo esc_js(admin_url('admin-ajax.php')); ?>';
764
+ var fontBlogUrl = '<?php echo get_bloginfo('wpurl'); ?>';
765
+ var fontBlogName = '<?php echo get_bloginfo('name'); ?>';
766
+ var fontPluginVersion = '<?php echo $this->version; ?>';
767
+ </script>
768
+ <?php
769
+ }
770
+ //add scripts to the page
771
+ function addScripts() {
772
+ //add ajaxurl support
773
+ add_action('wp_head', array(&$this, 'addFrontVars'));
774
+ wp_enqueue_script('jquery');
775
+ wp_enqueue_script('jquery-fcarousel', false, 'jquery');
776
+ //wp_enqueue_script( 'jquery-ui');
777
+ wp_enqueue_script('jquery-ui-draggable');
778
+ wp_enqueue_script('jquery-ui-slider');
779
+ wp_enqueue_script('colorpicker2');
780
+ wp_enqueue_script('font-plugin');
781
+ wp_enqueue_script('pluginscripts');
782
+
783
+ wp_enqueue_style('fontsforwebstyle');
784
+ wp_enqueue_style('jquery-ui');
785
+ wp_enqueue_style('colorpicker2');
786
+ }
787
+ //add ajaxurl on clientside
788
+ function addFrontVars() {
789
+ ?>
790
+ <script type="text/javascript">
791
+ var ajaxproxy = '<?php echo plugins_url('/AjaxProxy.php', __FILE__); ?>';
792
+ var ajaxproxy2 = '<?php echo plugins_url('/configAlt/AjaxProxy.php', __FILE__); ?>';
793
+ var ajaxproxy3 = '<?php echo esc_js(admin_url('admin-ajax.php')); ?>';
794
+ var fontBlogUrl = '<?php echo get_bloginfo('wpurl'); ?>';
795
+ var fontBlogName = '<?php echo get_bloginfo('name'); ?>';
796
+ var fontPluginVersion = '<?php echo $this->version; ?>';
797
+ </script>
798
+ <?php
799
+ }
800
+ //add link - commented but will be optional in future
801
+ function addFFWLink() {
802
+ //echo '<p>Fontsforweb.com - <a href="http://fontsforweb.com" target="_blank">free web fonts</a> download. See this <a href="http://wordpress.org/extend/plugins/font/" target="_blank">Wordpress fonts plugin</a></p>';
803
+ }
804
+ /**
805
+ * @desc Adds the options subpanel
806
+ */
807
+ function admin_menu_link() {
808
+ //If you change this from add_options_page, MAKE SURE you change the filter_plugin_actions function (below) to
809
+ //reflect the page filename (ie - options-general.php) of the page your plugin is under!
810
+ add_theme_page('Fonts', 'Fonts', 10, basename(__FILE__), array(&$this, 'admin_options_page'));
811
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'filter_plugin_actions'), 10, 2);
812
+ }
813
+ /**
814
+ * @desc Adds the Settings link to the plugin activate/deactivate page
815
+ */
816
+ function filter_plugin_actions($links, $file) {
817
+ //If your plugin is under a different top-level menu than Settiongs (IE - you changed the function above to something other than add_options_page)
818
+ //Then you're going to want to change options-general.php below to the name of your top-level page
819
+ $settings_link = '<a href="themes.php?page=' . basename(__FILE__) . '">' . __('Settings') . '</a>';
820
+ array_unshift($links, $settings_link); // before other links
821
+ return $links;
822
+ }
823
+ /**
824
+ * Adds settings/options page
825
+ */
826
+ function admin_options_page() {
827
+ echo '
828
+ <div class="wrap">
829
+ <div class="icon32" id="icon-themes"><br></div>
830
+ <h2>How to use?</h2>
831
+ <p>
832
+ <ul>
833
+ <li>1. Go to your home screen when being logged in as admin</li>
834
+ <li>2. Click on "Font settings" from the top bar</li>
835
+ <li>3. Create a preset for a new selection</li>
836
+ <li>4. Click "Pick element" and click on any element on the page i.e. blog\'s title</li>
837
+ <li>5. Adjust color, size, choose font, add 3d effect</li>
838
+ <li>6. Click on "SAVE"</li>
839
+ </ul>
840
+ </p>
841
+ <a href="' . $blogUrl = get_bloginfo('wpurl') . '" target="_blank">Open your home screen in new tab.</a>
842
+
843
+ <h2>Having problems with the plugin?</h2>
844
+ <p>Resetting settings may help</p>';
845
+
846
+ if(isset($_GET['resetSettings']) && $_GET['resetSettings'] == 'true') {
847
+ $this->delete_font_settings();
848
+ echo '<h3><strong>All "Font" settings resetted.</strong></h3>';
849
+ } else {
850
+ echo '<form action="" method="get">
851
+ <input type="hidden" name="resetSettings" value="true">
852
+ <input type="hidden" name="page" value="Font.php">
853
+ <input type="submit" value="Reset settings now">
854
+ </form>';
855
+ }
856
+
857
+ echo '<h3>Activation output(should be empty)</h3>
858
+ <pre>' .
859
+ get_option('plugin_error')
860
+ . '</pre>';
861
+
862
+ /*echo '<h3>Debug settings info</h3>
863
+ <pre>';
864
+ var_dump($this->options);
865
+ echo '</pre>';*/
866
+ echo '</div>';
867
+ }
868
+ function getJsonSettings() {
869
+ $settings = $this->get_font_settings();
870
+ return json_decode(stripslashes($settings));
871
+ }
872
+ /*
873
+ Admin bar customization
874
+ */
875
+ // Admin Bar Customisation
876
+ function admin_bar_customize() {
877
+ global $wp_admin_bar;
878
+ // only for admin not editors etc
879
+ if (!current_user_can( 'manage_options' )) {
880
+ return;
881
+ }
882
+ // Add a new top level menu link
883
+ $wp_admin_bar->add_menu(array(
884
+ 'parent' => false,
885
+ 'id' => 'font_settings',
886
+ 'title' => __('Font settings'),
887
+ 'href' => '#'
888
+ ));
889
+ /*
890
+ //safe mode
891
+ $wp_admin_bar->add_menu(array(
892
+ 'parent' => 'font_settings',
893
+ 'id' => 'font_settings_standard',
894
+ 'title' => __('Font settings (normal mode)'),
895
+ 'href' => '#'
896
+ ));
897
+ //safe mode
898
+ $wp_admin_bar->add_menu(array(
899
+ 'parent' => 'font_settings',
900
+ 'id' => 'font_settings_compatibility',
901
+ 'title' => __('Font settings (force compatibility mode)'),
902
+ 'href' => '#'
903
+ ));*/
904
+ }
905
+ /**
906
+ * Saves the admin options to the database.
907
+ */
908
+ function saveAdminOptions() {
909
+ $update = update_option($this->optionsName, $this->options);
910
+ $this->getOptions();
911
+ return $update;
912
+ }
913
+ /**
914
+ * Retrieves the plugin options from the database.
915
+ * @return array
916
+ */
917
+ function getOptions() {
918
+ //Don't forget to set up the default options
919
+ if (!$options = get_option($this->optionsName)) {
920
+ $this->generateDefaultSettings();
921
+ $this->getOptions();
922
+ } else {
923
+ $this->options = $options;
924
+ }
925
+ }
926
+ function showMessage($message, $errormsg = false)
927
+ {
928
+ if ($errormsg) {
929
+ echo '<div id="message" class="error">';
930
+ }
931
+ else {
932
+ echo '<div id="message" class="updated fade">';
933
+ }
934
+ echo "<p><strong>$message</strong></p></div>";
935
+ }
936
+ function showAdminMessages()
937
+ {
938
+ $this->showMessage("&gt;&gt;&gt; Font plugin installed - now <a href=" . get_home_url() . ">go to your home page</a> and click on 'Font settings' from the top bar. This notice will disappear after saving settings for the first time.");
939
+ }
940
+ function showConnectionErrorMessage () {
941
+ // retry connection
942
+ if($this->file_get_contents2($this->baseUrl . '/api/testconnection') == 'works') {
943
+ $this->options['fontConnectionError'] = false;
944
+ $this->saveAdminOptions();
945
+ return false;
946
+ }
947
+ $message = '"Font" plugin cannot start working. <br></strong>'
948
+ . 'This plugin is using fonts and services from remote server, but is unable to connect to it.<br><br>'
949
+ . 'The problem can be solved only by you or by your server administrator by enabling remote access. In PHP settings:<br>'
950
+ . '1. Enable allow_url_fopen<br>'
951
+ . '2. or enable cURL<br>'
952
+ . '3. If settings 1 or 2 are enabled but this message is still visible, server settings or firewall may be blocking connection<br>'
953
+ . '4. Free hosting providers may be very restrictive and can refuse allowing remote connections from your server<br><br>'
954
+ . '<strong>To hide this message please resolve the problem and re-activate the plugin or if that\'s not possible disable "Font" plugin'
955
+ ;
956
+ $this->showMessage($message, false);
957
+ }
958
+ function showUpgradeNotice () {
959
+ $this->options['upgradeNotice'] = false;
960
+ $this->saveAdminOptions();
961
+
962
+ $message = '</strong>"Font" plugin upgraded! <br>'
963
+ . '<strong>REMEMBER TO CLEAR YOUR BROWSER\'S CACHE NOW.</strong><br>This message will disappear on page reload<strong>'
964
+ ;
965
+ $this->showMessage($message, false);
966
+ }
967
+ }
968
+ $WPFFW = new FontPlugin();
configAlt/.htaccess ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Allow from all
2
+
3
+ <IfModule mod_env.c>
4
+ SetEnv MODSEC_ENABLE Off
5
+ PassEnv MODSEC_ENABLE
6
+ </IfModule>
7
+
8
+ <IfModule mod_security.c>
9
+ SecRuleRemoveById 300015 300016 300017 950907 950005 950006 960008 960011 960904
10
+ SecRuleRemoveById phpids-17
11
+ SecRuleRemoveById phpids-20
12
+ SecRuleRemoveById phpids-21
13
+ SecRuleRemoveById phpids-30
14
+ SecRuleRemoveById phpids-61
15
+ SecFilterEngine Off
16
+ SecFilterScanPOST Off
17
+ </IfModule>
18
+
19
+ # webfont mime types
20
+ <IfModule mod_mime.c>
21
+ AddType application/vnd.ms-fontobject eot
22
+ AddType font/truetype ttf
23
+ AddType font/opentype otf
24
+ AddType application/x-font-woff woff
25
+ </IfModule>
configAlt/AjaxProxy.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Takes all ajax FONT requests and thanks to .htaccess file next to it should avoid mod security errors like in admin-ajax.php
4
+ */
5
+ define( 'DOING_AJAX', true );
6
+ define( 'WP_ADMIN', true );
7
+ require_once('../../../../wp-load.php');
8
+ /** Load WordPress Administration APIs */
9
+ require_once( ABSPATH . 'wp-admin/includes/admin.php' );
10
+ /** Load Ajax Handlers for WordPress Core */
11
+ //require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
12
+ //send_origin_headers();
13
+ @header('Access-Control-Allow-Origin: *');
14
+ @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
15
+ @header( 'X-Robots-Tag: noindex' );
16
+ send_nosniff_header();
17
+ nocache_headers();
18
+ do_action( 'admin_init' );
19
+ if (is_user_logged_in())
20
+ do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions
21
+ else
22
+ do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); // Non-admin actions
23
+ // Default status
24
+ die('Memento mori');
css/colorpicker.css ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .colorpicker {
2
+ width: 356px;
3
+ height: 176px;
4
+ overflow: hidden;
5
+ position: absolute;
6
+ background: url(../images/colorpicker_background.png);
7
+ font-family: Arial, Helvetica, sans-serif;
8
+ display: none;
9
+ }
10
+ .colorpicker_color {
11
+ width: 150px;
12
+ height: 150px;
13
+ left: 14px;
14
+ top: 13px;
15
+ position: absolute;
16
+ background: #f00;
17
+ overflow: hidden;
18
+ cursor: crosshair;
19
+ }
20
+ .colorpicker_color div {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ width: 150px;
25
+ height: 150px;
26
+ background: url(../images/colorpicker_overlay.png);
27
+ }
28
+ .colorpicker_color div div {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ width: 11px;
33
+ height: 11px;
34
+ overflow: hidden;
35
+ background: url(../images/colorpicker_select.gif);
36
+ margin: -5px 0 0 -5px;
37
+ }
38
+ .colorpicker_hue {
39
+ position: absolute;
40
+ top: 13px;
41
+ left: 171px;
42
+ width: 35px;
43
+ height: 150px;
44
+ cursor: n-resize;
45
+ }
46
+ .colorpicker_hue div {
47
+ position: absolute;
48
+ width: 35px;
49
+ height: 9px;
50
+ overflow: hidden;
51
+ background: url(../images/colorpicker_indic.gif) left top;
52
+ margin: -4px 0 0 0;
53
+ left: 0px;
54
+ }
55
+ .colorpicker_new_color {
56
+ position: absolute;
57
+ width: 60px;
58
+ height: 30px;
59
+ left: 213px;
60
+ top: 13px;
61
+ background: #f00;
62
+ }
63
+ .colorpicker_current_color {
64
+ position: absolute;
65
+ width: 60px;
66
+ height: 30px;
67
+ left: 283px;
68
+ top: 13px;
69
+ background: #f00;
70
+ }
71
+ .colorpicker input {
72
+ background-color: transparent;
73
+ border: 1px solid transparent;
74
+ position: absolute;
75
+ font-size: 10px;
76
+ font-family: Arial, Helvetica, sans-serif;
77
+ color: #898989;
78
+ top: 4px;
79
+ right: 11px;
80
+ text-align: right;
81
+ margin: 0;
82
+ padding: 0;
83
+ height: 11px;
84
+ }
85
+ .colorpicker_hex {
86
+ position: absolute;
87
+ width: 72px;
88
+ height: 22px;
89
+ background: url(../images/colorpicker_hex.png) top;
90
+ left: 212px;
91
+ top: 142px;
92
+ }
93
+ .colorpicker_hex input {
94
+ right: 6px;
95
+ }
96
+ .colorpicker_field {
97
+ height: 22px;
98
+ width: 62px;
99
+ background-position: top;
100
+ position: absolute;
101
+ }
102
+ .colorpicker_field span {
103
+ position: absolute;
104
+ width: 12px;
105
+ height: 22px;
106
+ overflow: hidden;
107
+ top: 0;
108
+ right: 0;
109
+ cursor: n-resize;
110
+ }
111
+ .colorpicker_rgb_r {
112
+ background-image: url(../images/colorpicker_rgb_r.png);
113
+ top: 52px;
114
+ left: 212px;
115
+ }
116
+ .colorpicker_rgb_g {
117
+ background-image: url(../images/colorpicker_rgb_g.png);
118
+ top: 82px;
119
+ left: 212px;
120
+ }
121
+ .colorpicker_rgb_b {
122
+ background-image: url(../images/colorpicker_rgb_b.png);
123
+ top: 112px;
124
+ left: 212px;
125
+ }
126
+ .colorpicker_hsb_h {
127
+ background-image: url(../images/colorpicker_hsb_h.png);
128
+ top: 52px;
129
+ left: 282px;
130
+ }
131
+ .colorpicker_hsb_s {
132
+ background-image: url(../images/colorpicker_hsb_s.png);
133
+ top: 82px;
134
+ left: 282px;
135
+ }
136
+ .colorpicker_hsb_b {
137
+ background-image: url(../images/colorpicker_hsb_b.png);
138
+ top: 112px;
139
+ left: 282px;
140
+ }
141
+ .colorpicker_submit {
142
+ position: absolute;
143
+ width: 22px;
144
+ height: 22px;
145
+ background: url(../images/colorpicker_submit.png) top;
146
+ left: 322px;
147
+ top: 142px;
148
+ overflow: hidden;
149
+ }
150
+ .colorpicker_focus {
151
+ background-position: center;
152
+ }
153
+ .colorpicker_hex.colorpicker_focus {
154
+ background-position: bottom;
155
+ }
156
+ .colorpicker_submit.colorpicker_focus {
157
+ background-position: bottom;
158
+ }
159
+ .colorpicker_slider {
160
+ background-position: bottom;
161
+ }
css/fontsforwebstyle.css ADDED
@@ -0,0 +1,852 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .draggableModal * {
2
+ -moz-box-sizing: content-box !important;
3
+ box-sizing: content-box !important;
4
+ border: medium none;
5
+ color: #333333;
6
+ font-family: Tahoma,Geneva,sans-serif;
7
+ font-size: 14px;
8
+ letter-spacing: 0;
9
+ line-height: 1em;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+ .draggableModal input, .draggableModal select, .draggableModal a,
14
+ .draggableModal input[type="text"],
15
+ .draggableModal input[type="password"],
16
+ .draggableModal input[type="email"],
17
+ .draggableModal textarea,
18
+ .draggableModal select
19
+ {
20
+ -moz-box-sizing: content-box !important;
21
+ box-sizing: content-box !important;
22
+ height: auto;
23
+ width: auto;
24
+ background:#fff;
25
+ margin:0;
26
+ padding:0;
27
+ }
28
+ .draggableModal a {
29
+ background: transparent;
30
+ }
31
+ .draggableModal h2 {
32
+ margin-bottom: 1em;
33
+ }
34
+ .draggableModal fieldset {
35
+ float: left;
36
+ padding: 5px 5px;
37
+ }
38
+ .draggableModal fieldset#fontActionButtons {
39
+ width: 110px;
40
+ }
41
+ .draggableModal fieldset label {
42
+ display: block;
43
+ font-size: 12px;
44
+ font-weight: regular;
45
+ margin-bottom: 0.4em;
46
+ }
47
+ .draggableModal fieldset .resetField {
48
+ color: orange;
49
+ font-size: 9px;
50
+ vertical-align: super;
51
+ }
52
+ .draggableModal fieldset input[type="text"] {
53
+ font-size: 11px;
54
+ margin-left: 10px;
55
+ margin-right: 10px;
56
+ padding: 3px;
57
+ width: 50px;
58
+ display:inline-block;
59
+ }
60
+ #text-shadowFieldset .ui-slider {
61
+ float: left;
62
+ }
63
+ #text-shadowFieldset label {
64
+ clear: both;
65
+ float: left;
66
+ }
67
+ /*
68
+ * jQuery UI Slider
69
+ */
70
+ #text-shadowFieldset .ui-slider-horizontal {
71
+ clear: both;
72
+ }
73
+ .draggableModal fieldset.slider-extended input[type="text"] {
74
+ width: 25px;
75
+ padding-left: 5px;
76
+ }
77
+ .draggableModal fieldset.slider-extended .ui-slider-horizontal.ui-slider {
78
+ display: block;
79
+ margin-bottom: 0.5em;
80
+ position: relative;
81
+ top: 3px;
82
+ width: 247px;
83
+ height: 1px;
84
+ /*background: #666666;*/
85
+ background: #ccc;
86
+ border: none;
87
+ }
88
+ .draggableModal fieldset.slider-extended .ui-slider-vertical.ui-slider {
89
+ width: 1px;
90
+ background: #ccc;
91
+ border: none;
92
+ left: 3px;
93
+ }
94
+ .draggableModal fieldset.slider-extended .ui-slider-range {
95
+ background: #666;
96
+ /*background: #fff;*/
97
+ }
98
+
99
+ .draggableModal fieldset .ui-slider-horizontal .ui-slider-handle {
100
+ width: 8px;
101
+ height: 14px;
102
+ border: none;
103
+ background: #000;
104
+ margin-top: -2px;
105
+ }
106
+ .draggableModal fieldset .ui-slider-vertical .ui-slider-handle {
107
+ height: 8px;
108
+ width: 14px;
109
+ border: none;
110
+ background: #000;
111
+ margin-left: -2px;
112
+ }
113
+ .draggableModal fieldset.slider-extended .ui-slider-vertical.ui-slider {
114
+ }
115
+
116
+ /*
117
+ *
118
+ * Appearance panel
119
+ *
120
+ */
121
+ #appearancePanel {
122
+ background: #2b2b2b;
123
+ }
124
+ #appearancePanel fieldset {
125
+ }
126
+ #appearancePanel label {
127
+ color: #f9f5ea;
128
+ }
129
+ #appearancePanel #fontActionButtons {
130
+ }
131
+ #appearancePanel #settingsButtons {
132
+ }
133
+ #appearancePanel #globalChangeFont h3 {
134
+ }
135
+ #appearancePanel #ffw-slider-range-min {
136
+ }
137
+ #appearancePanel #globalChangeFont p {
138
+ }
139
+
140
+ #appearancePanel #globalChangeFont {
141
+ }
142
+ #appearancePanel #selectorFieldset {
143
+ }
144
+
145
+ #appearanceStandardFields fieldset {
146
+ padding-bottom: 2px;
147
+ }
148
+ #font-sizeFieldset label {
149
+ width: 130px;
150
+ display: inline-block;
151
+ }
152
+ #font-sizeFieldset .ui-slider {
153
+ width: 115px;
154
+ display: inline-block;
155
+ }
156
+ #appearancePanel fieldset.slider-extended .ui-slider-horizontal.ui-slider {
157
+ background: #999;
158
+ }
159
+ #appearancePanel fieldset.slider-extended .ui-slider-range {
160
+ background: #ddd;
161
+ }
162
+
163
+ #appearancePanel fieldset .ui-slider-horizontal .ui-slider-handle {
164
+ background: #fff;
165
+ }
166
+
167
+
168
+
169
+ /*
170
+ *
171
+ * Effects panel
172
+ *
173
+ */
174
+ #effectsPanel {
175
+
176
+ }
177
+ #effectsPanel fieldset .ui-slider-horizontal .ui-slider-handle {
178
+ }
179
+ #effectsPanel fieldset.slider-extended .ui-slider-horizontal.ui-slider {
180
+ width: 169px;
181
+ }
182
+ #effectsPanel fieldset.slider-extended .ui-slider-range {
183
+ }
184
+ #effectsPanel > select {
185
+ font-size: 12px;
186
+ margin-left: 4px;
187
+ margin-right: 3px;
188
+ margin-top: 3px;
189
+ margin-bottom: 3px;
190
+ background: #f5f3f3;
191
+ padding-top: 3px;
192
+ padding-bottom: 3px;
193
+ width: 181px;
194
+ }
195
+ #effectsPanel div.label {
196
+
197
+ }
198
+ #effectsPanel div.label > a {
199
+ font-size: 12px;
200
+ }
201
+ #effectsPanel div.label a.effectName {
202
+ width: 140px;
203
+ display: inline-block;
204
+ cursor: n-resize;
205
+ }
206
+ #effectsPanel div.label a.removeEffect {
207
+ font-size: 14px;
208
+ }
209
+ #effectsPanel a.effectArrow {
210
+ background: url("../images/arrow.png") no-repeat scroll left center transparent;
211
+ padding-left: 12px;
212
+ display: inline-block;
213
+ width: 12px;
214
+ height: 12px;
215
+ padding: 0;
216
+ margin: 0;
217
+ }
218
+ #effectsPanel input[name=enabled] {
219
+ margin-right: 3px;
220
+ }
221
+ #effectsPanel .effectsList {
222
+ margin-bottom: 5px;
223
+ }
224
+ #effectsPanel .effectsList > div {
225
+ padding-left: 5px;
226
+ padding-right: 5px;
227
+ padding-top: 5px;
228
+ }
229
+ #effectsPanel .effectsList fieldset {
230
+ float: none;
231
+ }
232
+
233
+
234
+
235
+ .draggableModal label {
236
+ display: inline;
237
+ }
238
+ .draggableModal {
239
+ background: none repeat scroll 0 0 rgba(255, 255, 255, 0.9);
240
+ border-radius: 4px;
241
+ box-shadow: 0 0 7px rgba(0,0,0,0.1);
242
+ margin: 0;
243
+ padding: 0;
244
+ position: fixed;
245
+ }
246
+ .draggableModal input[type="button"], .draggableModal button, .draggableModal input[type="submit"] {
247
+ border: 1px solid #333333;
248
+ border-radius: 3px 3px 3px 3px;
249
+ cursor: pointer;
250
+ padding: 5px;
251
+ }
252
+ .draggableModal input[type="text"], .draggableModal input[type="password"] {
253
+ border: none;
254
+ font-size: 12px;
255
+ padding: 3px 5px;
256
+ border-radius: 2px;
257
+ height: 20px;
258
+ }
259
+ h1.draggableModalBar {
260
+ color: #212121;
261
+ cursor: move;
262
+ font-size: 12px;
263
+ font-weight: normal;
264
+ line-height: 1.35em;
265
+ margin: 0;
266
+ padding: 3px 0;
267
+ text-indent: 7px;
268
+ width: 100%;
269
+ text-align: left;
270
+ }
271
+ h1.draggableModalBar #font_ver {
272
+ background: url("../images/font_ver.png") repeat scroll 0 0 transparent;
273
+ display: block;
274
+ height: 65px;
275
+ left: 33%;
276
+ margin: 0;
277
+ padding: 0;
278
+ position: absolute;
279
+ top: -37px;
280
+ width: 337px;
281
+ }
282
+ h1.draggableModalBar small {
283
+ color: #6D768F;
284
+ font-size: 10px;
285
+ visibility: hidden;
286
+ }
287
+ .draggableModalBar a {
288
+ color: #333333;
289
+ }
290
+ .draggableModalBar .closeModal {
291
+ color: #000;
292
+ font-size: 12px;
293
+ font-weight: bold;
294
+ height: 13px;
295
+ padding: 2px;
296
+ text-align: center;
297
+ text-decoration: none;
298
+ width: 15px;
299
+ margin: 0;
300
+ }
301
+ .draggableModalBar a {
302
+ float: right;
303
+ margin-top: 4px;
304
+ text-indent: 0;
305
+ }
306
+ .draggableModal .loading {
307
+ background: url("../loadinfo.net.gif") repeat scroll 0 0 transparent;
308
+ height: 48px;
309
+ margin: 60px auto;
310
+ width: 48px;
311
+ }
312
+ .fontLoading {
313
+ background: url("../loadinfo.net.gif") no-repeat scroll center center #fff;
314
+ border-radius: 10px;
315
+ height: 48px;
316
+ width: 48px;
317
+ position: fixed;
318
+ top:50px;
319
+ left: 30px;
320
+ padding:20px;
321
+ }
322
+ #media-buttons a#FFW_chooseFontButton {
323
+ height: 13px;
324
+ padding-bottom: 0;
325
+ width: 95px;
326
+ }
327
+ #media-buttons a#FFW_chooseFontButton:hover {
328
+ background-position: 0 -13px !important;
329
+ }
330
+ #fontplugin {
331
+ color: #464646;
332
+ height: 80%;
333
+ right: 0;
334
+ top: 70px;
335
+ width: 300px;
336
+ z-index: 10000;
337
+ position:fixed;
338
+ background:#fff;
339
+ display:none;
340
+ }
341
+ #fontplugin ul {
342
+ margin: 0;
343
+ padding: 0;
344
+ }
345
+ #fontplugin #fontslist {
346
+ height: 95%;
347
+ margin-left: 15px;
348
+ width: 285px;
349
+ }
350
+ #fontplugin #uploaded {
351
+ height: 76%;
352
+ overflow-x: hidden;
353
+ overflow-y: auto;
354
+ padding: 10px;
355
+ }
356
+ #fontplugin #uploaded a {
357
+ color: #0066CC;
358
+ }
359
+ #fontplugin #uploaded p {
360
+ font-size: 12px;
361
+ line-height: 1.5em;
362
+ margin-bottom: 1em;
363
+ }
364
+ #fontplugin #uploaded input[type="text"], #fontplugin #uploaded input[type="password"] {
365
+ margin-bottom: 10px;
366
+ margin-left: 10px;
367
+ text-align: left;
368
+ }
369
+ #fontplugin #uploaded .fontUploadForm {
370
+ background: none repeat scroll 0 0 #E4EFFC;
371
+ border: 1px solid #DDDDDD;
372
+ margin-bottom: 1em;
373
+ padding: 0.5em 5px;
374
+ }
375
+ #fontplugin #uploaded input.input_file {
376
+ margin: 1em auto;
377
+ }
378
+ #fontplugin #uploaded .fontsList {
379
+ margin-bottom: 1em;
380
+ }
381
+ #fontplugin #uploaded form {
382
+ margin: auto;
383
+ text-align: right;
384
+ width: 90%;
385
+ }
386
+ #fontplugin #uploaded li {
387
+ list-style-type: none;
388
+ position: relative;
389
+ }
390
+ #fontplugin div.tablinks {
391
+ border-bottom: 1px solid #CCCCCC;
392
+ border-left: 0 none;
393
+ padding: 2px 2px 0;
394
+ text-decoration: none;
395
+ }
396
+ #fontplugin a.tablink {
397
+ background: none repeat scroll 0 0 #FFFFFF;
398
+ border-color: #AAAAAA;
399
+ border-radius: 10px 10px 0 0;
400
+ border-style: solid;
401
+ border-width: 1px 1px 0;
402
+ color: #222222;
403
+ display: inline-block;
404
+ font-size: 12px;
405
+ font-weight: bold;
406
+ line-height: 1.5em;
407
+ padding: 5px 10px;
408
+ position: relative;
409
+ text-decoration: none;
410
+ top: 1px;
411
+ }
412
+ #fontplugin a.close_link {
413
+ color: #21759B;
414
+ float: right;
415
+ font-size: 11px;
416
+ padding: 9px 6px 3px 3px;
417
+ }
418
+ #fontplugin .fcarousel-container {
419
+ height: 84%;
420
+ left: -4px;
421
+ padding-left: 10px;
422
+ padding-right: 10px;
423
+ position: relative;
424
+ }
425
+ #fontplugin .fcarousel-clip {
426
+ height: 100%;
427
+ left: 0;
428
+ position: relative;
429
+ }
430
+ #fontplugin .fcarousel-next {
431
+ background: url("../images/forward.png") repeat scroll -29px 0 transparent;
432
+ color: red;
433
+ display: none !important;
434
+ height: 100%;
435
+ position: absolute;
436
+ right: 0;
437
+ top: 0;
438
+ width: 17px;
439
+ z-index: 5;
440
+ }
441
+ #fontplugin .fcarousel-next-disabled {
442
+ background-position: -2px 0;
443
+ cursor: default;
444
+ }
445
+ #fontplugin .fcarousel-prev {
446
+ background: url("../images/back.png") repeat scroll 27px 0 transparent;
447
+ color: red;
448
+ cursor: pointer;
449
+ height: 120px;
450
+ left: -12px;
451
+ position: absolute;
452
+ top: 20px;
453
+ width: 21px;
454
+ z-index: 15;
455
+ }
456
+ #fontplugin .fcarousel-prev-disabled {
457
+ background-position: 0 0;
458
+ cursor: default;
459
+ }
460
+ #fontplugin #FFW_browser_carousel {
461
+ height: 100%;
462
+ }
463
+ #fontplugin #FFW_browser_carousel li.fcarousel-item {
464
+ height: 100%;
465
+ width: 265px;
466
+ }
467
+ #fontplugin #FFW_browser_carousel li .logo_slide {
468
+ background: url("../images/logo_slide.png") repeat scroll 0 0 #DDDDDD;
469
+ height: 452px;
470
+ width: 240px;
471
+ }
472
+ #fontplugin li.categoriesList ul li {
473
+ margin: 0;
474
+ list-style-type:none;
475
+ }
476
+ #fontplugin li.categoriesList a {
477
+ background: none repeat scroll 0 0 #FFFFFF;
478
+ border-bottom: 1px solid #DDDDDD;
479
+ display: block;
480
+ font-size: 19px;
481
+ margin: 0;
482
+ text-decoration: none;
483
+ width: 100%;
484
+ }
485
+ #fontplugin li.categoriesList a.delete {
486
+ background: none repeat scroll 0 0 #FFFFFF;
487
+ border: 1px solid #DDDDDD;
488
+ border-radius: 3px 3px 3px 3px;
489
+ color: red;
490
+ display: block;
491
+ font-size: 14px;
492
+ height: 15px;
493
+ padding: 3px 5px;
494
+ position: absolute;
495
+ right: 4px;
496
+ top: 10px;
497
+ width: 8px;
498
+ }
499
+ #fontplugin li.categoriesList a.delete:hover {
500
+ background: none repeat scroll 0 0 #EE3300;
501
+ color: #FFFFFF;
502
+ font-weight: bold;
503
+ text-indent: -1px;
504
+ }
505
+ #fontplugin li.categoriesList a img {
506
+ width: 100%;
507
+ }
508
+ #fontplugin li.fcarousel-item ul {
509
+ height: 100%;
510
+ overflow: auto;
511
+ }
512
+ #fontplugin li#fontList ul li {
513
+ background: none repeat scroll 0 0 #CCCCCC;
514
+ border-bottom: 1px solid #EEEEEE;
515
+ font-size: 14px;
516
+ margin: 0;
517
+ list-style-type:none;
518
+ }
519
+ #fontplugin li#fontList ul li:hover {
520
+ position: relative;
521
+ }
522
+ #fontplugin li#fontList ul li a {
523
+ display: block;
524
+ }
525
+ #fontplugin li#fontList ul li a img {
526
+ border: medium none;
527
+ width: 100%;
528
+ }
529
+ #fontplugin a.font_pick span.font_pick_hint {
530
+ display: none;
531
+ }
532
+ #fontplugin li#fontList ul li a.font_pick:hover span.font_pick_hint {
533
+ background: none repeat scroll 0 0 #666666;
534
+ color: #FFFFFF;
535
+ display: none;
536
+ font-size: 10px;
537
+ height: 16px;
538
+ padding: 2px;
539
+ position: absolute;
540
+ right: 0;
541
+ }
542
+ #fontplugin li#fontList ul li:hover a.font_pick {
543
+ border-top: 1px solid #DDDDDD;
544
+ margin-bottom: -1px;
545
+ position: relative;
546
+ text-decoration: none;
547
+ top: -16px;
548
+ }
549
+ #fontplugin li#fontList ul li.firstElementOLD:hover a.font_pick {
550
+ margin-bottom: 15px;
551
+ top: 0;
552
+ }
553
+ #fontplugin li#fontList ul li a.font_url {
554
+ color: #000000 !important;
555
+ display: none;
556
+ font-size: 11px !important;
557
+ }
558
+ #fontplugin li#fontList ul li:hover a.font_url {
559
+ bottom: 0;
560
+ display: block;
561
+ padding: 2px;
562
+ position: absolute;
563
+ right: 2px;
564
+ text-decoration: none;
565
+ }
566
+
567
+ #presetsPanel {
568
+ z-index: 10000;
569
+ background: rgba(255,255,255,0.88);
570
+ }
571
+ #presetsPanel #presetsDropdownFieldset {
572
+ display: block;
573
+ float: left;
574
+ width: 105px;
575
+ height: auto;
576
+ padding: 0;
577
+ margin-bottom: 0;
578
+ position: relative;
579
+ }
580
+ #presetsPanel #presetsDropdownFieldset:hover {
581
+ }
582
+ #presetsDropdownFieldset:hover button#deletePreset, #presetsDropdownFieldset:hover button#renamePreset {
583
+ display: block !important;
584
+ }
585
+
586
+
587
+
588
+ #presetsPanel #selectorFieldset {
589
+ margin-top: 0;
590
+ padding: 0;
591
+ float: left;
592
+ margin-left:3px;
593
+ }
594
+ #actionsFieldset {
595
+ float: right;
596
+ text-align: right;
597
+ padding: 0;
598
+ position: relative;
599
+ top: 4px;
600
+ right: 3px;
601
+ width: 630px;
602
+ }
603
+ #actionsFieldset .closeModal {
604
+ float: right;
605
+ padding: 3px 5px;
606
+ font-weight: bold;
607
+ border: none;
608
+ border-radius: 2px;
609
+ margin-left: 10px;
610
+ color: #fff;
611
+ text-decoration: none;
612
+ margin-top: 2px;
613
+ font-size: 16px;
614
+ margin-right: 5px;
615
+ }
616
+ #presetsPanel #presetsDropdownFieldset label, #presetsPanel #selectorFieldset label {
617
+ font-size: 12px;
618
+ font-weight: regular;
619
+ width: 105px;
620
+ padding-left:3px;
621
+ text-indent: 3px;
622
+ line-height: 1.5em;
623
+ }
624
+ #presetsPanel #presetsDropdownFieldset select {
625
+ border: 1px solid #f5f3f3;
626
+ background: #f5f3f3;
627
+ color: #212121;
628
+ font-size: 11px;
629
+ font-weight: normal;
630
+ height: 19px;
631
+ padding: 0;
632
+ width: 91px;
633
+ float: none;
634
+ margin-top: 3px;
635
+ margin-left: 0;
636
+ display: block;
637
+ }
638
+
639
+ #presetsPanel #presetsDropdownFieldset button {
640
+ border: none;
641
+ height: 15px;
642
+ margin: 0;
643
+ font-size: 11px;
644
+ padding: 0;
645
+ background-size: 100% 100% !important;
646
+ }
647
+ #presetsPanel #presetsDropdownFieldset button#deletePreset {
648
+ position: absolute;
649
+ left: 98%;
650
+ top: 9px;
651
+ display: none;
652
+ background: none;
653
+ color: #f10c0c;
654
+ font-weight: bold;
655
+ }
656
+ #presetsPanel #presetsDropdownFieldset button#renamePreset {
657
+ float: none;
658
+ position: absolute;
659
+ left: 98%; /* can't be over 100 because hover will disappear'*/
660
+ top: 22px;
661
+ display: none;
662
+ background: none;
663
+ color: #212121;
664
+ }
665
+ #presetsPanel #selectorFieldset input[name="selector"] {
666
+ border: 1px solid #999999;
667
+ color: #333333;
668
+ display: block;
669
+ float: right;
670
+ font-size: 11px;
671
+ height: 18px;
672
+ margin: 0;
673
+ padding: 5px;
674
+ width: 74%;
675
+ }
676
+ #presetsPanel > .pickElement {
677
+ background: url("../images/pick.png") repeat scroll 0 0 transparent;
678
+ border: medium none;
679
+ font-size: 0;
680
+
681
+ margin-left: 3px;
682
+ margin-bottom: 5px;
683
+ margin-top: 3px;
684
+ padding: 0;
685
+ text-indent: -10000px;
686
+ width: 99px;
687
+ height: 36px;
688
+ }
689
+ #presetsPanel #selectorFieldset .pickAddElement {
690
+ width: 99px;
691
+ height: 36px;
692
+ /*opacity:0.7;*/
693
+ background-size: 100% 100%;
694
+ }
695
+ div.colorpicker {
696
+ z-index: 150000;
697
+ }
698
+ #presetsPanel #selectorFieldset .pickElement.pickAddElement {
699
+ background: url("../images/pick_add.png") repeat scroll 0 0 transparent;
700
+ border: medium none;
701
+ margin-bottom: 5px;
702
+ text-indent: -10000px;
703
+ border: medium none;
704
+ font-size: 0;
705
+ padding: 0;
706
+ }
707
+
708
+ button#fontfaceSettings {
709
+ background: url("../images/font_settings.png") repeat scroll 0 0 transparent;
710
+ border: medium none;
711
+ float: left;
712
+ font-size: 0;
713
+ height: 27px;
714
+ margin: 0 5px 0 0;
715
+ padding: 0;
716
+ text-indent: -10000px;
717
+ width: 63px;
718
+ }
719
+ button#colorsizeSettings {
720
+ background: url("../images/snc_settings.png") repeat scroll 0 0 transparent;
721
+ border: medium none;
722
+ float: left;
723
+ height: 27px;
724
+ margin: 0;
725
+ padding: 0;
726
+ margin-right: 5px;
727
+ text-indent: -10000px;
728
+ width: 63px;
729
+ }
730
+ button#add3dSettings {
731
+ margin-right: 5px;
732
+ float:left;
733
+ height:16px;
734
+ }
735
+ a#upgradeToProButton {
736
+ background: url("../images/pro_settings.png") repeat scroll 0 0 transparent;
737
+ font-size: 0;
738
+ width: 135px;
739
+ height: 51px;
740
+ margin: 0;
741
+ padding: 0;
742
+ text-indent: -10000px;
743
+ margin-bottom: -20px;
744
+ margin-right: 3px;
745
+ margin-left: 3px;
746
+ float: left;
747
+ }
748
+ #fontSaveSettings {
749
+ background: url("../images/save.png") repeat scroll 0 0 transparent;
750
+ border: medium none;
751
+ font-size: 0;
752
+ height: 40px;
753
+ padding: 0;
754
+ text-indent: -10000px;
755
+ width: 96px;
756
+ margin-bottom: -2px;
757
+ }
758
+ button#extrafieldsSettings {
759
+ background: url("../images/pro.png") repeat scroll 0 0 transparent;
760
+ text-indent: -10000px;
761
+ width: 137px;
762
+ height: 34px;
763
+ padding: 0;
764
+ border: none;
765
+ margin: -3px 3px 0;
766
+ }
767
+ #effectsButton {
768
+ background: url("../images/effects.png") repeat scroll 0 0 transparent;
769
+ text-indent: -10000px;
770
+ width: 113px;
771
+ height: 34px;
772
+ padding: 0;
773
+ border: none;
774
+ margin: -3px 5px 0;
775
+ }
776
+ button#shadowSettings {
777
+ background: lightgray;
778
+ margin-top: 0;
779
+ margin-right: 6px;
780
+ float: left;
781
+ text-shadow: 2px 2px 3px #000;
782
+ font-weight: bold;
783
+ }
784
+
785
+ .XYSliderHolder {
786
+ width: 10px;
787
+ height:10px;
788
+ position:absolute;
789
+ top:20px;
790
+ left:50%;
791
+ padding:0;
792
+ margin:0;
793
+ }
794
+ .XYSlider {
795
+ position:absolute;
796
+ width: 36px !important;
797
+ height:32px;
798
+
799
+ background: url("../images/3d-XYSlider.png") repeat scroll 0 0 transparent;
800
+ text-indent: -10000px;
801
+
802
+ border: none;
803
+
804
+ font-size:12px !important;
805
+ letter-spacing: normal !important;
806
+ color: black;
807
+ font-family:Arial, Helvetica, sans-serif !important;
808
+ padding:0 !important;
809
+ margin:0 !important;
810
+ text-shadow:none !important;
811
+ text-align:center;
812
+ font-weight:normal !important;
813
+ line-height:2em !important;
814
+ }
815
+ .extrudeHandleHolder {
816
+ width: 10px;
817
+ height:10px;
818
+ position:absolute;
819
+ top:20px;
820
+ left:50%;
821
+ padding:0;
822
+ margin:0;
823
+ }
824
+ .extrudeHandle {
825
+ position:absolute;
826
+ width: 55px !important;
827
+ height:25px;
828
+ background:rgba(255, 255, 0, 0.8);
829
+ border:1px solid rgba(0, 0, 0, 0.8);
830
+ border-radius: 10px;
831
+ font-size:12px !important;
832
+
833
+ letter-spacing: normal !important;
834
+ color: black;
835
+ font-family:Arial, Helvetica, sans-serif !important;
836
+ padding:2px !important;
837
+ text-shadow:none !important;
838
+ text-align:center;
839
+ font-weight:normal !important;
840
+ line-height:2em !important;
841
+ }
842
+ .cancelSelecting {
843
+ background: none repeat scroll 0 0 red;
844
+ border-radius: 0 0 20px 0;
845
+ color: #FFFFFF;
846
+ font-size: 16px;
847
+ left: 0;
848
+ padding: 17px 15px 9px 8px;
849
+ position: fixed;
850
+ top: 20px;
851
+ z-index: 10000;
852
+ }
css/start/images/ui-bg_flat_55_999999_40x100.png ADDED
Binary file
css/start/images/ui-bg_flat_75_aaaaaa_40x100.png ADDED
Binary file
css/start/images/ui-bg_glass_45_0078ae_1x400.png ADDED
Binary file
css/start/images/ui-bg_glass_55_f8da4e_1x400.png ADDED
Binary file
css/start/images/ui-bg_glass_75_79c9ec_1x400.png ADDED
Binary file
css/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png ADDED
Binary file
css/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png ADDED
Binary file
css/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png ADDED
Binary file
css/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png ADDED
Binary file
css/start/images/ui-icons_0078ae_256x240.png ADDED
Binary file
css/start/images/ui-icons_056b93_256x240.png ADDED
Binary file
css/start/images/ui-icons_d8e7f3_256x240.png ADDED
Binary file
css/start/images/ui-icons_e0fdff_256x240.png ADDED
Binary file
css/start/images/ui-icons_f5e175_256x240.png ADDED
Binary file
css/start/images/ui-icons_f7a50d_256x240.png ADDED
Binary file
css/start/images/ui-icons_fcd113_256x240.png ADDED
Binary file
css/start/jquery-ui-1.8.14.custom.css ADDED
@@ -0,0 +1,535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.14
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming/API
9
+ */
10
+ /* Layout helpers
11
+ ----------------------------------*/
12
+ .ui-helper-hidden { display: none; }
13
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
14
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
15
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
16
+ .ui-helper-clearfix { display: inline-block; }
17
+ /* required comment for clearfix to work in Opera \*/
18
+ * html .ui-helper-clearfix { height:1%; }
19
+ .ui-helper-clearfix { display:block; }
20
+ /* end clearfix */
21
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
22
+ /* Interaction Cues
23
+ ----------------------------------*/
24
+ .ui-state-disabled { cursor: default !important; }
25
+ /* Icons
26
+ ----------------------------------*/
27
+ /* states and images */
28
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
29
+ /* Misc visuals
30
+ ----------------------------------*/
31
+ /* Overlays */
32
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
33
+ /*
34
+ * jQuery UI CSS Framework 1.8.14
35
+ *
36
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
37
+ * Dual licensed under the MIT or GPL Version 2 licenses.
38
+ * http://jquery.org/license
39
+ *
40
+ * http://docs.jquery.com/UI/Theming/API
41
+ *
42
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=2191c0&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=75&borderColorHeader=4297d7&fcHeader=eaf5f7&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=0078ae&bgColorDefault=0078ae&bgTextureDefault=02_glass.png&bgImgOpacityDefault=45&borderColorDefault=77d5f7&fcDefault=ffffff&iconColorDefault=e0fdff&bgColorHover=79c9ec&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=448dae&fcHover=026890&iconColorHover=056b93&bgColorActive=6eac2c&bgTextureActive=12_gloss_wave.png&bgImgOpacityActive=50&borderColorActive=acdd4a&fcActive=ffffff&iconColorActive=f5e175&bgColorHighlight=f8da4e&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcd113&fcHighlight=915608&iconColorHighlight=f7a50d&bgColorError=e14f1c&bgTextureError=12_gloss_wave.png&bgImgOpacityError=45&borderColorError=cd0a0a&fcError=ffffff&iconColorError=fcd113&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=75&opacityOverlay=30&bgColorShadow=999999&bgTextureShadow=01_flat.png&bgImgOpacityShadow=55&opacityShadow=45&thicknessShadow=0px&offsetTopShadow=5px&offsetLeftShadow=5px&cornerRadiusShadow=5px
43
+ */
44
+ /* Component containers
45
+ ----------------------------------*/
46
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
47
+ .ui-widget .ui-widget { font-size: 1em; }
48
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
49
+ .ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }
50
+ .ui-widget-content a { color: #222222; }
51
+ .ui-widget-header { border: 1px solid #4297d7; background: #2191c0 url(images/ui-bg_gloss-wave_75_2191c0_500x100.png) 50% 50% repeat-x; color: #eaf5f7; font-weight: bold; }
52
+ .ui-widget-header a { color: #eaf5f7; }
53
+ /* Interaction states
54
+ ----------------------------------*/
55
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #77d5f7; background: #0078ae url(images/ui-bg_glass_45_0078ae_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; }
56
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; }
57
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #448dae; background: #79c9ec url(images/ui-bg_glass_75_79c9ec_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #026890; }
58
+ .ui-state-hover a, .ui-state-hover a:hover { color: #026890; text-decoration: none; }
59
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #acdd4a; background: #6eac2c url(images/ui-bg_gloss-wave_50_6eac2c_500x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; }
60
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; }
61
+ .ui-widget :active { outline: none; }
62
+ /* Interaction Cues
63
+ ----------------------------------*/
64
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcd113; background: #f8da4e url(images/ui-bg_glass_55_f8da4e_1x400.png) 50% 50% repeat-x; color: #915608; }
65
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #915608; }
66
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #e14f1c url(images/ui-bg_gloss-wave_45_e14f1c_500x100.png) 50% top repeat-x; color: #ffffff; }
67
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
68
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
69
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
70
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
71
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
72
+ /* Icons
73
+ ----------------------------------*/
74
+ /* states and images */
75
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_0078ae_256x240.png); }
76
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_0078ae_256x240.png); }
77
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }
78
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_e0fdff_256x240.png); }
79
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_056b93_256x240.png); }
80
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_f5e175_256x240.png); }
81
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_f7a50d_256x240.png); }
82
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fcd113_256x240.png); }
83
+ /* positioning */
84
+ .ui-icon-carat-1-n { background-position: 0 0; }
85
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
86
+ .ui-icon-carat-1-e { background-position: -32px 0; }
87
+ .ui-icon-carat-1-se { background-position: -48px 0; }
88
+ .ui-icon-carat-1-s { background-position: -64px 0; }
89
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
90
+ .ui-icon-carat-1-w { background-position: -96px 0; }
91
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
92
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
93
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
94
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
95
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
96
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
97
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
98
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
99
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
100
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
101
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
102
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
103
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
104
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
105
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
106
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
107
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
108
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
109
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
110
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
111
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
112
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
113
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
114
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
115
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
116
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
117
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
118
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
119
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
120
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
121
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
122
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
123
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
124
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
125
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
126
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
127
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
128
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
129
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
130
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
131
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
132
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
133
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
134
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
135
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
136
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
137
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
138
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
139
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
140
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
141
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
142
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
143
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
144
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
145
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
146
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
147
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
148
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
149
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
150
+ .ui-icon-extlink { background-position: -32px -80px; }
151
+ .ui-icon-newwin { background-position: -48px -80px; }
152
+ .ui-icon-refresh { background-position: -64px -80px; }
153
+ .ui-icon-shuffle { background-position: -80px -80px; }
154
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
155
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
156
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
157
+ .ui-icon-folder-open { background-position: -16px -96px; }
158
+ .ui-icon-document { background-position: -32px -96px; }
159
+ .ui-icon-document-b { background-position: -48px -96px; }
160
+ .ui-icon-note { background-position: -64px -96px; }
161
+ .ui-icon-mail-closed { background-position: -80px -96px; }
162
+ .ui-icon-mail-open { background-position: -96px -96px; }
163
+ .ui-icon-suitcase { background-position: -112px -96px; }
164
+ .ui-icon-comment { background-position: -128px -96px; }
165
+ .ui-icon-person { background-position: -144px -96px; }
166
+ .ui-icon-print { background-position: -160px -96px; }
167
+ .ui-icon-trash { background-position: -176px -96px; }
168
+ .ui-icon-locked { background-position: -192px -96px; }
169
+ .ui-icon-unlocked { background-position: -208px -96px; }
170
+ .ui-icon-bookmark { background-position: -224px -96px; }
171
+ .ui-icon-tag { background-position: -240px -96px; }
172
+ .ui-icon-home { background-position: 0 -112px; }
173
+ .ui-icon-flag { background-position: -16px -112px; }
174
+ .ui-icon-calendar { background-position: -32px -112px; }
175
+ .ui-icon-cart { background-position: -48px -112px; }
176
+ .ui-icon-pencil { background-position: -64px -112px; }
177
+ .ui-icon-clock { background-position: -80px -112px; }
178
+ .ui-icon-disk { background-position: -96px -112px; }
179
+ .ui-icon-calculator { background-position: -112px -112px; }
180
+ .ui-icon-zoomin { background-position: -128px -112px; }
181
+ .ui-icon-zoomout { background-position: -144px -112px; }
182
+ .ui-icon-search { background-position: -160px -112px; }
183
+ .ui-icon-wrench { background-position: -176px -112px; }
184
+ .ui-icon-gear { background-position: -192px -112px; }
185
+ .ui-icon-heart { background-position: -208px -112px; }
186
+ .ui-icon-star { background-position: -224px -112px; }
187
+ .ui-icon-link { background-position: -240px -112px; }
188
+ .ui-icon-cancel { background-position: 0 -128px; }
189
+ .ui-icon-plus { background-position: -16px -128px; }
190
+ .ui-icon-plusthick { background-position: -32px -128px; }
191
+ .ui-icon-minus { background-position: -48px -128px; }
192
+ .ui-icon-minusthick { background-position: -64px -128px; }
193
+ .ui-icon-close { background-position: -80px -128px; }
194
+ .ui-icon-closethick { background-position: -96px -128px; }
195
+ .ui-icon-key { background-position: -112px -128px; }
196
+ .ui-icon-lightbulb { background-position: -128px -128px; }
197
+ .ui-icon-scissors { background-position: -144px -128px; }
198
+ .ui-icon-clipboard { background-position: -160px -128px; }
199
+ .ui-icon-copy { background-position: -176px -128px; }
200
+ .ui-icon-contact { background-position: -192px -128px; }
201
+ .ui-icon-image { background-position: -208px -128px; }
202
+ .ui-icon-video { background-position: -224px -128px; }
203
+ .ui-icon-script { background-position: -240px -128px; }
204
+ .ui-icon-alert { background-position: 0 -144px; }
205
+ .ui-icon-info { background-position: -16px -144px; }
206
+ .ui-icon-notice { background-position: -32px -144px; }
207
+ .ui-icon-help { background-position: -48px -144px; }
208
+ .ui-icon-check { background-position: -64px -144px; }
209
+ .ui-icon-bullet { background-position: -80px -144px; }
210
+ .ui-icon-radio-off { background-position: -96px -144px; }
211
+ .ui-icon-radio-on { background-position: -112px -144px; }
212
+ .ui-icon-pin-w { background-position: -128px -144px; }
213
+ .ui-icon-pin-s { background-position: -144px -144px; }
214
+ .ui-icon-play { background-position: 0 -160px; }
215
+ .ui-icon-pause { background-position: -16px -160px; }
216
+ .ui-icon-seek-next { background-position: -32px -160px; }
217
+ .ui-icon-seek-prev { background-position: -48px -160px; }
218
+ .ui-icon-seek-end { background-position: -64px -160px; }
219
+ .ui-icon-seek-start { background-position: -80px -160px; }
220
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
221
+ .ui-icon-seek-first { background-position: -80px -160px; }
222
+ .ui-icon-stop { background-position: -96px -160px; }
223
+ .ui-icon-eject { background-position: -112px -160px; }
224
+ .ui-icon-volume-off { background-position: -128px -160px; }
225
+ .ui-icon-volume-on { background-position: -144px -160px; }
226
+ .ui-icon-power { background-position: 0 -176px; }
227
+ .ui-icon-signal-diag { background-position: -16px -176px; }
228
+ .ui-icon-signal { background-position: -32px -176px; }
229
+ .ui-icon-battery-0 { background-position: -48px -176px; }
230
+ .ui-icon-battery-1 { background-position: -64px -176px; }
231
+ .ui-icon-battery-2 { background-position: -80px -176px; }
232
+ .ui-icon-battery-3 { background-position: -96px -176px; }
233
+ .ui-icon-circle-plus { background-position: 0 -192px; }
234
+ .ui-icon-circle-minus { background-position: -16px -192px; }
235
+ .ui-icon-circle-close { background-position: -32px -192px; }
236
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
237
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
238
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
239
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
240
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
241
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
242
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
243
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
244
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
245
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
246
+ .ui-icon-circle-check { background-position: -208px -192px; }
247
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
248
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
249
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
250
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
251
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
252
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
253
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
254
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
255
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
256
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
257
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
258
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
259
+ /* Misc visuals
260
+ ----------------------------------*/
261
+ /* Corner radius */
262
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -khtml-border-top-left-radius: 5px; border-top-left-radius: 5px; }
263
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -khtml-border-top-right-radius: 5px; border-top-right-radius: 5px; }
264
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -khtml-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
265
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -khtml-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
266
+ /* Overlays */
267
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_75_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
268
+ .ui-widget-shadow { margin: 5px 0 0 5px; padding: 0px; background: #999999 url(images/ui-bg_flat_55_999999_40x100.png) 50% 50% repeat-x; opacity: .45;filter:Alpha(Opacity=45); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/*
269
+ * jQuery UI Resizable 1.8.14
270
+ *
271
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
272
+ * Dual licensed under the MIT or GPL Version 2 licenses.
273
+ * http://jquery.org/license
274
+ *
275
+ * http://docs.jquery.com/UI/Resizable#theming
276
+ */
277
+ .ui-resizable { position: relative;}
278
+ .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
279
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
280
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
281
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
282
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
283
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
284
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
285
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
286
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
287
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
288
+ * jQuery UI Selectable 1.8.14
289
+ *
290
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
291
+ * Dual licensed under the MIT or GPL Version 2 licenses.
292
+ * http://jquery.org/license
293
+ *
294
+ * http://docs.jquery.com/UI/Selectable#theming
295
+ */
296
+ .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
297
+ /*
298
+ * jQuery UI Accordion 1.8.14
299
+ *
300
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
301
+ * Dual licensed under the MIT or GPL Version 2 licenses.
302
+ * http://jquery.org/license
303
+ *
304
+ * http://docs.jquery.com/UI/Accordion#theming
305
+ */
306
+ /* IE/Win - Fix animation bug - #4615 */
307
+ .ui-accordion { width: 100%; }
308
+ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
309
+ .ui-accordion .ui-accordion-li-fix { display: inline; }
310
+ .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
311
+ .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
312
+ .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
313
+ .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
314
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
315
+ .ui-accordion .ui-accordion-content-active { display: block; }
316
+ /*
317
+ * jQuery UI Autocomplete 1.8.14
318
+ *
319
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
320
+ * Dual licensed under the MIT or GPL Version 2 licenses.
321
+ * http://jquery.org/license
322
+ *
323
+ * http://docs.jquery.com/UI/Autocomplete#theming
324
+ */
325
+ .ui-autocomplete { position: absolute; cursor: default; }
326
+ /* workarounds */
327
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
328
+ /*
329
+ * jQuery UI Menu 1.8.14
330
+ *
331
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
332
+ * Dual licensed under the MIT or GPL Version 2 licenses.
333
+ * http://jquery.org/license
334
+ *
335
+ * http://docs.jquery.com/UI/Menu#theming
336
+ */
337
+ .ui-menu {
338
+ list-style:none;
339
+ padding: 2px;
340
+ margin: 0;
341
+ display:block;
342
+ float: left;
343
+ }
344
+ .ui-menu .ui-menu {
345
+ margin-top: -3px;
346
+ }
347
+ .ui-menu .ui-menu-item {
348
+ margin:0;
349
+ padding: 0;
350
+ zoom: 1;
351
+ float: left;
352
+ clear: left;
353
+ width: 100%;
354
+ }
355
+ .ui-menu .ui-menu-item a {
356
+ text-decoration:none;
357
+ display:block;
358
+ padding:.2em .4em;
359
+ line-height:1.5;
360
+ zoom:1;
361
+ }
362
+ .ui-menu .ui-menu-item a.ui-state-hover,
363
+ .ui-menu .ui-menu-item a.ui-state-active {
364
+ font-weight: normal;
365
+ margin: -1px;
366
+ }
367
+ /*
368
+ * jQuery UI Button 1.8.14
369
+ *
370
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
371
+ * Dual licensed under the MIT or GPL Version 2 licenses.
372
+ * http://jquery.org/license
373
+ *
374
+ * http://docs.jquery.com/UI/Button#theming
375
+ */
376
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
377
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
378
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
379
+ .ui-button-icons-only { width: 3.4em; }
380
+ button.ui-button-icons-only { width: 3.7em; }
381
+ /*button text element */
382
+ .ui-button .ui-button-text { display: block; line-height: 1.4; }
383
+ .ui-button-text-only .ui-button-text { padding: .4em 1em; }
384
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
385
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
386
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
387
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
388
+ /* no icon support for input elements, provide padding by default */
389
+ input.ui-button { padding: .4em 1em; }
390
+ /*button icon element(s) */
391
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
392
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
393
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
394
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
395
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
396
+ /*button sets*/
397
+ .ui-buttonset { margin-right: 7px; }
398
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
399
+ /* workarounds */
400
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
401
+ /*
402
+ * jQuery UI Dialog 1.8.14
403
+ *
404
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
405
+ * Dual licensed under the MIT or GPL Version 2 licenses.
406
+ * http://jquery.org/license
407
+ *
408
+ * http://docs.jquery.com/UI/Dialog#theming
409
+ */
410
+ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
411
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
412
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
413
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
414
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
415
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
416
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
417
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
418
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
419
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
420
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
421
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
422
+ /*
423
+ * jQuery UI Slider 1.8.14
424
+ *
425
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
426
+ * Dual licensed under the MIT or GPL Version 2 licenses.
427
+ * http://jquery.org/license
428
+ *
429
+ * http://docs.jquery.com/UI/Slider#theming
430
+ */
431
+ .ui-slider { position: relative; text-align: left; }
432
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
433
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
434
+ .ui-slider-horizontal { height: .8em; }
435
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
436
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
437
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
438
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
439
+ .ui-slider-vertical { width: .8em; height: 100px; }
440
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
441
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
442
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
443
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
444
+ * jQuery UI Tabs 1.8.14
445
+ *
446
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
447
+ * Dual licensed under the MIT or GPL Version 2 licenses.
448
+ * http://jquery.org/license
449
+ *
450
+ * http://docs.jquery.com/UI/Tabs#theming
451
+ */
452
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
453
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
454
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
455
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
456
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
457
+ .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
458
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
459
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
460
+ .ui-tabs .ui-tabs-hide { display: none !important; }
461
+ /*
462
+ * jQuery UI Datepicker 1.8.14
463
+ *
464
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
465
+ * Dual licensed under the MIT or GPL Version 2 licenses.
466
+ * http://jquery.org/license
467
+ *
468
+ * http://docs.jquery.com/UI/Datepicker#theming
469
+ */
470
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
471
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
472
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
473
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
474
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
475
+ .ui-datepicker .ui-datepicker-next { right:2px; }
476
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
477
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
478
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
479
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
480
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
481
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
482
+ .ui-datepicker select.ui-datepicker-month,
483
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
484
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
485
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
486
+ .ui-datepicker td { border: 0; padding: 1px; }
487
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
488
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
489
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
490
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
491
+ /* with multiple calendars */
492
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
493
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
494
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
495
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
496
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
497
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
498
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
499
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
500
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
501
+ .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
502
+ /* RTL support */
503
+ .ui-datepicker-rtl { direction: rtl; }
504
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
505
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
506
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
507
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
508
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
509
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
510
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
511
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
512
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
513
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
514
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
515
+ .ui-datepicker-cover {
516
+ display: none; /*sorry for IE5*/
517
+ display/**/: block; /*sorry for IE5*/
518
+ position: absolute; /*must have*/
519
+ z-index: -1; /*must have*/
520
+ filter: mask(); /*must have*/
521
+ top: -4px; /*must have*/
522
+ left: -4px; /*must have*/
523
+ width: 200px; /*must have*/
524
+ height: 200px; /*must have*/
525
+ }/*
526
+ * jQuery UI Progressbar 1.8.14
527
+ *
528
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
529
+ * Dual licensed under the MIT or GPL Version 2 licenses.
530
+ * http://jquery.org/license
531
+ *
532
+ * http://docs.jquery.com/UI/Progressbar#theming
533
+ */
534
+ .ui-progressbar { height:2em; text-align: left; }
535
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
font_files_contents/.htaccess ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <IfModule mod_headers.c>
2
+ Header add Access-Control-Allow-Origin *
3
+ </IfModule>
4
+ <IfModule mod_mime.c>
5
+ # webfont mime types
6
+ AddType application/vnd.ms-fontobject eot
7
+ AddType font/truetype ttf
8
+ AddType font/opentype otf
9
+ AddType application/x-font-woff woff
10
+ </IfModule>
images/3d-XYSlider.png ADDED
Binary file
images/add.png ADDED
Binary file
images/arrow.png ADDED
Binary file
images/back.png ADDED
Binary file
images/blank.gif ADDED
Binary file
images/colorpicker_background.png ADDED
Binary file
images/colorpicker_hex.png ADDED
Binary file
images/colorpicker_hsb_b.png ADDED
Binary file
images/colorpicker_hsb_h.png ADDED
Binary file
images/colorpicker_hsb_s.png ADDED
Binary file
images/colorpicker_indic.gif ADDED
Binary file
images/colorpicker_overlay.png ADDED
Binary file
images/colorpicker_rgb_b.png ADDED
Binary file
images/colorpicker_rgb_g.png ADDED
Binary file
images/colorpicker_rgb_r.png ADDED
Binary file
images/colorpicker_select.gif ADDED
Binary file
images/colorpicker_submit.png ADDED
Binary file
images/custom_background.png ADDED
Binary file
images/custom_hex.png ADDED
Binary file
images/custom_hsb_b.png ADDED
Binary file
images/custom_hsb_h.png ADDED
Binary file
images/custom_hsb_s.png ADDED
Binary file
images/custom_indic.gif ADDED
Binary file
images/custom_rgb_b.png ADDED
Binary file
images/custom_rgb_g.png ADDED
Binary file
images/custom_rgb_r.png ADDED
Binary file
images/custom_submit.png ADDED
Binary file
images/delete.png ADDED
Binary file
images/edit.png ADDED
Binary file
images/effects.png ADDED
Binary file
images/font_settings.png ADDED
Binary file
images/font_ver.png ADDED
Binary file
images/forward.png ADDED
Binary file
images/logo_slide.png ADDED
Binary file
images/pick.png ADDED
Binary file
images/pick_add.png ADDED
Binary file
images/pro.png ADDED
Binary file
images/pro_settings.png ADDED
Binary file
images/save.png ADDED
Binary file
images/select.png ADDED
Binary file
images/select2.png ADDED
Binary file
images/slider.png ADDED
Binary file
images/snc_settings.png ADDED
Binary file
images/tinymce_icon.png ADDED
Binary file
js/colorpicker.js ADDED
@@ -0,0 +1,487 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ *
3
+ * Color picker
4
+ * Author: Stefan Petre www.eyecon.ro
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses
7
+ *
8
+ */
9
+ if(typeof fQuery === 'undefined') {
10
+ fQuery = jQuery;
11
+ }
12
+ (function ($) {
13
+ var ColorPicker = function () {
14
+ var
15
+ ids = {},
16
+ inAction,
17
+ charMin = 65,
18
+ visible,
19
+ tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
20
+ defaults = {
21
+ eventName: 'click',
22
+ onShow: function () {},
23
+ onBeforeShow: function(){},
24
+ onHide: function () {},
25
+ onChange: function () {},
26
+ onSubmit: function () {},
27
+ color: 'ff0000',
28
+ livePreview: true,
29
+ flat: false
30
+ },
31
+ fillRGBFields = function (hsb, cal) {
32
+ var rgb = HSBToRGB(hsb);
33
+ $(cal).data('colorpicker').fields
34
+ .eq(1).val(rgb.r).end()
35
+ .eq(2).val(rgb.g).end()
36
+ .eq(3).val(rgb.b).end();
37
+ },
38
+ fillHSBFields = function (hsb, cal) {
39
+ $(cal).data('colorpicker').fields
40
+ .eq(4).val(hsb.h).end()
41
+ .eq(5).val(hsb.s).end()
42
+ .eq(6).val(hsb.b).end();
43
+ },
44
+ fillHexFields = function (hsb, cal) {
45
+ $(cal).data('colorpicker').fields
46
+ .eq(0).val(HSBToHex(hsb)).end();
47
+ },
48
+ setSelector = function (hsb, cal) {
49
+ $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
50
+ $(cal).data('colorpicker').selectorIndic.css({
51
+ left: parseInt(150 * hsb.s/100, 10),
52
+ top: parseInt(150 * (100-hsb.b)/100, 10)
53
+ });
54
+ },
55
+ setHue = function (hsb, cal) {
56
+ $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
57
+ },
58
+ setCurrentColor = function (hsb, cal) {
59
+ $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
60
+ },
61
+ setNewColor = function (hsb, cal) {
62
+ $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
63
+ },
64
+ keyDown = function (ev) {
65
+ var pressedKey = ev.charCode || ev.keyCode || -1;
66
+ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
67
+ return false;
68
+ }
69
+ var cal = $(this).parent().parent();
70
+ if (cal.data('colorpicker').livePreview === true) {
71
+ change.apply(this);
72
+ }
73
+ },
74
+ change = function (ev) {
75
+ var cal = $(this).parent().parent(), col;
76
+ if (this.parentNode.className.indexOf('_hex') > 0) {
77
+ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
78
+ } else if (this.parentNode.className.indexOf('_hsb') > 0) {
79
+ cal.data('colorpicker').color = col = fixHSB({
80
+ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
81
+ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
82
+ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
83
+ });
84
+ } else {
85
+ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
86
+ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
87
+ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
88
+ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
89
+ }));
90
+ }
91
+ if (ev) {
92
+ fillRGBFields(col, cal.get(0));
93
+ fillHexFields(col, cal.get(0));
94
+ fillHSBFields(col, cal.get(0));
95
+ }
96
+ setSelector(col, cal.get(0));
97
+ setHue(col, cal.get(0));
98
+ setNewColor(col, cal.get(0));
99
+ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
100
+ },
101
+ blur = function (ev) {
102
+ var cal = $(this).parent().parent();
103
+ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
104
+ },
105
+ focus = function () {
106
+ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
107
+ $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
108
+ $(this).parent().addClass('colorpicker_focus');
109
+ },
110
+ downIncrement = function (ev) {
111
+ var field = $(this).parent().find('input').focus();
112
+ var current = {
113
+ el: $(this).parent().addClass('colorpicker_slider'),
114
+ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
115
+ y: ev.pageY,
116
+ field: field,
117
+ val: parseInt(field.val(), 10),
118
+ preview: $(this).parent().parent().data('colorpicker').livePreview
119
+ };
120
+ $(document).bind('mouseup', current, upIncrement);
121
+ $(document).bind('mousemove', current, moveIncrement);
122
+ },
123
+ moveIncrement = function (ev) {
124
+ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
125
+ if (ev.data.preview) {
126
+ change.apply(ev.data.field.get(0), [true]);
127
+ }
128
+ return false;
129
+ },
130
+ upIncrement = function (ev) {
131
+ change.apply(ev.data.field.get(0), [true]);
132
+ ev.data.el.removeClass('colorpicker_slider').find('input').focus();
133
+ $(document).unbind('mouseup', upIncrement);
134
+ $(document).unbind('mousemove', moveIncrement);
135
+ return false;
136
+ },
137
+ downHue = function (ev) {
138
+ var current = {
139
+ cal: $(this).parent(),
140
+ y: $(this).offset().top
141
+ };
142
+ current.preview = current.cal.data('colorpicker').livePreview;
143
+ $(document).bind('mouseup', current, upHue);
144
+ $(document).bind('mousemove', current, moveHue);
145
+ },
146
+ moveHue = function (ev) {
147
+ change.apply(
148
+ ev.data.cal.data('colorpicker')
149
+ .fields
150
+ .eq(4)
151
+ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
152
+ .get(0),
153
+ [ev.data.preview]
154
+ );
155
+ return false;
156
+ },
157
+ upHue = function (ev) {
158
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
159
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
160
+ $(document).unbind('mouseup', upHue);
161
+ $(document).unbind('mousemove', moveHue);
162
+ return false;
163
+ },
164
+ downSelector = function (ev) {
165
+ var current = {
166
+ cal: $(this).parent(),
167
+ pos: $(this).offset()
168
+ };
169
+ current.preview = current.cal.data('colorpicker').livePreview;
170
+ $(document).bind('mouseup', current, upSelector);
171
+ $(document).bind('mousemove', current, moveSelector);
172
+ },
173
+ moveSelector = function (ev) {
174
+ change.apply(
175
+ ev.data.cal.data('colorpicker')
176
+ .fields
177
+ .eq(6)
178
+ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
179
+ .end()
180
+ .eq(5)
181
+ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
182
+ .get(0),
183
+ [ev.data.preview]
184
+ );
185
+ return false;
186
+ },
187
+ upSelector = function (ev) {
188
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
189
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
190
+ $(document).unbind('mouseup', upSelector);
191
+ $(document).unbind('mousemove', moveSelector);
192
+ return false;
193
+ },
194
+ enterSubmit = function (ev) {
195
+ $(this).addClass('colorpicker_focus');
196
+ },
197
+ leaveSubmit = function (ev) {
198
+ $(this).removeClass('colorpicker_focus');
199
+ },
200
+ clickSubmit = function (ev) {
201
+ var cal = $(this).parent();
202
+ var col = cal.data('colorpicker').color;
203
+ cal.data('colorpicker').origColor = col;
204
+ setCurrentColor(col, cal.get(0));
205
+ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
206
+ },
207
+ show = function (ev) {
208
+ var cal = $('#' + $(this).data('colorpickerId'));
209
+ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
210
+ var pos = $(this).offset();
211
+ var viewPort = getViewport();
212
+ var top = pos.top + this.offsetHeight;
213
+ var left = pos.left;
214
+ if (top + 176 > viewPort.t + viewPort.h) {
215
+ top -= this.offsetHeight + 176;
216
+ }
217
+ if (left + 356 > viewPort.l + viewPort.w) {
218
+ left -= 356;
219
+ }
220
+ cal.css({left: left + 'px', top: top + 'px'});
221
+ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
222
+ cal.show();
223
+ }
224
+ $(document).bind('mousedown', {cal: cal}, hide);
225
+ return false;
226
+ },
227
+ hide = function (ev) {
228
+ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
229
+ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
230
+ ev.data.cal.hide();
231
+ }
232
+ $(document).unbind('mousedown', hide);
233
+ }
234
+ },
235
+ isChildOf = function(parentEl, el, container) {
236
+ if (parentEl == el) {
237
+ return true;
238
+ }
239
+ if (parentEl.contains) {
240
+ return parentEl.contains(el);
241
+ }
242
+ if ( parentEl.compareDocumentPosition ) {
243
+ return !!(parentEl.compareDocumentPosition(el) & 16);
244
+ }
245
+ var prEl = el.parentNode;
246
+ while(prEl && prEl != container) {
247
+ if (prEl == parentEl)
248
+ return true;
249
+ prEl = prEl.parentNode;
250
+ }
251
+ return false;
252
+ },
253
+ getViewport = function () {
254
+ var m = document.compatMode == 'CSS1Compat';
255
+ return {
256
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
257
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
258
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
259
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
260
+ };
261
+ },
262
+ fixHSB = function (hsb) {
263
+ return {
264
+ h: Math.min(360, Math.max(0, hsb.h)),
265
+ s: Math.min(100, Math.max(0, hsb.s)),
266
+ b: Math.min(100, Math.max(0, hsb.b))
267
+ };
268
+ },
269
+ fixRGB = function (rgb) {
270
+ return {
271
+ r: Math.min(255, Math.max(0, rgb.r)),
272
+ g: Math.min(255, Math.max(0, rgb.g)),
273
+ b: Math.min(255, Math.max(0, rgb.b))
274
+ };
275
+ },
276
+ fixHex = function (hex) {
277
+ var len = 6 - hex.length;
278
+ if (len > 0) {
279
+ var o = [];
280
+ for (var i=0; i<len; i++) {
281
+ o.push('0');
282
+ }
283
+ o.push(hex);
284
+ hex = o.join('');
285
+ }
286
+ return hex;
287
+ },
288
+ HexToRGB = function (hex) {
289
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
290
+ return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
291
+ },
292
+ HexToHSB = function (hex) {
293
+ return RGBToHSB(HexToRGB(hex));
294
+ },
295
+ RGBToHSB = function (rgb) {
296
+ var hsb = {
297
+ h: 0,
298
+ s: 0,
299
+ b: 0
300
+ };
301
+ var min = Math.min(rgb.r, rgb.g, rgb.b);
302
+ var max = Math.max(rgb.r, rgb.g, rgb.b);
303
+ var delta = max - min;
304
+ hsb.b = max;
305
+ if (max != 0) {
306
+
307
+ }
308
+ hsb.s = max != 0 ? 255 * delta / max : 0;
309
+ if (hsb.s != 0) {
310
+ if (rgb.r == max) {
311
+ hsb.h = (rgb.g - rgb.b) / delta;
312
+ } else if (rgb.g == max) {
313
+ hsb.h = 2 + (rgb.b - rgb.r) / delta;
314
+ } else {
315
+ hsb.h = 4 + (rgb.r - rgb.g) / delta;
316
+ }
317
+ } else {
318
+ hsb.h = -1;
319
+ }
320
+ hsb.h *= 60;
321
+ if (hsb.h < 0) {
322
+ hsb.h += 360;
323
+ }
324
+ hsb.s *= 100/255;
325
+ hsb.b *= 100/255;
326
+ return hsb;
327
+ },
328
+ HSBToRGB = function (hsb) {
329
+ var rgb = {};
330
+ var h = Math.round(hsb.h);
331
+ var s = Math.round(hsb.s*255/100);
332
+ var v = Math.round(hsb.b*255/100);
333
+ if(s == 0) {
334
+ rgb.r = rgb.g = rgb.b = v;
335
+ } else {
336
+ var t1 = v;
337
+ var t2 = (255-s)*v/255;
338
+ var t3 = (t1-t2)*(h%60)/60;
339
+ if(h==360) h = 0;
340
+ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
341
+ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
342
+ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
343
+ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
344
+ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
345
+ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
346
+ else {rgb.r=0; rgb.g=0; rgb.b=0}
347
+ }
348
+ return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
349
+ },
350
+ RGBToHex = function (rgb) {
351
+ var hex = [
352
+ rgb.r.toString(16),
353
+ rgb.g.toString(16),
354
+ rgb.b.toString(16)
355
+ ];
356
+ $.each(hex, function (nr, val) {
357
+ if (val.length == 1) {
358
+ hex[nr] = '0' + val;
359
+ }
360
+ });
361
+ return hex.join('');
362
+ },
363
+ HSBToHex = function (hsb) {
364
+ return RGBToHex(HSBToRGB(hsb));
365
+ },
366
+ restoreOriginal = function () {
367
+ var cal = $(this).parent();
368
+ var col = cal.data('colorpicker').origColor;
369
+ cal.data('colorpicker').color = col;
370
+ fillRGBFields(col, cal.get(0));
371
+ fillHexFields(col, cal.get(0));
372
+ fillHSBFields(col, cal.get(0));
373
+ setSelector(col, cal.get(0));
374
+ setHue(col, cal.get(0));
375
+ setNewColor(col, cal.get(0));
376
+ };
377
+ return {
378
+ init: function (opt) {
379
+ opt = $.extend({}, defaults, opt||{});
380
+ if (typeof opt.color == 'string') {
381
+ opt.color = HexToHSB(opt.color);
382
+ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
383
+ opt.color = RGBToHSB(opt.color);
384
+ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
385
+ opt.color = fixHSB(opt.color);
386
+ } else {
387
+ return this;
388
+ }
389
+ return this.each(function () {
390
+ if (!$(this).data('colorpickerId')) {
391
+ var options = $.extend({}, opt);
392
+ options.origColor = opt.color;
393
+ var id = 'collorpicker_' + parseInt(Math.random() * 1000);
394
+ $(this).data('colorpickerId', id);
395
+ var cal = $(tpl).attr('id', id);
396
+ if (options.flat) {
397
+ cal.appendTo(this).show();
398
+ } else {
399
+ cal.appendTo(document.body);
400
+ }
401
+ options.fields = cal
402
+ .find('input')
403
+ .bind('keyup', keyDown)
404
+ .bind('change', change)
405
+ .bind('blur', blur)
406
+ .bind('focus', focus);
407
+ cal
408
+ .find('span').bind('mousedown', downIncrement).end()
409
+ .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
410
+ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
411
+ options.selectorIndic = options.selector.find('div div');
412
+ options.el = this;
413
+ options.hue = cal.find('div.colorpicker_hue div');
414
+ cal.find('div.colorpicker_hue').bind('mousedown', downHue);
415
+ options.newColor = cal.find('div.colorpicker_new_color');
416
+ options.currentColor = cal.find('div.colorpicker_current_color');
417
+ cal.data('colorpicker', options);
418
+ cal.find('div.colorpicker_submit')
419
+ .bind('mouseenter', enterSubmit)
420
+ .bind('mouseleave', leaveSubmit)
421
+ .bind('click', clickSubmit);
422
+ fillRGBFields(options.color, cal.get(0));
423
+ fillHSBFields(options.color, cal.get(0));
424
+ fillHexFields(options.color, cal.get(0));
425
+ setHue(options.color, cal.get(0));
426
+ setSelector(options.color, cal.get(0));
427
+ setCurrentColor(options.color, cal.get(0));
428
+ setNewColor(options.color, cal.get(0));
429
+ if (options.flat) {
430
+ cal.css({
431
+ position: 'relative',
432
+ display: 'block'
433
+ });
434
+ } else {
435
+ $(this).bind(options.eventName, show);
436
+ }
437
+ }
438
+ });
439
+ },
440
+ showPicker: function() {
441
+ return this.each( function () {
442
+ if ($(this).data('colorpickerId')) {
443
+ show.apply(this);
444
+ }
445
+ });
446
+ },
447
+ hidePicker: function() {
448
+ return this.each( function () {
449
+ if ($(this).data('colorpickerId')) {
450
+ $('#' + $(this).data('colorpickerId')).hide();
451
+ }
452
+ });
453
+ },
454
+ setColor: function(col) {
455
+ if (typeof col == 'string') {
456
+ col = HexToHSB(col);
457
+ } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
458
+ col = RGBToHSB(col);
459
+ } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
460
+ col = fixHSB(col);
461
+ } else {
462
+ return this;
463
+ }
464
+ return this.each(function(){
465
+ if ($(this).data('colorpickerId')) {
466
+ var cal = $('#' + $(this).data('colorpickerId'));
467
+ cal.data('colorpicker').color = col;
468
+ cal.data('colorpicker').origColor = col;
469
+ fillRGBFields(col, cal.get(0));
470
+ fillHSBFields(col, cal.get(0));
471
+ fillHexFields(col, cal.get(0));
472
+ setHue(col, cal.get(0));
473
+ setSelector(col, cal.get(0));
474
+ setCurrentColor(col, cal.get(0));
475
+ setNewColor(col, cal.get(0));
476
+ }
477
+ });
478
+ }
479
+ };
480
+ }();
481
+ $.fn.extend({
482
+ ColorPicker: ColorPicker.init,
483
+ ColorPickerHide: ColorPicker.hidePicker,
484
+ ColorPickerShow: ColorPicker.showPicker,
485
+ ColorPickerSetColor: ColorPicker.setColor
486
+ });
487
+ })(fQuery)
js/editor_plugin.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.FFWButtonPlugin', {
3
+ init : function(ed, url) {
4
+ ed.addCommand('mceFFWButton', function() {
5
+ jQuery('#FFW_chooseFontButton').trigger('click');
6
+ });
7
+ // Register example button
8
+ ed.addButton('FFWButton', {
9
+ title : 'FFWButton.desc',
10
+ cmd : 'mceFFWButton',
11
+ image : url + '/../images/tinymce_icon.png'
12
+ });
13
+ },
14
+ createControl : function(n, cm) {
15
+ return null;
16
+ },
17
+ getInfo : function() {
18
+ return {
19
+ longname : 'FFWButton plugin',
20
+ author : 'Paweł Misiurski',
21
+ authorurl : 'http://killerdeveloper.com',
22
+ infourl : 'http://killerdeveloper.com',
23
+ version : "1.0"
24
+ };
25
+ }
26
+ });
27
+ // Register plugin
28
+ tinymce.PluginManager.add('ffwbutton', tinymce.plugins.FFWButtonPlugin);
29
+ })();
js/jquery-1.10.2.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery-1.10.2.min.map
3
+ */
4
+ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
5
+ }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
6
+ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
js/jquery-ui-1.9.2.custom.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! fQuery UI - v1.9.2 - 2013-07-29
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js
4
+ * Copyright 2013 fQuery Foundation and other contributors Licensed MIT */
5
+
6
+ (function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(fQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(fQuery);(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(fQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(fQuery)})(fQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(fQuery);(function(e,t){e.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(fQuery);(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(fQuery);(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(fQuery);(function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsfQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsfQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsfQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(fQuery);(function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(fQuery,fQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(fQuery,fQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(fQuery,fQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(fQuery,fQuery.ui.accordion.prototype),fQuery.ui.accordion.prototype.resize=fQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(fQuery,fQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(fQuery,fQuery.ui.accordion.prototype))})(fQuery);(function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgiframe&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this.document.find(t||"body")[0]),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})})(fQuery);(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(fQuery);(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){$(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$('<span class="'+this._appendClass+'">'+n+"</span>"),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var r=this._getInst(e);if(arguments.length==2&&typeof t=="string")return t=="defaults"?$.extend({},$.datepicker._defaults):r?t=="all"?$.extend({},r.settings):this._get(r,t):null;var i=t||{};typeof t=="string"&&(i={},i[t]=n);if(r){this._curInst==r&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),o=this._getMinMaxDate(r,"min"),u=this._getMinMaxDate(r,"max");extendRemove(r.settings,i),o!==null&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,o)),u!==null&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,u)),this._attachments($(e),r),this._autoSize(r),this._setDate(r,s),this._updateAlternate(r),this._updateDatepicker(r)}},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),n=!0,r=t.dpDiv.is(".ui-datepicker-rtl");t._keyEvent=!0;if($.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),n=!1;break;case 13:var i=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);i[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,i[0]);var s=$.datepicker._get(t,"onSelect");if(s){var o=$.datepicker._formatDate(t);s.apply(t.input?t.input[0]:null,[o,t])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),n=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),n=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?1:-1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),n=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?-1:1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),n=e.ctrlKey||e.metaKey;break;default:n=!1}else e.keyCode==36&&e.ctrlKey?$.datepicker._showDatepicker(this):n=!1;n&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i});var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;var t=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var n=e.dpDiv.find("iframe.ui-datepicker-cover");!n.length||n.css({left:-t[0],top:-t[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),i=r[1],s=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),e.dpDiv[(r[0]!=1||r[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var o=e.yearshtml;setTimeout(function(){o===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),o=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&($.effects.effect[n]||$.effects[n])?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length){var w=t.substr(g);if(!/^\s+/.test(w))throw"Extra/unparsed characters found in date: "+w}a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var E=this._getDaysInMonth(a,f-1);if(l<=E)break;f++,l-=E}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":l+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_fQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_fQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_fQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_fQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_fQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_fQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_fQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&v<c?c:v;while(this._daylightSavingAdjust(new Date(d,p,1))>v)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>":i?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>":i?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=e.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(e,"closeText")+"</button>",x=r?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(n?S:"")+(this._isInRange(e,E)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+w+"</button>":"")+(n?"":S)+"</div>":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j<o[0];j++){var F="";this.maxRows=4;for(var I=0;I<o[1];I++){var q=this._daylightSavingAdjust(new Date(d,p,e.selectedDay)),R=" ui-corner-all",U="";if(f){U+='<div class="ui-datepicker-group';if(o[1]>1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var z=N?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="<th"+((W+T+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+C[X]+'">'+L[X]+"</span></th>"}U+=z+"</tr></thead><tbody>";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y<Q;Y++){U+="<tr>";var Z=N?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(G)+"</td>":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&G<c||h&&G>h;Z+='<td class="'+((W+T+6)%7>=5?" ui-datepicker-week-end":"")+(tt?" ui-datepicker-other-month":"")+(G.getTime()==q.getTime()&&p==e.selectedMonth&&e._keyEvent||H.getTime()==G.getTime()&&H.getTime()==q.getTime()?" "+this._dayOverClass:"")+(nt?" "+this._unselectableClass+" ui-state-disabled":"")+(tt&&!_?"":" "+et[1]+(G.getTime()==l.getTime()?" "+this._currentClass:"")+(G.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+((!tt||_)&&et[2]?' title="'+et[2]+'"':"")+(nt?"":' data-handler="selectDay" data-event="click" data-month="'+G.getMonth()+'" data-year="'+G.getFullYear()+'"')+">"+(tt&&!_?"&#xa0;":nt?'<span class="ui-state-default">'+G.getDate()+"</span>":'<a class="ui-state-default'+(G.getTime()==t.getTime()?" ui-state-highlight":"")+(G.getTime()==l.getTime()?" ui-state-active":"")+(tt?" ui-priority-secondary":"")+'" href="#">'+G.getDate()+"</a>")+"</td>",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+"</tr>"}p++,p>11&&(p=0,d++),U+="</tbody></table>"+(f?"</div>"+(o[0]>0&&I==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',h="";if(s||!a)h+='<span class="ui-datepicker-month">'+o[t]+"</span>";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var v=0;v<12;v++)(!p||v>=r.getMonth())&&(!d||v<=i.getMonth())&&(h+='<option value="'+v+'"'+(v==t?' selected="selected"':"")+">"+u[v]+"</option>");h+="</select>"}l||(c+=h+(s||!a||!f?"&#xa0;":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+='<span class="ui-datepicker-year">'+n+"</span>";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;b<=w;b++)e.yearshtml+='<option value="'+b+'"'+(b==n?' selected="selected"':"")+">"+b+"</option>";e.yearshtml+="</select>",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?"&#xa0;":"")+h),c+="</div>",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return i=r&&i>r?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_fQuery_"+dpuuid]=$})(fQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||"&#160;",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("<button></button>",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||"&#160;"))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(fQuery);(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(fQuery);(function(e,t){e.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(fQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(fQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(fQuery);(function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("fQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(fQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(fQuery);fQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function d(e){var n=o(),r=n._rgba=[];return e=e.toLowerCase(),h(s,function(t,i){var s,o=i.re.exec(e),a=o&&i.parse(o),f=i.space||"rgba";if(a)return s=n[f](a),n[u[f].cache]=s[u[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&t.extend(r,c.transparent),n):c[e]}function v(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],o=t.Color=function(e,n,r,i){return new t.Color.fn.parse(e,n,r,i)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},a={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},f=o.support={},l=t("<p>")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(fQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)fQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=fQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,n){var i,s;for(s=0;s<n.length;s++)n[s]!==null&&(i=e.data(r+n[s]),i===t&&(i=""),e.css(n[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(fQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(fQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(fQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(fQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(fQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(fQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(fQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(fQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(fQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(fQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(fQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(fQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(fQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(fQuery);
js/jquery.fcarousel.min.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof fQuery === 'undefined') {
2
+
3
+
4
+ fQuery = jQuery;
5
+
6
+
7
+ }
8
+
9
+
10
+ /*!
11
+
12
+
13
+ * fcarousel - Riding carousels with jQuery
14
+
15
+
16
+ * http://sorgalla.com/fcarousel/
17
+
18
+
19
+ *
20
+
21
+
22
+ * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
23
+
24
+
25
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
26
+
27
+
28
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
29
+
30
+
31
+ *
32
+
33
+
34
+ * Built on top of the jQuery library
35
+
36
+
37
+ * http://jquery.com
38
+
39
+
40
+ *
41
+
42
+
43
+ * Inspired by the "Carousel Component" by Bill Scott
44
+
45
+
46
+ * http://billwscott.com/carousel/
47
+
48
+
49
+ */
50
+
51
+
52
+ (function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null, itemFallbackDimension:null},r=false;i(window).bind("load.fcarousel",function(){r=true});i.fcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl? "right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("fcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("fcarousel-clip")){if(!this.container.parent().hasClass("fcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("fcarousel-container"))this.container= this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("fcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("fcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".fcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext= this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("fcarousel-next"));this.buttonPrev=i(".fcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("fcarousel-prev"));this.clip.addClass(this.className("fcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("fcarousel-list")).css({overflow:"hidden", position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("fcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("fcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this, j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser&&i.browser.safari){this.buttons(false,false);i(window).bind("load.fcarousel",function(){e.setup()})}else this.setup()}; var h=i.fcarousel;h.fn=h.prototype={fcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.fcarousel",this.funcResize).bind("resize.fcarousel",this.funcResize)}}, reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0; this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b= a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("fcarousel-item-placeholder"))return false}return true},get:function(a){return i(".fcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("fcarousel-item-placeholder")), a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))- b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked|| this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d= this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("fcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+= m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("fcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g= this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(m===0)throw Error("fcarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&& this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail= true}for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation"); if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto(); if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap== "first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".fcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+ ".fcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("fcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("fcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("fcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+ ".fcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".fcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("fcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("fcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("fcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b, null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback", a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k, this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("fcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("fcarousel-item")).addClass(this.className("fcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("fcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical? "-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh, d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0; var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.fcarousel=function(a){if(typeof a=="string"){var c=i(this).data("fcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("fcarousel", new h(this,a))})}})(fQuery);
js/jquery.fontPlugin.js ADDED
@@ -0,0 +1,2854 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (typeof fQuery === 'undefined') {
2
+ fQuery = jQuery;
3
+ }
4
+ //font control panel plugin
5
+ (function ($) {
6
+ 'use strict';
7
+ /*global document */
8
+ /*global setTimeout */
9
+ /*global setInterval */
10
+ /*global clearTimeout */
11
+ /*global window */
12
+ /*global alert */
13
+ /*global prompt */
14
+ /*global confirm */
15
+ /*global navigator */
16
+ /*global jQuery */
17
+ /*global console */
18
+ /*global $ */
19
+ /*global ajaxproxy */
20
+ /*global location */
21
+ /*global tinyMCE */
22
+ /*global fontBlogUrl */
23
+ /*global fontBlogName */
24
+ /*global clearInterval */
25
+ $.fontPlugin = function (el, options) {
26
+ var self = this;
27
+ self.$el = $(el);
28
+ self.el = el;
29
+ self.baseSelector = '#' + self.$el.attr('id');
30
+ self.$el.data('fontPlugin', self);
31
+ //modal windows array
32
+ self.modals = [];
33
+ self.options = options;
34
+ self.options = $.extend({}, $.fontPlugin.defaultOptions, self.options);
35
+ self.version = fontPluginVersion;
36
+ self.settingFields = [];
37
+ self.effectSliders = [];
38
+ /*
39
+ Initialize
40
+ */
41
+ self.init = function () {
42
+ self.detectMode();
43
+ self.showLoading();
44
+ self.loadSettings();
45
+ if (!$.fn.on) {
46
+ alert('WARNING: You are using an old Wordpress version. It is not guaranteed that the plugin will work. The oldest tested Wordpress version is 3.1 but at least 3.3.1 is recommended.');
47
+ }
48
+ // detect CSS text-shadow support in JavaScript
49
+ if (document.createElement("detect").style.textShadow !== "") {
50
+ alert('Warning: your browser does not support advanced effects and all functions of the plugin. Please upgrade to Chrome, Firefox or Internet Explorer 10');
51
+ return;
52
+ }
53
+ };
54
+ /*
55
+ *
56
+ * MARKUP
57
+ *
58
+ */
59
+ /*
60
+ * Create presets panel
61
+ */
62
+ self.createPresetsPanel = function () {
63
+ var i,
64
+ presetName,
65
+ presetId,
66
+ field,
67
+ paramObj,
68
+ upgrade;
69
+ /*
70
+ PRESETS
71
+ */
72
+ var modalOptions = {
73
+ id: 'presetsPanel',
74
+ name: 'stdSettings',
75
+ title: self.options.compatibilityMode ? 'SAFE MODE!' : 'Font ' + self.version,
76
+ nobar: false,
77
+ left: '10px',
78
+ top: '50px',
79
+ width: '98px',
80
+ show: true
81
+ };
82
+ var modal = self.createNewModal(modalOptions);
83
+ modal.hide().fadeIn(500);
84
+ self.$presets = modal;
85
+ //add presets list
86
+ self.settingFields.presets = $('<fieldset id="presetsDropdownFieldset"><label>Selections<select id="presetsDropdown" name="presetsDropdown"></select></label></fieldset>');
87
+ self.$presetsDropdown = self.settingFields.presets.find('select');
88
+ self.$presets.append(self.settingFields.presets);
89
+ self.$presetsDropdown.bind('change', function () {
90
+ self.loadPreset($(this).val());
91
+ self.scrollToSelection();
92
+ });
93
+ //populate presets list
94
+ for (i = 0; i < self.options.presets.length; i += 1) {
95
+ presetName = self.options.presets[i].name;
96
+ presetId = i;
97
+ self.$presetsDropdown.append('<option value="' + presetId + '">' + presetName + '</option>');
98
+ }
99
+ // Delete current preset
100
+ self.settingFields.deletePreset = $('<button id="deletePreset" title="Delete">x</button>');
101
+ self.settingFields.presets.append(self.settingFields.deletePreset);
102
+ self.settingFields.deletePreset.on('click', function () {
103
+ self.deleteCurrentPreset();
104
+ });
105
+ // Rename current preset
106
+ self.settingFields.renamePreset = $('<button id="renamePreset">Rename</button>');
107
+ self.settingFields.presets.append(self.settingFields.renamePreset);
108
+ self.settingFields.renamePreset.on('click', function () {
109
+ self.renamePreset();
110
+ });
111
+ };
112
+ /**
113
+ Like? Yes or No
114
+ **/
115
+ self.addLikeYesNo = function () {
116
+ //add like not/like
117
+ self.$yesno = $('<div class="yesno">Like the plugin?<br><a href="http://fontsforweb.com/purchase/howtosupport?url=' + fontBlogUrl + '&name=' + fontBlogName + '" class="overlay_url yesbutton" data-upgrade="true">Yes!</a> or <a href="http://www.fontsforweb.com/contact/support" class="overlay_url nobutton">No</a></div>');
118
+ self.$yesno.insertBefore('#fontfaceSettings');
119
+ self.$yesno.css({
120
+ 'color': '#fff',
121
+ 'font-size': '10px',
122
+ 'text-align': 'right',
123
+ 'font-weight': 'bold',
124
+ 'float': 'left',
125
+ 'margin-right': '10px'
126
+ });
127
+ self.$yesno.find('a').css({
128
+ 'font-size': '10px',
129
+ 'color': '#fff'
130
+ });
131
+ };
132
+ /*
133
+ * Create appearance panel - size and color
134
+ *
135
+ * @returns {unresolved}
136
+ */
137
+ self.createAppearancePanel = function () {
138
+ var i,
139
+ presetName,
140
+ presetId,
141
+ field,
142
+ paramObj,
143
+ saveButton,
144
+ upgrade;
145
+ /*
146
+ SELECTORS
147
+ */
148
+ //get standard fields in a new window
149
+ var modalOptions = {
150
+ id: 'appearancePanel',
151
+ name: 'stdSettings',
152
+ title: 'Size and color settings',
153
+ left: '0',
154
+ top: '0px',
155
+ width: '100%',
156
+ nobar: true,
157
+ show: true
158
+ };
159
+ var modal = self.createNewModal(modalOptions);
160
+ self.$apr = modal;
161
+ self.$apr.hide();
162
+ //create a fieldset
163
+ self.$standardFields = $('<div id="appearanceStandardFields"></div>').appendTo(modal);
164
+ //get standard fields in a new window
165
+ var modalOptions = {
166
+ title: 'Extended settings',
167
+ left: '0',
168
+ top: '0'
169
+ };
170
+ modal = self.createNewModal(modalOptions);
171
+ self.$extendedFields = $('<div id="appearanceExtendedFields"></div>').appendTo(modal);
172
+ //get extended fields not ready
173
+ /*var switcher = $('<a href="#" id="showExtendedFields">Load extended fields from FontsForWeb.com</a>').appendTo(self.$apr);
174
+ self.$extendedFields.hide();
175
+ switcher.on('click', function () { self.$extendedFields.slideToggle(); self.loadExtendedFields(); return false; });*/
176
+ /*
177
+ Add all setting fields
178
+ */
179
+ for (i = 0; i < self.options.settingFields.length; i += 1) {
180
+ field = self.options.settingFields[i];
181
+ paramObj = {};
182
+ paramObj.field = field;
183
+ paramObj.type = 'lite';
184
+ self.addSettingsField(paramObj);
185
+ }
186
+ //add window opening buttons
187
+ var settingWindows = $('<fieldset id="settingsButtons"></fieldset>');
188
+ //bind toggle modal
189
+ $('body').on('click', '.toggleModal', function () {
190
+ if (self.mode === 'global') {
191
+ var selector = self.currentPreset.selector;
192
+ if (selector.indexOf('ELEMENT NOW') != -1 || selector.indexOf('PICK ELEMENT') != -1) {
193
+ alert('First pick an element from the page to customize it.');
194
+ return;
195
+ }
196
+ } else if (self.mode === 'postPage') {
197
+ //VERSION FOR POST PAGE
198
+ //get selection
199
+ var selection = tinyMCE.activeEditor.selection.getContent();
200
+ //only apply if something is selected
201
+ if (!selection) {
202
+ alert('Make a selection in the editor window first.');
203
+ return;
204
+ }
205
+ }
206
+ var modalName = $(this).attr('data-modal-name');
207
+ self.toggleModal(modalName);
208
+ });
209
+ $('body').on('mousedown click', '.getApiKey', function () {
210
+ $(this).attr('href', 'http://fontsforweb.com/purchase?url=' + fontBlogUrl);
211
+ $(this).attr('target', '_blank');
212
+ });
213
+ //add keyup to change field
214
+ self.getField('selector').bind('keyup', function () {
215
+ $(this).trigger('change');
216
+ self.hoverSelector = self.currentPreset.selector;
217
+ self.hoverHighlightCurrent();
218
+ });
219
+ };
220
+ self.createActionButtons = function () {
221
+ var saveButton;
222
+ //add buttons fieldset
223
+ var actions = $('<fieldset id="actionsFieldset"></fieldset>');
224
+ var closeMod = $('<a class="closeModal" href="#">x</a>');
225
+ actions.append(closeMod);
226
+ closeMod.click(function () {
227
+ self.$presets.hide();
228
+ self.$apr.hide();
229
+ });
230
+ //add different fields buttons
231
+ var fontfaceSettings = $('<button id="fontfaceSettings">Font</button>').appendTo(actions);
232
+ //add actions
233
+ fontfaceSettings.on('click', function () {
234
+ if (self.mode === 'global') {
235
+ var selector = self.currentPreset.selector;
236
+ if (selector.indexOf('ELEMENT NOW') !== -1 || selector.indexOf('PICK ELEMENT') !== -1) {
237
+ alert('First pick an element from the page to customize it.');
238
+ return;
239
+ }
240
+ } else if (self.mode === 'postPage') {
241
+ //VERSION FOR POST PAGE
242
+ //get selection
243
+ var selection = tinyMCE.activeEditor.selection.getContent();
244
+ //only apply if something is selected
245
+ if (!selection) {
246
+ alert('Make a selection in the editor window first.');
247
+ return;
248
+ }
249
+ }
250
+ self.showFontsBrowser();
251
+ });
252
+ // color and size window
253
+ //var colorsizeSettings = $('<button id="colorsizeSettings" class="toggleModal" data-modal-name="stdSettings">Color and Size</button>').appendTo(actions);
254
+ // PRO settings window
255
+ var proSettings = $('<a href="http://fontsforweb.com/purchase/pluginupgrade?url=' + fontBlogUrl + '&name=' + fontBlogName + '" class="overlay_url" id="upgradeToProButton" data-upgrade="true">More</a>').appendTo(actions);
256
+ // extra fields
257
+ var extrafieldsSettings = $('<button id="extrafieldsSettings" class="toggleModal" data-modal-name="extrafields">PRO</button>').appendTo(actions);
258
+ // hide extra fields
259
+ extrafieldsSettings.hide();
260
+ // effects button
261
+ var effects = $('<button id="effectsButton" class="toggleModal" data-modal-name="effects">Effects</button>').appendTo(actions);
262
+ //add save button
263
+ saveButton = $('<button id="fontSaveSettings">Save settings</button>').appendTo(actions);
264
+ saveButton.click(function (e) {
265
+ // blink few fimes
266
+ saveButton.fadeTo(500, 0.3).fadeTo(500, 1).fadeTo(500, 0.3).fadeTo(500, 1).fadeTo(500, 0.3).fadeTo(500, 1).fadeTo(500, 0.3).fadeTo(500, 1).fadeTo(500, 0.3).fadeTo(500, 1);
267
+ //unbind click
268
+ saveButton.unbind('click');
269
+ saveButton.css({
270
+ 'cursor': 'wait'
271
+ });
272
+ self.saveSettings();
273
+ });
274
+ //actions.insertAfter($('#presetsDropdownFieldset'));
275
+ self.$apr.append(actions)
276
+ };
277
+ /*
278
+ * SETTINGS - SAVE AND LOAD
279
+ */
280
+ /*
281
+ * Load settings from wordpress options
282
+ */
283
+ self.loadSettings = function () {
284
+ var data = {
285
+ action: 'get_font_settings'
286
+ };
287
+ $.ajax({
288
+ type: "POST",
289
+ url: ajaxproxy,
290
+ data: data,
291
+ success: function (response) {
292
+ // json is coming parsed so no $.parseJSON(response);
293
+ try {
294
+ response = $.parseJSON(response);
295
+ } catch (e) {
296
+ self.tryAnotherAjaxproxy();
297
+ return;
298
+ }
299
+
300
+ //console.log(self.options);
301
+ if (response && response.settingFields) {
302
+ self.options = $.extend({}, response, self.options);
303
+ } else {
304
+ self.tryAnotherAjaxproxy();
305
+ return;
306
+ }
307
+
308
+ try {
309
+ //console.log(self.options);
310
+ self.hideLoading();
311
+ // markup
312
+ self.createPresetsPanel();
313
+ self.createAppearancePanel();
314
+ self.createActionButtons();
315
+ self.loadPreset(0);
316
+ self.bindShowCategoriesAction();
317
+ self.bindShowFontsAction();
318
+ self.bindLinkOverlay();
319
+ self.setFontOnclick();
320
+ self.initUploadForm();
321
+ self.adaptOptionsToMode();
322
+ self.addLikeYesNo();
323
+ //check if api key is available
324
+ //if(self.options.apikey)
325
+ self.checkForApikey();
326
+ } catch (e) {
327
+ fQuery('#FFW_chooseFontButton, #content_FFWButton, #wp-admin-bar-font_settings > a').unbind();
328
+ fQuery('#fontplugin').data('fontPlugin', false);
329
+ engageCompatibilityMode (function () {
330
+ fQuery('#wp-admin-bar-font_settings > a').trigger('click');
331
+ });
332
+ }
333
+ },
334
+ error: function (response) {
335
+ self.tryAnotherAjaxproxy();
336
+ }
337
+ });
338
+ };
339
+ self.tryAnotherAjaxproxy = function () {
340
+ if(ajaxproxy === ajaxproxy3) {
341
+ alert('Sorry, but the plugin couldn\'t start. Please contact your server administrator to allow AJAX use. Power users: Use console (F12 in Chrome) to see what else could be the problem.');
342
+ return;
343
+ }
344
+ else if(ajaxproxy === ajaxproxy2) {
345
+ ajaxproxy = ajaxproxy3;
346
+ } else {
347
+ ajaxproxy = ajaxproxy2;
348
+ }
349
+ self.loadSettings();
350
+ };
351
+ /*
352
+ * Save settings by ajax
353
+ *
354
+ * @returns {unresolved}
355
+ */
356
+ self.saveSettings = function () {
357
+ var savingOptions = {},
358
+ data;
359
+ if (self.mode === 'postPage') {
360
+ alert('Click on "Update" or "Publish" to save');
361
+ return;
362
+ }
363
+ self.$presets.fadeOut();
364
+ self.$apr.fadeOut();
365
+ self.showLoading();
366
+ savingOptions.settingFields = self.options.settingFields;
367
+ savingOptions.presets = self.options.presets;
368
+ savingOptions.apikey = self.options.apikey;
369
+ data = {
370
+ action: 'set_font_settings',
371
+ fontPluginSettings: JSON.stringify(savingOptions)
372
+ };
373
+ $.post(ajaxproxy, data, function (response) {
374
+ if (response.success !== 'true') {
375
+ alert('Error: ' + response.message);
376
+ return;
377
+ } else {
378
+ window.onbeforeunload = null;
379
+ location.reload(true);
380
+ }
381
+ }, 'json').error(function (xhr, textStatus, errorThrown) {
382
+ alert("Unknown error: \n" + xhr.responseText);
383
+ });
384
+ };
385
+ //update internal settings - value
386
+ self.updateSettings = function (settingName, value) {
387
+ if (self.mode !== 'global') {
388
+ return;
389
+ }
390
+ self.options.presets[self.currentPresetNo][settingName] = value;
391
+ };
392
+ //update internal settings - css value
393
+ self.updateCssSettings = function (settingName, value) {
394
+ if (self.mode !== 'global') {
395
+ return;
396
+ }
397
+ self.options.presets[self.currentPresetNo].styles[settingName] = value;
398
+ };
399
+ /*
400
+ *
401
+ * @param {type} group - which group is it
402
+ * @param {type} fieldId - what's the name of id
403
+ * @param {type} settingName - setting name
404
+ * @param {type} value - setting value
405
+ */
406
+ //self.updateMultivalParameter = function (group, fieldId, settingName, value) {
407
+ // self.options[group][fieldId]
408
+ //};
409
+ /*
410
+ update selected element CSS
411
+ global - update element from selector
412
+ postPage - update selected text
413
+ */
414
+ self.updateSelectedElement = function (settingName, value) {
415
+ var selection,
416
+ selector,
417
+ selectorValid,
418
+ $selectorContents,
419
+ element,
420
+ node,
421
+ justInsertedClass,
422
+ newSpan,
423
+ newHTML,
424
+ inserted,
425
+ $tempDiv;
426
+ if (!value || value == 'px') return;
427
+ if (self.mode === 'global') {
428
+ //VERSION FOR GENERAL SETTINGS PAGE
429
+ selector = self.currentPreset.selector;
430
+ //exit when default selector
431
+ if (selector.indexOf('ELEMENT NOW') != -1 || selector.indexOf('PICK ELEMENT') != -1) {
432
+ return;
433
+ }
434
+ //get the element from iframe or current page
435
+ if ($("#header1preview").length) {
436
+ element = $("#header1preview").contents().find(selector);
437
+ } else {
438
+ element = $(selector);
439
+ }
440
+ element.each(function () {
441
+ //CSS exceptions and general action
442
+ switch (settingName) {
443
+ case 'rotate':
444
+ $(this).style('-webkit-transform', 'rotate(' + value + 'deg)', 'important');
445
+ $(this).style('-moz-transform', 'rotate(' + value + 'deg)', 'important');
446
+ $(this).style('-o-transform', 'rotate(' + value + 'deg)', 'important');
447
+ $(this).style('-ms-transform', 'rotate(' + value + 'deg)', 'important');
448
+ $(this).style('transform', 'rotate(' + value + 'deg)', 'important');
449
+ break;
450
+ //general action
451
+ default:
452
+ $(this).style(settingName, value, 'important');
453
+ }
454
+ });
455
+ } else if (self.mode === 'postPage') {
456
+ //VERSION FOR POST PAGE
457
+ //get selection
458
+ selection = tinyMCE.activeEditor.selection.getContent();
459
+ //only apply if something is selected
460
+ if (!selection) {
461
+ return;
462
+ }
463
+ //selectorValid - validate selector created from selected text.
464
+ //required because for example "." with nothing following breaks function execution
465
+ selectorValid = true;
466
+ try {
467
+ $selectorContents = $(selection);
468
+ } catch (e) {
469
+ selectorValid = false;
470
+ }
471
+ if(selectorValid && $selectorContents.length > 1) {
472
+ selectorValid = false;
473
+ }
474
+ //get node
475
+ node = tinyMCE.activeEditor.selection.getNode();
476
+ if (selectorValid && ($.trim($(node).html()) === $.trim(selection) || $.trim($(node).html()) === $.trim($(selection).html()))) {
477
+ //console.log('already isolated');
478
+ tinyMCE.activeEditor.dom.setStyle(node, settingName, value);
479
+ } else {
480
+ //console.log('isolating: ' + $(node).html() + ' - ' + selection);
481
+ justInsertedClass = 'inserted' + Math.floor(Math.random() * 10000);
482
+ newSpan = $('<span id="' + justInsertedClass + '">' + selection + '</span>');
483
+ newSpan.css(settingName, value);
484
+ $tempDiv = $('<div>').append(newSpan.clone());
485
+ $tempDiv.find('*').each(function () {
486
+ //if($(this).inlineStyle && $(this).inlineStyle(settingName)) {
487
+ $(this).css(settingName, value);
488
+ //}
489
+ });
490
+ //get span html together with span itself
491
+ newHTML = $tempDiv.html();
492
+ inserted = tinyMCE.activeEditor.selection.setContent(newHTML);
493
+ tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('span#' + justInsertedClass)[0]);
494
+ }
495
+ }
496
+ };
497
+ /*
498
+ *
499
+ * FIELDS
500
+ *
501
+ */
502
+ /*
503
+ * Load extended fields
504
+ */
505
+ self.loadExtendedFields = function (data) {
506
+ var i,
507
+ field,
508
+ paramObj;
509
+ //create a new modal for it
510
+ var modalOptions = {
511
+ name: 'extrafields',
512
+ title: 'Pro options',
513
+ left: '12px',
514
+ top: '212px',
515
+ width: '270px'
516
+ };
517
+ var modal = self.createNewModal(modalOptions);
518
+ for (i = 0; i < data.length; i += 1) {
519
+ field = data[i];
520
+ paramObj = {};
521
+ paramObj.field = field;
522
+ paramObj.type = 'extrafields';
523
+ self.addSettingsField(paramObj);
524
+ }
525
+ self.reloadPreset();
526
+ // old "add shadow" setting
527
+ /*self.xhrPost({
528
+ url: self.options.FFW_baseUrl + '/api/getextrafields2',
529
+ data: {
530
+ apikey: self.options.apikey,
531
+ blogurl: fontBlogUrl
532
+ }
533
+ },
534
+ function (data) {
535
+ self.$extendedFields.html('');
536
+ for (i = 0; i < data.length; i += 1) {
537
+ field = data[i];
538
+ paramObj = {};
539
+ paramObj.field = field;
540
+ paramObj.type = 'premium';
541
+ self.addSettingsField(paramObj);
542
+ //add premium buttons
543
+ $('#upgradeToProButton').remove();
544
+ $('#shadowSettings').show();
545
+ $('#extrafieldsSettings').show();
546
+ clearInterval(self.checkForApikeyInterval);
547
+ }
548
+ self.reloadPreset();
549
+ //reposition
550
+ //var offset = self.$apr.offset().top - self.$apr.height() / 2 + 30;
551
+ //self.$apr.css('bottom', 'auto');
552
+ //self.$apr.css('top', offset);
553
+ });*/
554
+ };
555
+ /*
556
+ * Add a field to selected place
557
+ * paramObj
558
+ *
559
+ * @returns {unresolved}
560
+ * .field - field definition - no data or assignations here
561
+ * .settings - contain field settings
562
+ */
563
+ self.addSettingsField = function (paramObj) {
564
+ var field = paramObj.field,
565
+ thisField,
566
+ thisInput,
567
+ i,
568
+ manipulator,
569
+ fieldset,
570
+ fieldParam,
571
+ container,
572
+ inputFields = [];;
573
+ //add support for multi value field
574
+ if (field.settingType == 'cssmultival') {
575
+ if (!paramObj.target) {
576
+ //create a new modal for it
577
+ var modalOptions = {
578
+ name: field.name,
579
+ title: field.label,
580
+ left: '0',
581
+ top: '50px',
582
+ width: '270px'
583
+ };
584
+ container = self.createNewModal(modalOptions);
585
+ } else {
586
+ container = paramObj.target;
587
+ }
588
+ //create a fieldset
589
+ fieldset = self.settingFields[field.name] = $('<fieldset id="' + field.name + 'Fieldset"></fieldset>');
590
+ //add fieldset to extended fields
591
+ container.append(fieldset);
592
+ var XYSliderOptions = false;
593
+ //add all controls
594
+ for (i = 0; i < field.values.length; i += 1) {
595
+ fieldParam = field.values[i];
596
+ var privateInputField = thisInput;
597
+ var subfield = fieldParam;
598
+ //create a field with label around
599
+ var manipulator = $('<label>' + subfield.label + '<a class="resetField">reset</a><input type="' + subfield.type + '" title="' + subfield.settingName + '"></label>');
600
+ manipulator.appendTo(fieldset);
601
+ privateInputField = manipulator.find('input');
602
+ privateInputField.data('fieldInfo', subfield);
603
+ privateInputField.data('settings', paramObj.settings);
604
+ // ADD CORRESPONDING ENTRY IN FIELD SETTINGS
605
+ if (paramObj.settings && !paramObj.settings.params) {
606
+ var params = {};
607
+ paramObj.settings.params = params;
608
+ }
609
+ //append field to extended list
610
+ fieldset.append(thisField);
611
+ //extend field with whatever
612
+ privateInputField = self.extendField(privateInputField, subfield.extendWith);
613
+ // if handle is assigned add actions
614
+ if (subfield.handle) {
615
+ if (!XYSliderOptions) {
616
+ XYSliderOptions = {};
617
+ XYSliderOptions.actions = [];
618
+ }
619
+ // action can be x, y, deg, distance
620
+ // stop - last action don't trigger input change
621
+ XYSliderOptions.id = privateInputField.data('settings').uniqueId;
622
+ inputFields[subfield.handle.linkTo] = privateInputField;
623
+ }
624
+ }
625
+ var XYSlider = false;
626
+ if (XYSliderOptions) {
627
+ var rand = Math.random() * 1000,
628
+ stop = true;
629
+ // if xy slider set then add it
630
+ XYSliderOptions.label = field.label;
631
+ XYSliderOptions.settingName = paramObj.settings.uniqueId;
632
+ var Mathra = Math.random();
633
+ XYSliderOptions.actions = function (x, y, deg, distance) {
634
+ inputFields['x'] ? (
635
+ inputFields['x'].val(x),
636
+ inputFields['x'].trigger('change', stop)
637
+ ) : false;
638
+ inputFields['y'] ? (
639
+ inputFields['y'].val(y),
640
+ inputFields['y'].trigger('change', stop)
641
+ ) : false;
642
+ inputFields['deg'] ? (
643
+ inputFields['deg'].val(deg),
644
+ inputFields['deg'].trigger('change', stop)
645
+ ) : false;
646
+ inputFields['distance'] ? (
647
+ inputFields['distance'].val(distance / 2),
648
+ inputFields['distance'].trigger('change', stop)
649
+ ) : false;
650
+ };
651
+ //XYSliderOptions.target = paramObj.target;
652
+ var $XYSlider = self.currentElement.XYSlider(XYSliderOptions);
653
+ XYSlider = $XYSlider.data('XYSlider');
654
+ //add to effect handles
655
+ self.effectSliders[paramObj.settings.uniqueId] = XYSlider.$handleHolder;
656
+ if (!paramObj.settings.enabled) {
657
+ self.effectSliders[paramObj.settings.uniqueId].hide();
658
+ }
659
+ }
660
+ //bind action to the inputs
661
+ var inputs = fieldset.find('input');
662
+ //bind change to inputs
663
+ inputs.bind('change click keyup', function (event, stop) {
664
+ // settings
665
+ var settings = $(this).data('settings'),
666
+ fieldInfo = $(this).data('fieldInfo'),
667
+ storage = $(this).data('storage'),
668
+ val = $(this).val();
669
+ if (stop === undefined) stop = false;
670
+ // add arrow up - down support
671
+ //37 - left
672
+ //38 - up
673
+ //39 - right
674
+ //40 - down
675
+ if (event.which === 38 && !isNaN(val)) {
676
+ $(this).val(parseFloat(val) + 1);
677
+ $(this).trigger('change');
678
+ return false;
679
+ } else if (event.which === 40 && !isNaN(val)) {
680
+ $(this).val(parseFloat(val) - 1);
681
+ $(this).trigger('change');
682
+ return false;
683
+ }
684
+ // save param setting
685
+ settings.params[fieldInfo.settingName] = val;
686
+ // when changing value of the input move the handle too
687
+ // if this input is linked to a handle
688
+ if (XYSlider && !stop && fieldInfo.handle) {
689
+ // get "linked to" of a handle and move x or y accordingly
690
+ if (fieldInfo.handle.linkTo === 'x') {
691
+ XYSlider.setPosition($(this).val(), false);
692
+ } else if (fieldInfo.handle.linkTo === 'y') {
693
+ XYSlider.setPosition(false, $(this).val());
694
+ }
695
+ }
696
+ //console.log($(this).data('fieldInfo').settingName + ', ' + $(this).val() + ', ' + ($(this).data('fieldInfo').unit || ''))
697
+ //get values of all siblings and create one value for the element
698
+ var completeValue = '';
699
+ inputs.each(function () {
700
+ var fieldInfo = $(this).data('fieldInfo'),
701
+ unit = '';
702
+ if (fieldInfo.unit) {
703
+ unit = fieldInfo.unit;
704
+ }
705
+ //get field info
706
+ completeValue += ' ' + $(this).val() + unit;
707
+ if ($(this).val() == '') {
708
+ $(this).val(fieldInfo['default']);
709
+ }
710
+ });
711
+ // if this is text-shadow
712
+ if (field.settingName === 'text-shadow') {
713
+ //var effect = self.getElementsEffect(settings.uniqueId);
714
+ completeValue = completeValue.replace(/, +$/, '');
715
+ var XYSliderValues = XYSlider.getCurrentValues();
716
+ self.drawEffects({
717
+ completeValue: completeValue,
718
+ target: self.currentElement,
719
+ color: settings.params.color,
720
+ x: -XYSliderValues.x,
721
+ y: XYSliderValues.y,
722
+ deg: 180 - XYSliderValues.deg * -1,
723
+ distance: XYSliderValues.distance,
724
+ effectId: settings.uniqueId,
725
+ effectsList: ['textShadow']
726
+ });
727
+ } else if (field.settingName === 'text-stroke') {
728
+ // go through all settings
729
+ //var effect = self.getElementsEffect(settings.uniqueId);
730
+ completeValue = completeValue.replace(/, +$/, '');
731
+ //var XYSliderValues = XYSlider.getCurrentValues();
732
+ self.drawEffects({
733
+ target: self.currentElement,
734
+ color: settings.params.color,
735
+ distance: settings.params.width,
736
+ effectId: settings.uniqueId,
737
+ spread: settings.params.spread,
738
+ effectsList: ['stroke']
739
+ });
740
+ } else if (field.settingName === 'text-extrude') {
741
+ var XYSliderValues = XYSlider.getCurrentValues();
742
+ self.drawEffects({
743
+ target: self.currentElement,
744
+ color: settings.params.color,
745
+ deg: 180 - XYSliderValues.deg * -1,
746
+ distance: XYSliderValues.distance,
747
+ effectId: settings.uniqueId,
748
+ effectsList: ['extrude3d']
749
+ });
750
+ } else if (field.settingName === 'text-extrude-shadow') {
751
+ var XYSliderValues = XYSlider.getCurrentValues();
752
+ self.drawEffects({
753
+ color: settings.params.color,
754
+ target: self.currentElement,
755
+ deg: 180 - XYSliderValues.deg * -1,
756
+ distance: XYSliderValues.distance,
757
+ effectId: settings.uniqueId,
758
+ effectsList: ['extrude3d', 'shadow3d']
759
+ });
760
+ } else if (field.settingName === 'text-shadow-multiple') {
761
+ var XYSliderValues = XYSlider.getCurrentValues();
762
+ self.drawEffects({
763
+ target: self.currentElement,
764
+ color: settings.params.color,
765
+ opacity: settings.params.opacity,
766
+ deg: 180 - XYSliderValues.deg * -1,
767
+ distance: XYSliderValues.distance,
768
+ effectId: settings.uniqueId,
769
+ effectsList: ['shadow3d']
770
+ });
771
+ } else {
772
+ //console.log(field.settingName + ': ' + completeValue);
773
+ self.updateCssSettings(field.settingName, completeValue);
774
+ self.updateSelectedElement(field.settingName, completeValue);
775
+ }
776
+ return false;
777
+ });
778
+ //reset field button action
779
+ fieldset.find('a.resetField').click(function () {
780
+ thisInput.val('');
781
+ thisInput.trigger('change');
782
+ alert('When resetting settings or deleting preset you have to save to see the change');
783
+ });
784
+ } else {
785
+ self.settingFields[field.name] = $('<fieldset id="' + field.name + 'Fieldset"><label>' + field.label + '<a class="resetField">reset</a><input type="' + field.type + '" name="' + field.name + '" title="' + field.settingName + '" id="' + field.name + 'Field"></label></fieldset>');
786
+ thisField = self.settingFields[field.name];
787
+ thisInput = self.getField(field.name);
788
+ thisInput.data('fieldInfo', field);
789
+ if (paramObj.target) {
790
+ paramObj.target.append(thisField);
791
+ } else if (paramObj.type === 'premium') {
792
+ self.$extendedFields.append(thisField);
793
+ } else if (paramObj.type === 'extrafields') {
794
+ self.modals['extrafields'].append(thisField);
795
+ } else {
796
+ if (field.name === 'selector') {
797
+ thisField.insertAfter('#presetsDropdownFieldset');
798
+ } else {
799
+ self.$standardFields.append(thisField);
800
+ }
801
+ }
802
+ //reset field button action
803
+ thisField.find('a.resetField').click(function () {
804
+ thisInput.val(0);
805
+ thisInput.trigger('change');
806
+ thisInput.val('none');
807
+ thisInput.trigger('change');
808
+ thisInput.val('inherit');
809
+ thisInput.trigger('change');
810
+ thisInput.val('');
811
+ thisInput.trigger('change');
812
+ });
813
+ thisInput = self.extendField(thisInput, field.extendWith);
814
+ //general actions - apply settings
815
+ if (field.settingType === 'css') {
816
+ //bind change to color picker
817
+ thisInput.bind('change click keyup', function () {
818
+ //console.log($(this).data('fieldInfo').settingName + ', ' + $(this).val() + ', ' + ($(this).data('fieldInfo').unit || ''))
819
+ self.updateCssSettings($(this).data('fieldInfo').settingName, $(this).val());
820
+ self.updateSelectedElement($(this).data('fieldInfo').settingName, $(this).val() + ($(this).data('fieldInfo').unit || ''));
821
+ return false;
822
+ });
823
+ } else if (field.settingType === 'csstransform') {
824
+ //bind change to color picker
825
+ thisInput.bind('change click keyup', function () {
826
+ //console.log($(this).data('fieldInfo').settingName + ', ' + $(this).val() + ', ' + ($(this).data('fieldInfo').unit || ''))
827
+ self.updateCssSettings($(this).data('fieldInfo').settingName, $(this).val());
828
+ self.updateSelectedElement($(this).data('fieldInfo').settingName, $(this).val() + ($(this).data('fieldInfo').unit || ''));
829
+ return false;
830
+ });
831
+ } else if (field.settingType === 'general') {
832
+ //bind change to color picker
833
+ thisInput.bind('change click', function () {
834
+ self.updateSettings($(this).data('fieldInfo').settingName, $(this).val());
835
+ self.updateSelectedElement($(this).data('fieldInfo').settingName, $(this).val());
836
+ return false;
837
+ });
838
+ }
839
+ }
840
+ };
841
+ // extend field with slider, color picker etc
842
+ self.extendField = function (field, extendWith) {
843
+ if (extendWith === 'slider') {
844
+ var input = (function () {
845
+ var min = 1,
846
+ max = 100,
847
+ step = 1,
848
+ value = 40,
849
+ orientation = 'horizontal',
850
+ reverse = false,
851
+ $slider = $('<div>'),
852
+ input = field,
853
+ fieldset = input.parents('fieldset');
854
+ fieldset.addClass('slider-extended');
855
+ fieldset.append($slider);
856
+ if (input.data('fieldInfo').slider) {
857
+ min = parseFloat(input.data('fieldInfo').slider.min);
858
+ max = parseFloat(input.data('fieldInfo').slider.max);
859
+ step = parseFloat(input.data('fieldInfo').slider.step);
860
+ if (input.data('fieldInfo').slider.orientation) {
861
+ orientation = input.data('fieldInfo').slider.orientation;
862
+ }
863
+ if (input.data('fieldInfo').slider.value) {
864
+ value = input.data('fieldInfo').slider.value;
865
+ }
866
+ if (input.data('fieldInfo').slider.reverse) {
867
+ reverse = true;
868
+ }
869
+ }
870
+ //init slider
871
+ $slider.slider({
872
+ range: "min",
873
+ value: value,
874
+ min: min,
875
+ max: max,
876
+ step: step,
877
+ orientation: orientation,
878
+ slide: function (event, ui) {
879
+ if (!reverse) {
880
+ input.val(ui.value);
881
+ } else {
882
+ //reversed values
883
+ input.val(max + min - ui.value);
884
+ }
885
+ input.trigger('change');
886
+ }
887
+ });
888
+ //bind value change to the size slider
889
+ input.bind('change click', function () {
890
+ var val = $(this).val();
891
+ if (val) {
892
+ $slider.slider('value', parseFloat(val));
893
+ }
894
+ return false;
895
+ });
896
+ return input;
897
+ }());
898
+ } else if (extendWith === 'colorPicker') {
899
+ var input = (function () {
900
+ var input = field;
901
+ input.change(function () {
902
+ $(this).css('backgroundColor', $(this).val());
903
+ });
904
+ //init color picker
905
+ input.ColorPicker({
906
+ color: '#0000ff',
907
+ onShow: function (colpkr) {
908
+ $(colpkr).fadeIn(500);
909
+ return false;
910
+ },
911
+ onHide: function (colpkr) {
912
+ $(colpkr).fadeOut(500);
913
+ return false;
914
+ },
915
+ onChange: function (hsb, hex, rgb) {
916
+ input.val('#' + hex);
917
+ input.trigger('change');
918
+ input.trigger('change').css('backgroundColor', '#' + hex);
919
+ },
920
+ onBeforeShow: function () {
921
+ $(this).ColorPickerSetColor(this.value);
922
+ }
923
+ }).bind('keyup', function () {
924
+ $(this).ColorPickerSetColor(this.value);
925
+ });
926
+ return input;
927
+ }());
928
+ } else if (extendWith === 'selectorPicker') {
929
+ var input = (function (field) {
930
+ var replacementField,
931
+ thisInput,
932
+ selectorPicker,
933
+ selectorPicker2,
934
+ input = field,
935
+ field = field.data('fieldInfo'),
936
+ fieldset = input.parents('fieldset');
937
+ self.settingFields[field.name] = $('<fieldset id="selectorFieldset"><label><input type="' + field.type + '" name="' + field.name + '" title="' + field.settingName + '">CSS selecor editor (advanced)</label></fieldset>');
938
+ replacementField = self.settingFields[field.name];
939
+ thisInput = self.getField(field.name);
940
+ selectorPicker = $('<button class="pickElement">Pick element</button>');
941
+ selectorPicker2 = $('<button class="pickElement pickAddElement">Pick element(add)</button>');
942
+ self.$selectorPicker = selectorPicker;
943
+ self.$selectorPicker2 = selectorPicker2;
944
+ //
945
+ //setTimeout(function () {
946
+ self.$selectorPicker.insertBefore(self.settingFields.presets);
947
+ //}, 100);
948
+ //replacementField.prepend(selectorPicker);
949
+ replacementField.prepend(selectorPicker2);
950
+ selectorPicker.on('click', function () {
951
+ self.bindGetSelector();
952
+ return false;
953
+ });
954
+ selectorPicker2.on('click', function () {
955
+ self.bindGetSelector(true);
956
+ return false;
957
+ });
958
+ //replace default field
959
+ fieldset.replaceWith(replacementField);
960
+ replacementField.find('label').hide();
961
+ thisInput.data('fieldInfo', field);
962
+ //return replaced input
963
+ return thisInput;
964
+ }(field));
965
+ }
966
+ return input;
967
+ };
968
+ // get field value
969
+ self.getField = function (name) {
970
+ var input = self.settingFields[name].find('input');
971
+ return input;
972
+ };
973
+ // set field value
974
+ self.setField = function (name, value) {
975
+ var input = self.getField(name);
976
+ input.val(value);
977
+ input.trigger('change');
978
+ };
979
+ /*
980
+ * EFFECTS
981
+ */
982
+ self.loadEffects = function (data) {
983
+ var i,
984
+ field,
985
+ paramObj;
986
+ var dropdown,
987
+ option,
988
+ field,
989
+ effectsList = $('<div class="effectsList">');
990
+ // save effects to array
991
+ self.effects = data;
992
+ /*
993
+ Create effects modal
994
+ */
995
+ var modalOptions = {
996
+ id: 'effectsPanel',
997
+ name: 'effects', // name conflict was here
998
+ title: 'Effects',
999
+ left: '116px',
1000
+ top: '50px',
1001
+ width: '190px'
1002
+ };
1003
+ var modal = self.createNewModal(modalOptions);
1004
+ dropdown = $('<select>');
1005
+ dropdown.append($('<option>Add new effect</option>'));
1006
+ // add options to the modal
1007
+ for (i = 0; i < data.length; i += 1) {
1008
+ field = data[i];
1009
+ option = $('<option value="' + field.settingName + '">' + field.label + '</option>');
1010
+ dropdown.append(option);
1011
+ }
1012
+ if (data.length < 3) {
1013
+ dropdown.append('<option value="upgrade">More options</option>');
1014
+ }
1015
+ // add dropdown to modal
1016
+ modal.append(dropdown);
1017
+ // change
1018
+ dropdown.change(function () {
1019
+ if ($(this).val() == 'upgrade') {
1020
+ var link = $('<a href="http://fontsforweb.com/purchase/pluginupgrade?url=' + fontBlogUrl + '&name=' + fontBlogName + '" class="overlay_url" id="upgradeToProButton" data-upgrade="true">More</a>').appendTo('body');
1021
+ link.click();
1022
+ link.remove();
1023
+ return;
1024
+ }
1025
+ self.addEffect($(this).val());
1026
+ dropdown.find('option').eq(0).attr('selected', 'selected');
1027
+ });
1028
+ modal.append(effectsList);
1029
+ effectsList.sortable({
1030
+ stop: function () {
1031
+ // get new order of items
1032
+ var items = effectsList.find('> div'),
1033
+ newEffectsOrder = [];
1034
+ // for each item
1035
+ items.each(function (ind) {
1036
+ var effectSettings = $(this).data('settings');
1037
+ effectSettings.effectNo = ind;
1038
+ newEffectsOrder.push(effectSettings);
1039
+ });
1040
+ self.currentPreset.effects = newEffectsOrder;
1041
+ // refresh text shadow effects
1042
+ self.updateTextShadowEffects(self.currentElement);
1043
+ },
1044
+ /*sort: function (event) {
1045
+ this.stop(stop);
1046
+ }*/
1047
+ });
1048
+ };
1049
+ /*
1050
+ * load effect settings
1051
+ */
1052
+ self.loadEffectSettings = function () {
1053
+ // if no effects loaded yet quit
1054
+ if (!self.effects) return;
1055
+ if (!self.currentPreset.effects) return;
1056
+ // get effect saved settings
1057
+ for (var i = 0; i < self.currentPreset.effects.length; i++) {
1058
+ var effect = self.currentPreset.effects[i],
1059
+ // add effect in order to the effects list
1060
+ $effectItem = self.createEffectEntry(effect);
1061
+ if (effect.enabled) {
1062
+ $effectItem.find('input[name=enabled]').attr("checked", "true");
1063
+ }
1064
+ /*
1065
+ go through all the parameters and set them accordingly
1066
+ */
1067
+ // clone object beforehand to avoid properties overwriting inside effect
1068
+ var params = $.extend({}, effect.params);
1069
+ for (var property in params) {
1070
+ var value = params[property];
1071
+ // get field from current effect
1072
+ var found = $effectItem.find('input[title=' + property + ']');
1073
+ if (found.length) {
1074
+ found.val(value);
1075
+ found.trigger('change');
1076
+ }
1077
+ }
1078
+ }
1079
+ };
1080
+ /*
1081
+ * Unload current effect
1082
+ *
1083
+ * @returns {unresolved}
1084
+ */
1085
+ self.unloadCurrentElementEffects = function () {
1086
+ if (!Object.size(self.effectSliders) || self.currentPreset === undefined || self.currentPreset.effects === undefined) return;
1087
+ // unload all handles
1088
+ for (var i = 0; i < self.currentPreset.effects.length; i++) {
1089
+ var effect = self.currentPreset.effects[i];
1090
+ if (self.effectSliders[effect.uniqueId]) {
1091
+ self.effectSliders[effect.uniqueId].hide();
1092
+ }
1093
+ }
1094
+ if (!self.modals['effects']) return;
1095
+ self.modals['effects'].find('.effectsList').html('');
1096
+ };
1097
+ /*
1098
+ * add effect to effects list
1099
+ */
1100
+ self.addEffect = function (settingName) {
1101
+ var effectSettings = {};
1102
+ if (!self.currentPreset.effects) {
1103
+ self.currentPreset.effects = [];
1104
+ effectSettings.effectNo = 0;
1105
+ } else {
1106
+ effectSettings.effectNo = self.currentPreset.effects.length;
1107
+ }
1108
+ effectSettings.settingName = settingName;
1109
+ effectSettings.uniqueId = effectSettings.effectNo + Math.round(Math.random() * 1000000000) + settingName;
1110
+ effectSettings.enabled = 1;
1111
+ // add effect settings to preset
1112
+ self.currentPreset.effects.splice(0, 0, effectSettings);
1113
+ // create entry
1114
+ return self.createEffectEntry(effectSettings);
1115
+ };
1116
+ /*
1117
+ * add effect to the list
1118
+ *
1119
+ * @param {type} effectId
1120
+ * @returns {effect}
1121
+ */
1122
+ self.createEffectEntry = function (effectSettings) {
1123
+ //if effects modal not created yet don't load effects
1124
+ if (!self.modals['effects']) return;
1125
+ var effectItem,
1126
+ effectDefinition = self.getEffectDefinitionByName(effectSettings.settingName),
1127
+ effectsModal = self.modals['effects'].find('.effectsList'),
1128
+ effectParams = $('<div class="params"></div>'),
1129
+ enabledCheckbox = $('<input type="checkbox" name="enabled">'),
1130
+ arrow = $('<a href="#" class="effectArrow"></a>'),
1131
+ label = $('<a href="#" class="effectName">' + effectDefinition.label + '</a>'),
1132
+ closeButton = $('<a href="#" class="removeEffect">x</a>');
1133
+ // create item markup
1134
+ effectItem = $('<div>');
1135
+ effectItem.append('<div class="label">');
1136
+ effectItem.find('.label').append(arrow);
1137
+ effectItem.find('.label').append(enabledCheckbox);
1138
+ effectItem.find('.label').append(label);
1139
+ effectItem.find('.label').append(closeButton);
1140
+ effectItem.append(effectParams);
1141
+ effectParams.hide();
1142
+ if (effectSettings.enabled) {
1143
+ enabledCheckbox.attr('checked', 'true');
1144
+ }
1145
+ // add settings
1146
+ effectsModal.prepend(effectItem);
1147
+ var paramObj = [];
1148
+ paramObj.field = effectDefinition;
1149
+ paramObj.settings = effectSettings;
1150
+ paramObj.target = effectParams;
1151
+ paramObj.type = 'extrafields';
1152
+ // actions
1153
+ label.click(function (e) {
1154
+ if (effectParams.is(':visible')) {
1155
+ arrow.animateRotate(0);
1156
+ } else {
1157
+ arrow.animateRotate(90);
1158
+ }
1159
+ e.preventDefault();
1160
+ effectParams.slideToggle();
1161
+ });
1162
+ arrow.click(function (e) {
1163
+ if (effectParams.is(':visible')) {
1164
+ arrow.animateRotate(0);
1165
+ } else {
1166
+ arrow.animateRotate(90);
1167
+ }
1168
+ e.preventDefault();
1169
+ effectParams.slideToggle();
1170
+ });
1171
+ // close button
1172
+ closeButton.click(function (e) {
1173
+ e.preventDefault();
1174
+ // delete effect from
1175
+ self.removeEffect(effectSettings.uniqueId, effectItem);
1176
+ });
1177
+ // enable disable checkbox
1178
+ enabledCheckbox.click(function (e) {
1179
+ if ($(this).is(':checked')) {
1180
+ self.enableEffect(effectSettings.uniqueId, effectItem);
1181
+ } else {
1182
+ self.disableEffect(effectSettings.uniqueId, effectItem);
1183
+ }
1184
+ });
1185
+ self.addSettingsField(paramObj);
1186
+ //add item reference in settings and settings in item
1187
+ //effectSettings.el = effectItem; ERROR on stringify
1188
+ effectItem.data('settings', effectSettings);
1189
+ return effectItem;
1190
+ };
1191
+ /*
1192
+ * get effect definition by id
1193
+ */
1194
+ self.getEffectDefinitionByName = function (effectId) {
1195
+ if (!self.effects) return false;
1196
+ // go thorugh all effects and find the ONE
1197
+ for (var i = 0; i < self.effects.length; i++) {
1198
+ var effect = self.effects[i];
1199
+ if (effect.settingName === effectId) {
1200
+ return effect;
1201
+ }
1202
+ }
1203
+ return false;
1204
+ };
1205
+ /*
1206
+ * Enable effect
1207
+ *
1208
+ * @param {type} effectId
1209
+ */
1210
+ self.enableEffect = function (effectId, $effectItem) {
1211
+ if (!self.currentPreset.effects) return false;
1212
+ var effect = self.getElementsEffect(effectId);
1213
+ effect.enabled = 1;
1214
+ // if has handle show it
1215
+ if (self.effectSliders[effectId]) {
1216
+ self.effectSliders[effectId].show();
1217
+ }
1218
+ // update text shadow effects
1219
+ self.updateTextShadowEffects(self.currentElement);
1220
+ };
1221
+ /*
1222
+ * Disable effect
1223
+ *
1224
+ * @param {type} effectId
1225
+ */
1226
+ self.disableEffect = function (effectId, $effectItem) {
1227
+ if (!self.currentPreset.effects) return false;
1228
+ var effect = self.getElementsEffect(effectId);
1229
+ effect.enabled = 0;
1230
+ // delete shadow css
1231
+ self.removeShadowEffect(effectId);
1232
+ // if has handle hide it
1233
+ if (self.effectSliders[effectId]) {
1234
+ self.effectSliders[effectId].hide();
1235
+ }
1236
+ };
1237
+ /*
1238
+ * Delete effect from an element
1239
+ *
1240
+ * @param {type} effectId
1241
+ */
1242
+ self.removeEffect = function (effectId, $effectItem) {
1243
+ if (!confirm('Remove the effect?')) return;
1244
+ if (!self.currentPreset.effects) return false;
1245
+ // go thorugh all effects and find the ONE
1246
+ for (var i = 0; i < self.currentPreset.effects.length; i++) {
1247
+ var effect = self.currentPreset.effects[i];
1248
+ if (effect.uniqueId === effectId) {
1249
+ self.currentPreset.effects.splice(i, 1);
1250
+ }
1251
+ }
1252
+ // delete shadow css
1253
+ self.removeShadowEffect(effectId);
1254
+ // remove handle
1255
+ self.effectSliders[effectId].remove();
1256
+ // delete entry
1257
+ $effectItem.remove();
1258
+ };
1259
+ /*
1260
+ * Get effect of an element
1261
+ *
1262
+ * @param {type} effectId
1263
+ */
1264
+ self.getElementsEffect = function (effectId) {
1265
+ if (!self.currentPreset.effects) return false;
1266
+ // go thorugh all effects and find the ONE
1267
+ for (var i = 0; i < self.currentPreset.effects.length; i++) {
1268
+ var effect = self.currentPreset.effects[i];
1269
+ if (effect.uniqueId === effectId) {
1270
+ return effect;
1271
+ }
1272
+ }
1273
+ };
1274
+ /*
1275
+ draw effects
1276
+ options.target;
1277
+ options.deg;
1278
+ options.distance;
1279
+ options.effectId;
1280
+ options.effectsList;
1281
+ */
1282
+ self.drawEffects = function (options) {
1283
+ if (!self.shadowSupport) return false;
1284
+ var depth = options.distance / 10,
1285
+ subjectColor = options.target.css('color'),
1286
+ color = options.color,
1287
+ subjectColorRgb = self.parseRgb(subjectColor),
1288
+ rColor = subjectColorRgb.r,
1289
+ gColor = subjectColorRgb.g,
1290
+ bColor = subjectColorRgb.b,
1291
+ i = 0,
1292
+ j = 0,
1293
+ speed = i,
1294
+ xDist = 0,
1295
+ yDist = 0,
1296
+ //get effect
1297
+ effect = self.getElementsEffect(options.effectId),
1298
+ angle = options.deg;
1299
+ if (color) {
1300
+ var colorRgb = self.html2rgb(color.replace('#', ''));
1301
+ } else {
1302
+ colorRgb = subjectColorRgb;
1303
+ }
1304
+ // set default angle
1305
+ if (angle === undefined) {
1306
+ angle = 290;
1307
+ }
1308
+ // reset current elements calculated effect value
1309
+ effect.calculated = '';
1310
+ // go through effects which should be applied
1311
+ for (i = 0; i < options.effectsList.length; i++) {
1312
+ depth = options.distance / 10;
1313
+ var effectName = options.effectsList[i];
1314
+ switch (effectName) {
1315
+ case 'textShadow':
1316
+ effect.calculated += options.completeValue;
1317
+ //console.log(effect.calculated);
1318
+ //completeValue += ' ' + $(this).val() + unit;
1319
+ //effect.calculated = completeValue.replace(/, +$/,'')
1320
+ break;
1321
+ case 'stroke':
1322
+ var spread = 2;
1323
+ if (options.spread) {
1324
+ spread = options.spread;
1325
+ }
1326
+ // if distance is bigger than 4 add
1327
+ if (options.distance > 4) {
1328
+ // slash
1329
+ effect.calculated += options.distance + 'px ' + options.distance + 'px ' + spread + 'px ' + color + ', ';
1330
+ effect.calculated += -options.distance + 'px ' + options.distance + 'px ' + spread + 'px ' + color + ', ';
1331
+ effect.calculated += options.distance + 'px ' + -options.distance + 'px ' + spread + 'px ' + color + ', ';
1332
+ effect.calculated += -options.distance + 'px ' + -options.distance + 'px ' + spread + 'px ' + color + ', ';
1333
+ // top and down
1334
+ effect.calculated += options.distance + 'px 0px ' + spread + 'px ' + color + ', ';
1335
+ effect.calculated += -options.distance + 'px 0px ' + spread + 'px ' + color + ', ';
1336
+ effect.calculated += '0px ' + options.distance + 'px ' + spread + 'px ' + color + ', ';
1337
+ effect.calculated += '0px ' + -options.distance + 'px ' + spread + 'px ' + color + ', ';
1338
+ } else {
1339
+ // only slash
1340
+ effect.calculated += options.distance + 'px ' + options.distance + 'px ' + spread + 'px ' + color + ', ';
1341
+ effect.calculated += -options.distance + 'px ' + options.distance + 'px ' + spread + 'px ' + color + ', ';
1342
+ effect.calculated += options.distance + 'px ' + -options.distance + 'px ' + spread + 'px ' + color + ', ';
1343
+ effect.calculated += -options.distance + 'px ' + -options.distance + 'px ' + spread + 'px ' + color + ', ';
1344
+ }
1345
+ case 'extrude3d':
1346
+ // get color color
1347
+ rColor = colorRgb.r;
1348
+ gColor = colorRgb.g;
1349
+ bColor = colorRgb.b;
1350
+ //initially take 20% off
1351
+ rColor = rColor / 100 * 80,
1352
+ gColor = gColor / 100 * 80,
1353
+ bColor = bColor / 100 * 80;
1354
+ //loop to depth
1355
+ for (j = 0; j < depth; j++) {
1356
+ //calculate x and y of next shadow
1357
+ speed = 1.2;
1358
+ xDist += speed * Math.sin(angle * Math.PI / 180);
1359
+ yDist += speed * -Math.cos(angle * Math.PI / 180);
1360
+ xDist = xDist;
1361
+ yDist = yDist;
1362
+ //percentage darkened
1363
+ var percentageDone = j / depth;
1364
+ //darkening strength - the bigger depth the lower sstrength
1365
+ var light = 10 - percentageDone * 10;
1366
+ //darken the next shadow a bit take 10%
1367
+ rColor = Math.floor(rColor / 100 * 91 + light);
1368
+ gColor = Math.floor(gColor / 100 * 91 + light);
1369
+ bColor = Math.floor(bColor / 100 * 91 + light);
1370
+ color = 'rgb(' + rColor + ', ' + gColor + ', ' + bColor + ')';
1371
+ //put together shadow setting
1372
+ effect.calculated += xDist.toFixed(2) + 'px ' + yDist.toFixed(2) + 'px ' + 0.3 + 'px ' + color + ', ';
1373
+ }
1374
+ break;
1375
+ case 'shadow3d': //generate text shadow value
1376
+ // get color color
1377
+ rColor = colorRgb.r;
1378
+ gColor = colorRgb.g;
1379
+ bColor = colorRgb.b;
1380
+ //loop to depth
1381
+ for (j = 0; j < depth; j++) {
1382
+ if (j > 3 && i % 3) continue;
1383
+ //calculate x and y of next shadow
1384
+ speed = 6;
1385
+ xDist += speed * Math.sin(angle * Math.PI / 180);
1386
+ yDist += speed * -Math.cos(angle * Math.PI / 180);
1387
+ xDist = xDist;
1388
+ yDist = yDist;
1389
+ //lighten the next shadow a bit take 10%
1390
+ rColor = Math.floor(rColor / 90 * 100);
1391
+ gColor = Math.floor(gColor / 90 * 100);
1392
+ bColor = Math.floor(bColor / 90 * 100);
1393
+ var opacity = options.opacity;
1394
+ if (!opacity) opacity = 0.3;
1395
+ color = 'rgba(' + rColor + ', ' + gColor + ', ' + bColor + ', ' + opacity + ')';
1396
+ //put together shadow setting
1397
+ effect.calculated += xDist.toFixed(2) + 'px ' + yDist.toFixed(2) + 'px ' + ((j + 1) * 2) + 'px ' + color + ', ';
1398
+ }
1399
+ break;
1400
+ }
1401
+ }
1402
+ // filter result
1403
+ effect.calculated = effect.calculated.replace(/, +$/, '');
1404
+ //apply text shadow
1405
+ self.updateTextShadowEffects(options.target);
1406
+ };
1407
+ /*
1408
+ * Add text shadow efect for the subject
1409
+ */
1410
+ /*self.extrude3d = function (subject, angle, distance, effectId) {
1411
+ var depth = distance / 10,
1412
+ subjectColor = subject.css('color'),
1413
+ subjectColorRgb = self.parseRgb(subjectColor),
1414
+ //initially take 20% off
1415
+ rColor = subjectColorRgb.r / 100 * 80,
1416
+ gColor = subjectColorRgb.g / 100 * 80,
1417
+ bColor = subjectColorRgb.b / 100 * 80,
1418
+ i = 0,
1419
+ speed = i,
1420
+ xDist = 0,
1421
+ yDist = 0,
1422
+ color = '',
1423
+ //get effect
1424
+ effect = self.getElementsEffect(effectId);
1425
+ if(effectId === undefined) {
1426
+ effectId = 'textExtrudeValue';
1427
+ }
1428
+ if(angle === undefined) {
1429
+ angle = 290;
1430
+ }
1431
+ // reset current elements calculated effect value
1432
+ effect.calculated = '';
1433
+ //generate text shadow value
1434
+ //loop to depth
1435
+ for(i = 0; i < depth; i++) {
1436
+ //calculate x and y of next shadow
1437
+ speed = 1.2;
1438
+ xDist += speed * Math.sin(angle * Math.PI / 180);
1439
+ yDist += speed * -Math.cos(angle * Math.PI / 180);
1440
+ xDist = xDist;
1441
+ yDist = yDist;
1442
+ //percentage darkened
1443
+ var percentageDone = i / depth;
1444
+ //darkening strength - the bigger depth the lower sstrength
1445
+ var light = 10 - percentageDone * 10;
1446
+ //darken the next shadow a bit take 10%
1447
+ rColor = Math.floor(rColor / 100 * 90 + light);
1448
+ gColor = Math.floor(gColor / 100 * 90 + light);
1449
+ bColor = Math.floor(bColor / 100 * 90 + light);
1450
+ color = 'rgb(' + rColor + ', ' + gColor + ', ' + bColor + ')';
1451
+ //put together shadow setting
1452
+ effect.calculated += xDist.toFixed(2) + 'px ' + yDist.toFixed(2) + 'px ' + 0.3 + 'px ' + color + ', ';
1453
+ }
1454
+ // filter
1455
+ effect.calculated = effect.calculated.replace(/, +$/,'');
1456
+ //apply text shadow
1457
+ self.updateTextShadowEffects(subject);
1458
+ };
1459
+ self.addShadow = function (subject, angle, distance, effectId) {
1460
+ var depth = distance / 10,
1461
+ rColor = 0,
1462
+ gColor = 0,
1463
+ bColor = 0,
1464
+ i = 0,
1465
+ speed = i,
1466
+ xDist = 0,
1467
+ yDist = 0,
1468
+ color = '',
1469
+ //get effect
1470
+ effect = self.getElementsEffect(effectId);
1471
+ if(angle === undefined) {
1472
+ angle = 290;
1473
+ }
1474
+ if(effectId === undefined) {
1475
+ effectId = 'textShadowValue';
1476
+ }
1477
+ // reset current elements calculated effect value
1478
+ effect.calculated = '';
1479
+ //generate text shadow value
1480
+ //loop to depth
1481
+ for(i = 0; i < depth; i++) {
1482
+ if(i> 3 && i%3) continue;
1483
+ //calculate x and y of next shadow
1484
+ speed = 6;
1485
+ xDist += speed * Math.sin(angle * Math.PI / 180);
1486
+ yDist += speed * -Math.cos(angle * Math.PI / 180);
1487
+ xDist = xDist;
1488
+ yDist = yDist;
1489
+ //lighten the next shadow a bit take 10%
1490
+ rColor = Math.floor(rColor / 90 * 100);
1491
+ gColor = Math.floor(gColor / 90 * 100);
1492
+ bColor = Math.floor(bColor / 90 * 100);
1493
+ color = 'rgba(' + rColor + ', ' + gColor + ', ' + bColor + ', 0.3)';
1494
+ //put together shadow setting
1495
+ effect.calculated += xDist.toFixed(2) + 'px ' + yDist.toFixed(2) + 'px ' + ((i+1)*2) + 'px ' + color + ', ';
1496
+ }
1497
+ // filter
1498
+ effect.calculated = effect.calculated.replace(/, +$/,'');
1499
+ //apply text shadow
1500
+ self.updateTextShadowEffects(subject);
1501
+ };*/
1502
+ /*
1503
+ * Remove shadow effect
1504
+ *
1505
+ * @param {type} subject
1506
+ */
1507
+ self.removeShadowEffect = function (effectId) {
1508
+ // delete from shadow effects
1509
+ delete self.currentPreset.shadowEffects[effectId];
1510
+ // update shadow effects on given element
1511
+ self.updateTextShadowEffects(self.currentElement);
1512
+ };
1513
+ //update effects
1514
+ self.updateTextShadowEffects = function (subject) {
1515
+ var allShadows = '';
1516
+ // go through all currently applied
1517
+ for (var i = 0; i < self.currentPreset.effects.length; i++) {
1518
+ var effect = self.currentPreset.effects[i];
1519
+ if (effect.calculated && effect.enabled) {
1520
+ if (allShadows) allShadows += ', ';
1521
+ allShadows += effect.calculated;
1522
+ }
1523
+ }
1524
+ //alert(allShadows);
1525
+ /*
1526
+ for(var ind in self.currentPreset.shadowEffects) {
1527
+ var shadowEffect = self.currentPreset.shadowEffects[ind];
1528
+ if(allShadows) allShadows += ', ';
1529
+ allShadows += shadowEffect;
1530
+ }*/
1531
+ if (allShadows === '') {
1532
+ allShadows = 'none';
1533
+ }
1534
+ //get all different text shadows
1535
+ //subject[0].style.textShadow = allShadows + ' !important';
1536
+ subject.each(function () {
1537
+ $(this).style('textShadow', allShadows, 'important');
1538
+ });
1539
+ self.updateCssSettings('text-shadow', allShadows);
1540
+ };
1541
+ /*
1542
+ *
1543
+ * PRESETS MANAGEMENT
1544
+ *
1545
+ */
1546
+ /*
1547
+ *
1548
+ * Create a new preset - selection
1549
+ *
1550
+ */
1551
+ self.createPreset = function (presetName, selector) {
1552
+ var property,
1553
+ newPreset,
1554
+ newPresetId;
1555
+ if (selector === undefined || !selector) {
1556
+ selector = 'PICK AN ELEMENT NOW - or type CSS selector(advanced)';
1557
+ }
1558
+ //get first preset as a template
1559
+ newPreset = {};
1560
+ //set preset variables
1561
+ newPreset.name = presetName;
1562
+ newPreset.selector = selector;
1563
+ newPreset.fontid = '';
1564
+ newPreset.fontName = '';
1565
+ newPreset.effects = [];
1566
+ // !!! when styles are array they are not visible for PHP?
1567
+ newPreset.styles = {};
1568
+ //reset css styles
1569
+ for (property in newPreset.styles) {
1570
+ newPreset.styles[property] = '';
1571
+ }
1572
+ //push the preset at the end
1573
+ newPresetId = self.options.presets.push(newPreset) - 1;
1574
+ //add preset to the dropdown and select it
1575
+ self.$presetsDropdown.append('<option value="' + newPresetId + '">' + presetName + '</option>');
1576
+ //get preset id and load it
1577
+ self.loadPreset(newPresetId);
1578
+ };
1579
+ //add new preset
1580
+ self.renamePreset = function () {
1581
+ //current preset option
1582
+ var currPresetOption = self.$presetsDropdown.find('option[value=' + self.currentPresetNo + ']'),
1583
+ presetName = prompt('New preset name i.e. paragraph', currPresetOption.text()),
1584
+ property;
1585
+ if (!presetName) {
1586
+ return;
1587
+ }
1588
+ self.$presetsDropdown.find('option[value=' + self.currentPresetNo + ']').text(presetName);
1589
+ self.currentPreset.name = presetName;
1590
+ };
1591
+ //delete preset
1592
+ self.deletePreset = function (presetNo) {
1593
+ if (!confirm("Are you sure you want to delete this preset?")) {
1594
+ return false;
1595
+ }
1596
+ if (self.options.presets.length === 1) {
1597
+ alert('At least one preset has to be present');
1598
+ return;
1599
+ }
1600
+ self.unhighlightCurrent();
1601
+ self.options.presets.splice(presetNo, 1);
1602
+ self.$presetsDropdown.find('option[value=' + presetNo + ']').remove();
1603
+ // delete all presets
1604
+ self.$presetsDropdown.html('');
1605
+ // recreate presets menu to number values from 0
1606
+ for (var i = 0; i < self.options.presets.length; i += 1) {
1607
+ var preset = self.options.presets[i],
1608
+ presetName = self.options.presets[i].name,
1609
+ presetId = i;
1610
+ // unwire all outlined elements
1611
+ if (preset.selector.indexOf('ELEMENT NOW') === -1 && preset.selector.indexOf('PICK ELEMENT') === -1) {
1612
+ $(preset.selector).data('wired', false);
1613
+ }
1614
+ self.$presetsDropdown.append('<option value="' + presetId + '">' + presetName + '</option>');
1615
+ }
1616
+ self.outlineAllPresets();
1617
+ self.loadPreset(0);
1618
+ alert('When resetting settings or deleting preset you have to save to see the change');
1619
+ };
1620
+ //delete current preset
1621
+ self.deleteCurrentPreset = function () {
1622
+ self.deletePreset(self.currentPresetNo);
1623
+ };
1624
+ /*
1625
+ * Reload currently loaded preset
1626
+ */
1627
+ self.reloadPreset = function () {
1628
+ self.loadPreset(self.currentPresetNo);
1629
+ };
1630
+ /*
1631
+ * load preset - load selection with all param values
1632
+ *
1633
+ * @param {type} presetNo
1634
+ * @returns {unresolved}
1635
+ */
1636
+ self.loadPreset = function (presetNo) {
1637
+ var preset = self.options.presets[parseInt(presetNo, 10)],
1638
+ property,
1639
+ found;
1640
+ if (!preset) {
1641
+ return;
1642
+ }
1643
+ if (self.mode === 'postPage') return;
1644
+ // if this is preset 0 hide appearance panel
1645
+ if (presetNo === 0) {
1646
+ self.$apr.hide();
1647
+ } else {
1648
+ self.$apr.show();
1649
+ }
1650
+ // if only one preset exists hide appearance panel
1651
+ if (self.options.presets.length == 1) {
1652
+ self.settingFields.presets.hide();
1653
+ self.$selectorPicker2.hide();
1654
+ } else {
1655
+ self.settingFields.presets.show();
1656
+ self.$selectorPicker2.show();
1657
+ }
1658
+ // unload effects
1659
+ self.unloadCurrentElementEffects();
1660
+ self.currentPresetNo = presetNo;
1661
+ self.currentPreset = preset;
1662
+ // if current selector is invalid current element is false
1663
+ if (self.currentPreset.selector.indexOf('ELEMENT NOW') !== -1 || self.currentPreset.selector.indexOf('PICK ELEMENT') !== -1) {
1664
+ self.currentElement = false;
1665
+ } else {
1666
+ // otherwise get current element
1667
+ self.currentElement = $(self.currentPreset.selector);
1668
+ }
1669
+ // add space for shadow effects
1670
+ self.currentPreset.shadowEffects = [];
1671
+ //select preset from dropdown
1672
+ self.$presetsDropdown.val(presetNo);
1673
+ /*
1674
+ populate general fields
1675
+ */
1676
+ for (property in preset) {
1677
+ found = $('body').find('input[title=' + property + ']');
1678
+ if (found.length) {
1679
+ found.val(preset[property]);
1680
+ found.trigger('change');
1681
+ }
1682
+ }
1683
+ /*
1684
+ populate css fields
1685
+ */
1686
+ for (property in preset.styles) {
1687
+ found = $('body').find('input[title=' + property + ']');
1688
+ if (found.length) {
1689
+ found.val(preset.styles[property]);
1690
+ found.trigger('change');
1691
+ }
1692
+ }
1693
+ self.highlightCurrent();
1694
+ //load effects
1695
+ self.loadEffectSettings();
1696
+ };
1697
+ /**
1698
+ *
1699
+ * FONTS BROWSER
1700
+ *
1701
+ */
1702
+ /*
1703
+ Create HTML markup
1704
+ */
1705
+ self.createFontPanel = function () {
1706
+ var i;
1707
+ //create html withing font browser
1708
+ self.$el.show();
1709
+ self.$el.append($('<h1 class="draggableModalBar">Fonts browser<a class="closeModal" href="#">x</a></h1>'));
1710
+ self.$el.append('<div class="tablinks"><a class="tablink" href="fontslist">Fontsforweb.com</a><a class="tablink" href="uploaded">Upload</a></div>');
1711
+ self.$el.append('<div class="tab" id="fontslist"></div>');
1712
+ self.$el.append('<div class="tab" id="uploaded"><div class="loading"></div></div>');
1713
+ self.$el.find('.tab').hide();
1714
+ self.$el.find('.tab').eq(0).show();
1715
+ self.$el.find('.tablink').on('click', function (e) {
1716
+ var target,
1717
+ tab;
1718
+ e.preventDefault();
1719
+ self.$el.find('.tab').hide();
1720
+ target = $(this).attr('href');
1721
+ tab = self.$el.find('#' + target).show();
1722
+ if (target === 'uploaded') {
1723
+ self.loadPrivateFonts();
1724
+ }
1725
+ return false;
1726
+ });
1727
+ self.$el.css('right', '0')
1728
+ .draggable({
1729
+ handle: self.$el.find('.draggableModalBar')
1730
+ });
1731
+ $('body').on('mousedown', '.draggableModal', function () {
1732
+ self.modalToTop(this);
1733
+ });
1734
+ self.$el.find('a.closeModal').on('click', function () {
1735
+ self.$el.fadeOut('slow');
1736
+ return false;
1737
+ });
1738
+ };
1739
+ /*
1740
+ * Show fonts browser
1741
+ */
1742
+ self.showFontsBrowser = function () {
1743
+ if (!this.fontInitialized) {
1744
+ self.createFontPanel();
1745
+ self.loadFontCategories();
1746
+ this.fontInitialized = true;
1747
+ } else {
1748
+ self.$el.fadeToggle();
1749
+ }
1750
+ self.modalToTop(self.$el);
1751
+ };
1752
+ /*
1753
+ * Init fonts browser carousel
1754
+ */
1755
+ self.initCarousel = function () {
1756
+ var carousel = self.$el.find('#FFW_browser_carousel').fcarousel({
1757
+ buttonNextHTML: '<a href="#" onclick="return false;"></a>',
1758
+ buttonPrevHTML: '<a href="#" onclick="return false;"></a>',
1759
+ animation: 1000,
1760
+ scroll: 2
1761
+ });
1762
+ };
1763
+ /*
1764
+ * Load font categories
1765
+ */
1766
+ self.loadFontCategories = function () {
1767
+ //make ajax request to get categories
1768
+ self.xhrPost({
1769
+ url: self.options.FFW_baseUrl + '/fontcategories/fontplugininit',
1770
+ data: {
1771
+ apikey: self.options.apikey,
1772
+ blogurl: fontBlogUrl,
1773
+ ver: self.version
1774
+ },
1775
+ format: 'html'
1776
+ },
1777
+ function (data) {
1778
+ //if empty answer display error
1779
+ if (!data || data === '') {
1780
+ self.$el.html('<h1>An error has occurde</h1><p>Please try again later</p>');
1781
+ }
1782
+ //hide loader
1783
+ self.$el.find('#loading').remove();
1784
+ //show fonts list
1785
+ self.$el.find('#fontslist').html(data);
1786
+ //bind close to close button
1787
+ self.$el.find('a.close_link').on('click', function () {
1788
+ self.$el.toggle();
1789
+ });
1790
+ //init carousel
1791
+ self.initCarousel();
1792
+ });
1793
+ };
1794
+ /*
1795
+ * bind onclick to links to reveal subcategories
1796
+ */
1797
+ self.bindShowCategoriesAction = function () {
1798
+ $('body').on('click', self.baseSelector + ' #categoriesList > ul li a.categoryChoose', function () {
1799
+ var categoryId = $(this).attr('name');
1800
+ //hide all subcategories of other parents
1801
+ self.$el.find('#subcategoriesList li').hide();
1802
+ self.$el.find('#subcategoriesList li.instructions').show();
1803
+ //show all subcategories of this parent
1804
+ self.$el.find('#subcategoriesList li#FFW_parentcategory_' + categoryId).show();
1805
+ self.$el.find('.fcarousel-next').click();
1806
+ return false;
1807
+ });
1808
+ };
1809
+ //bind onclick to reveal font of category
1810
+ self.bindShowFontsAction = function () {
1811
+ //bind onclick subcategories to load their fonts
1812
+ $('body').on('click', self.baseSelector + ' #subcategoriesList > ul li a.categoryChoose', function () {
1813
+ var categoryId = $(this).attr('name');
1814
+ self.xhrPost({
1815
+ url: self.options.FFW_baseUrl + '/fontcategories/wpfontsforwebcategoryfonts/catid/' + categoryId,
1816
+ data: {
1817
+ apikey: self.options.apikey,
1818
+ blogurl: fontBlogUrl
1819
+ },
1820
+ format: 'html'
1821
+ },
1822
+ function (data) {
1823
+ //if empty answer display error
1824
+ if (!data || data === '') {
1825
+ self.$el.html('<h1>An error has occurde</h1><p>Please reload page and try again later</p>');
1826
+ }
1827
+ //apply content to div
1828
+ self.$el.find('#fontList').html(data);
1829
+ //move carousel right
1830
+ self.$el.find('.fcarousel-next').click();
1831
+ });
1832
+ /*
1833
+ $.get(self.options.FFW_baseUrl + '/fontcategories/wpfontsforwebcategoryfonts/catid/' + categoryId, function (data) {
1834
+ //if empty answer display error
1835
+ if (!data || data === '') {
1836
+ self.$el.html('<h1>An error has occurde</h1><p>Please reload page and try again later</p>');
1837
+ }
1838
+ //apply content to div
1839
+ self.$el.find('#fontList').html(data);
1840
+ //move carousel right
1841
+ self.$el.find('.fcarousel-next').click();
1842
+ });*/
1843
+ return false;
1844
+ });
1845
+ //bind delete function
1846
+ $('body').on('click', self.baseSelector + ' #uploaded a.delete', function () {
1847
+ if (!confirm("Are you sure you want to delete this font?")) {
1848
+ return false;
1849
+ }
1850
+ var fontId = $(this).attr('name');
1851
+ self.xhrPost({
1852
+ url: self.options.FFW_baseUrl + '/api',
1853
+ data: {
1854
+ action: 'deletefont',
1855
+ apikey: self.options.apikey,
1856
+ blogurl: fontBlogUrl,
1857
+ fontid: fontId
1858
+ }
1859
+ }, function (data) {
1860
+ if (data.success === 'true') {
1861
+ self.loadPrivateFonts();
1862
+ } else {
1863
+ alert('Font deleting error.');
1864
+ $('.fontUploadForm').show();
1865
+ $('.fontUploading').hide();
1866
+ }
1867
+ });
1868
+ return false;
1869
+ });
1870
+ };
1871
+ /*
1872
+ * when clicked on font in fonts browser
1873
+ */
1874
+ self.setFontOnclick = function () {
1875
+ var selector;
1876
+ //bind onclick font change action to font images
1877
+ $('body').on('click', self.baseSelector + ' #fontList a.font_pick, ' + self.baseSelector + ' .fontsList a.font_pick', function () {
1878
+ var element,
1879
+ fontName = $(this).parent().attr('title'),
1880
+ selector,
1881
+ elements,
1882
+ head,
1883
+ linkElement;
1884
+ //PAGE POST version
1885
+ if (self.mode === 'postPage') { //it's single post editing page
1886
+ //set font to id from name attribute of a
1887
+ self.setTinyMCEFont($(this).attr('name'), fontName);
1888
+ return false;
1889
+ } else { //GENERAL VERSION
1890
+ //get selector
1891
+ selector = self.currentPreset.selector;
1892
+ //exit when default selector
1893
+ if (selector.indexOf('ELEMENT NOW') != -1 || selector.indexOf('PICK ELEMENT') != -1) {
1894
+ return;
1895
+ }
1896
+ //set form fields
1897
+ self.currentPreset.fontid = $(this).attr('name');
1898
+ self.currentPreset.fontName = fontName;
1899
+ //get target element from iframe or current page
1900
+ if ($("#header1preview").length) {
1901
+ element = $("#header1preview").contents().find();
1902
+ } else {
1903
+ element = $(document);
1904
+ }
1905
+ //set font family to a selector
1906
+ elements = element.find(selector);
1907
+ elements.each(function () {
1908
+ $(this).style("font-family", fontName, 'important');
1909
+ });
1910
+ head = element[0].getElementsByTagName('head')[0];
1911
+ linkElement = $(document.createElement('link'));
1912
+ //get and add stylesheet
1913
+ linkElement.attr({
1914
+ href: self.options.FFW_baseUrl + '/font/generatepreviewcss/?id=' + $(this).attr('name'),
1915
+ rel: 'stylesheet',
1916
+ type: 'text/css'
1917
+ });
1918
+ linkElement.appendTo(head);
1919
+ return false;
1920
+ }
1921
+ });
1922
+ };
1923
+ /*
1924
+ * Load uploaded fonts
1925
+ *
1926
+ */
1927
+ self.loadPrivateFonts = function () {
1928
+ var apikey = self.options.apikey || false;
1929
+ //load private fonts
1930
+ self.xhrPost({
1931
+ url: self.options.FFW_baseUrl + '/font/getuserfonts',
1932
+ data: {
1933
+ apikey: apikey,
1934
+ blogurl: fontBlogUrl,
1935
+ blogname: fontBlogName
1936
+ },
1937
+ format: 'html'
1938
+ }, function (data) {
1939
+ self.$el.find('#uploaded').html(data);
1940
+ });
1941
+ };
1942
+ /*
1943
+ * Initialize font upload form
1944
+ */
1945
+ self.initUploadForm = function () {
1946
+ $('body').on('submit', self.baseSelector + ' #fontUpload', function () {
1947
+ self.ajaxFontUpload.start();
1948
+ });
1949
+ };
1950
+ /*
1951
+ * Upload font using ajax
1952
+ *
1953
+ */
1954
+ self.ajaxFontUpload = (function () {
1955
+ return {
1956
+ start: function () {
1957
+ $('.fontUploadForm').hide();
1958
+ $('.fontUploading').show();
1959
+ $('#fontUploadIframe').load(function () {
1960
+ self.loadPrivateFonts();
1961
+ //get info about the upload
1962
+ /*$.getJSON(self.options.FFW_baseUrl + '/font/wpaddsummary', function (data) {
1963
+ if (data.success === 'true') {
1964
+ self.loadPrivateFonts();
1965
+ } else {
1966
+ alert('Font upload error. Check if file is not blocked against embedding.');
1967
+ $('.fontUploadForm').show();
1968
+ $('.fontUploading').hide();
1969
+ }
1970
+ });*/
1971
+ });
1972
+ }
1973
+ };
1974
+ }());
1975
+ /*
1976
+ *
1977
+ * ELEMENT SELECTION AND CSS RULE GENERATION
1978
+ *
1979
+ */
1980
+ /*
1981
+ * Enter element selection mode
1982
+ *
1983
+ * @param {type} add
1984
+ * @returns {unresolved}
1985
+ */
1986
+ self.bindGetSelector = function (add) {
1987
+ //get selector
1988
+ var selector = self.currentPreset.selector;
1989
+ //add cancel button
1990
+ if (!self.$cancelSelecting) {
1991
+ self.$cancelSelecting = $('<a href="#" class="cancelSelecting">Exit selecting mode</a>');
1992
+ $('body').append(self.$cancelSelecting);
1993
+ self.$cancelSelecting.data('cancelSelecting', true);
1994
+ //hide other elements
1995
+ self.$presets.hide();
1996
+ } else {
1997
+ self.$cancelSelecting.show();
1998
+ //hide other elements
1999
+ self.$presets.hide();
2000
+ }
2001
+ $('a, button').on('click.selectionMode', function (e) {
2002
+ e.preventDefault();
2003
+ self.handleSelectionClick($(this), add);
2004
+ return false;
2005
+ });
2006
+ $('body').on('click.selectionMode', '*', function (e) {
2007
+ e.preventDefault();
2008
+ self.handleSelectionClick($(this), add);
2009
+ return false;
2010
+ });
2011
+ $('body').on('mouseover', '*', function () {
2012
+ if ($(this).data('cancelSelecting')) {
2013
+ return;
2014
+ }
2015
+ self.hoverSelector = self.getSelector(this);
2016
+ self.hoverHighlightCurrent();
2017
+ $(this).css('outline', '3px dashed rgba(50,50,250,0.7)');
2018
+ (function () {
2019
+ var element = $(this);
2020
+ setTimeout(function () {
2021
+ element.css('outline', 'none');
2022
+ }, 100);
2023
+ }());
2024
+ return false;
2025
+ });
2026
+ $('body').on('mouseout', '*', function () {
2027
+ $(this).css('outline', 'none');
2028
+ return false;
2029
+ });
2030
+ };
2031
+ /*
2032
+ * Enter selection mode
2033
+ *
2034
+ */
2035
+ self.handleSelectionClick = function ($el, add) {
2036
+ //if this is cancel selecting button
2037
+ if ($el.hasClass('cancelSelecting')) {
2038
+ self.stopSelectionMode();
2039
+ self.reloadPreset();
2040
+ return;
2041
+ }
2042
+ //if the element's preset is already created just pick it up
2043
+ if ($el.data('wired')) {
2044
+ self.$cancelSelecting.css('outline', 'none');
2045
+ self.stopSelectionMode();
2046
+ self.loadPreset($el.data('presetNo'));
2047
+ return false;
2048
+ }
2049
+ var sel = self.getSelector($el[0]),
2050
+ selectorInput,
2051
+ comma;
2052
+ //return false;
2053
+ //if not add to current preset mode
2054
+ if (!add) {
2055
+ self.stopSelectionMode();
2056
+ var val = prompt('Name the selection i.e. title, header or paragraph. It\'ll be now listed in the upper left corner.');
2057
+ //if not ask for new selection name
2058
+ if (!val) {
2059
+ self.bindGetSelector(add);
2060
+ return false;
2061
+ } else {
2062
+ //create a new preset of given selector
2063
+ self.createPreset(val, sel);
2064
+ }
2065
+ }
2066
+ self.outlineAllPresets();
2067
+ selectorInput = self.getField('selector');
2068
+ if (add) {
2069
+ comma = selectorInput.val() ? ', ' : '';
2070
+ selectorInput.val(selectorInput.val() + comma + sel);
2071
+ } else {
2072
+ selectorInput.val(sel);
2073
+ }
2074
+ selectorInput.trigger('change');
2075
+ self.stopSelectionMode();
2076
+ self.highlightCurrent();
2077
+ //load preset again to apply changes to a new element
2078
+ if (add) {
2079
+ self.reloadPreset();
2080
+ }
2081
+ };
2082
+ /*
2083
+ * Exit element selection mode
2084
+ *
2085
+ * @param {type} htmlcol
2086
+ * @returns {rgb}
2087
+ */
2088
+ self.stopSelectionMode = function () {
2089
+ $('body').off('mouseover', '*');
2090
+ $('body').off('click.selectionMode', '*');
2091
+ $('a').off('.selectionMode');
2092
+ $('button').off('.selectionMode');
2093
+ $(this).css('outline', 'none');
2094
+ $('body').off('mouseout', '*');
2095
+ self.$cancelSelecting.hide();
2096
+ //hide other elements
2097
+ self.$presets.show();
2098
+ };
2099
+ /*
2100
+ * Generate CSS selector for passed element
2101
+ *
2102
+ * @param {type} element
2103
+ * @returns {selector}
2104
+ */
2105
+ self.getSelector = function (element) {
2106
+ var selector = $(element).parents()
2107
+ .map(function () {
2108
+ return this.tagName;
2109
+ })
2110
+ .get().reverse().join(" "),
2111
+ id,
2112
+ classNames,
2113
+ selectorsArr,
2114
+ sel,
2115
+ parents = [],
2116
+ selectors = [];
2117
+ //go through each mapped object and get id class etc
2118
+ for (var i = 0;
2119
+ (i < $(element).parents().length && i < 4); i++) {
2120
+ var $parent = $(element).parents().eq(i),
2121
+ parentSelector = $parent[0].nodeName;
2122
+ //classses only for first 3 parents(now it's reversed)
2123
+ if (i < 2) {
2124
+ //get id
2125
+ //if(id = $parent.attr('id')) {
2126
+ // parentSelector += '#' + id;
2127
+ //}
2128
+ //class names
2129
+ classNames = $parent.attr("class");
2130
+ if (classNames) {
2131
+ parentSelector += "." + $.trim(classNames).replace(/\s/gi, ".");
2132
+ }
2133
+ }
2134
+ selectors.push(parentSelector);
2135
+ }
2136
+ selector = selectors.reverse().join(' ');
2137
+ //get element tagname
2138
+ if (selector) {
2139
+ selector += " " + $(element)[0].nodeName;
2140
+ }
2141
+ id = $(element).attr("id");
2142
+ if (id) {
2143
+ selector += "#" + id;
2144
+ }
2145
+ classNames = $(element).attr("class");
2146
+ if (classNames) {
2147
+ selector += "." + $.trim(classNames).replace(/\s/gi, ".");
2148
+ // remove ui-draggable when re-selecting element with once removed draggability
2149
+ //ui-draggable
2150
+ }
2151
+ return selector;
2152
+ };
2153
+ /*
2154
+ * Scroll to selected element
2155
+ *
2156
+ * @returns {unresolved}
2157
+ */
2158
+ self.scrollToSelection = function () {
2159
+ var selector = self.currentPreset.selector,
2160
+ container,
2161
+ found;
2162
+ container = $('body');
2163
+ //exit when default selector
2164
+ if (selector.indexOf('ELEMENT NOW') !== -1 || selector.indexOf('PICK ELEMENT') !== -1) {
2165
+ return;
2166
+ }
2167
+ //get by selector from the iframe
2168
+ found = container.find(selector);
2169
+ //scroll to the top when no el selected
2170
+ if (!found.length) {
2171
+ return;
2172
+ }
2173
+ //animate scroll
2174
+ $('html, body').animate({
2175
+ scrollTop: (parseInt(found.offset().top, 10) - 150)
2176
+ }, 'slow');
2177
+ };
2178
+ /*
2179
+ * Highlight current element on hover
2180
+ */
2181
+ self.hoverHighlightCurrent = function () {
2182
+ var selector = self.hoverSelector;
2183
+ if (self.tempHightlighted) {
2184
+ self.tempHightlighted.css('outline', 'none');
2185
+ }
2186
+ //exit when default selector
2187
+ if (selector.indexOf('ELEMENT NOW') !== -1 || selector.indexOf('PICK ELEMENT') !== -1) {
2188
+ return;
2189
+ }
2190
+ self.tempHightlighted = $(selector);
2191
+ self.tempHightlighted.css('outline', '3px dashed rgba(100,250,100,0.7)');
2192
+ };
2193
+ /*
2194
+ * highlight all elements(with edititng option)
2195
+ */
2196
+ self.outlineAllPresets = function () {
2197
+ //go through all presets
2198
+ for (var i = 0; i < self.options.presets.length; i++) {
2199
+ if (parseInt(i, 10) === parseInt(self.currentPresetNo, 10)) continue;
2200
+ var preset = self.options.presets[i];
2201
+ var selector = preset.selector;
2202
+ //exit when default selector
2203
+ if (selector.indexOf('ELEMENT NOW') != -1 || selector.indexOf('PICK ELEMENT') != -1) {
2204
+ continue;
2205
+ }
2206
+ var litme = $(selector);
2207
+ litme.css('outline', '2px dashed rgba(150,150,250,0.3)');
2208
+ litme.css("cursor", 'pointer', 'important');
2209
+ if (litme.data('wired') === true) {
2210
+ continue;
2211
+ }
2212
+ litme.data('wired', true);
2213
+ (function () {
2214
+ var ind = i;
2215
+ litme.data('presetNo', ind);
2216
+ litme.click(function (e) {
2217
+ // onbeoforeunload helps here
2218
+ //e.preventDefault();
2219
+ if (parseInt($(this).data('presetNo'), 10) !== parseInt(self.currentPresetNo, 10)) {
2220
+ e.preventDefault();
2221
+ self.loadPreset(ind);
2222
+ }
2223
+ });
2224
+ litme.hover(
2225
+ function () {
2226
+ if (parseInt($(this).data('presetNo'), 10) !== parseInt(self.currentPresetNo, 10)) {
2227
+ $(this).css('outline', '2px dashed rgba(150,150,250,0.9)');
2228
+ }
2229
+ },
2230
+ function () {
2231
+ if (parseInt($(this).data('presetNo'), 10) !== parseInt(self.currentPresetNo, 10)) {
2232
+ $(this).css('outline', '2px dashed rgba(150,150,250,0.3)');
2233
+ }
2234
+ }
2235
+ );
2236
+ }());
2237
+ }
2238
+ };
2239
+ /*
2240
+ * highlight current
2241
+ * @returns {unresolved}
2242
+ */
2243
+ self.highlightCurrent = function () {
2244
+ var selector = self.currentPreset.selector;
2245
+ self.outlineAllPresets();
2246
+ //exit when default selector
2247
+ if (selector.indexOf('ELEMENT NOW') != -1 || selector.indexOf('PICK ELEMENT') != -1) {
2248
+ return;
2249
+ }
2250
+ self.hightlighted = $(selector);
2251
+ self.hightlighted.css('outline', '3px dashed rgba(250,50,30,0.7)');
2252
+ self.hightlighted.style("cursor", 'move', 'important');
2253
+ self.makeCurrentDraggable();
2254
+ };
2255
+ /*
2256
+ * Removes highlighting from current element
2257
+ *
2258
+ * @returns {unresolved}
2259
+ */
2260
+ self.unhighlightCurrent = function () {
2261
+ var selector = self.currentPreset.selector;
2262
+ self.outlineAllPresets();
2263
+ //exit when default selector
2264
+ if (selector.indexOf('ELEMENT NOW') != -1 || selector.indexOf('PICK ELEMENT') != -1) {
2265
+ return;
2266
+ }
2267
+ self.hightlighted = $(selector);
2268
+ self.hightlighted.css('outline', 'none');
2269
+ self.hightlighted.style("cursor", '');
2270
+ //self.removeCurrentDraggable();
2271
+ // remove draggable
2272
+ self.hightlighted.draggable("destroy");
2273
+ };
2274
+ /*
2275
+ * make current element draggable
2276
+ */
2277
+ self.makeCurrentDraggable = function () {
2278
+ var isMozilla = $.browser && $.browser.mozilla;
2279
+ self.hightlighted.draggable({
2280
+ drag: function (event, ui) {
2281
+ var top = ui.position.top,
2282
+ left = ui.position.left,
2283
+ $el = self.hightlighted;
2284
+ $el.each(function () {
2285
+ //set position to relative
2286
+ $(this).style("position", 'relative', 'important');
2287
+ //hide before styles are applied
2288
+ $(this).style("visibility", 'hidden', 'important');
2289
+ //set slider y to dragged value (parseInt(top,10) + parseInt($(window).scrollTop(),10))
2290
+ //for firefox only
2291
+ if (isMozilla) {
2292
+ self.updateCssSettings('top', (parseInt(top, 10) + parseInt($(window).scrollTop(), 10)) + 'px');
2293
+ } else {
2294
+ self.updateCssSettings('top', top + 'px');
2295
+ }
2296
+ //set slider x to dragged value
2297
+ self.updateCssSettings('left', left + 'px');
2298
+ //set position to relative
2299
+ self.updateCssSettings('position', 'relative');
2300
+ });
2301
+ //waiting to set top and left to "!important" after jquery ui draggable
2302
+ setTimeout(function () {
2303
+ $el.each(function () {
2304
+ $(this).style("visibility", 'visible', 'important');
2305
+ //set slider y to dragged value
2306
+ //for firefox only
2307
+ if (isMozilla) {
2308
+ $(this).style("top", (parseInt(top, 10) + parseInt($(window).scrollTop(), 10)) + 'px', 'important');
2309
+ } else {
2310
+ $(this).style("top", top + 'px', 'important');
2311
+ }
2312
+ //set slider x to dragged value
2313
+ $(this).style("left", left + 'px', 'important');
2314
+ });
2315
+ }, 30);
2316
+ }
2317
+ });
2318
+ };
2319
+ /**
2320
+ *
2321
+ * COLOR CONVERSION FUNCTIONS
2322
+ *
2323
+ */
2324
+ /*
2325
+ * Convert from HEX/HTML to rgb object
2326
+ *
2327
+ * @param {type} htmlcol
2328
+ * @returns {rgb}
2329
+ */
2330
+ self.html2rgb = function (htmlcol) {
2331
+ var rgb = new Object();
2332
+ rgb.r = self.html2dec(htmlcol.substr(0, 2));
2333
+ rgb.g = self.html2dec(htmlcol.substr(2, 2));
2334
+ rgb.b = self.html2dec(htmlcol.substr(4, 2));
2335
+ return rgb;
2336
+ };
2337
+ /*
2338
+ * Parse RGB to HTML to
2339
+ * @param {type} rgbString
2340
+ * @returns {@exp;self@call;html2rgb}
2341
+ */
2342
+ self.parseRgb = function (rgbString) {
2343
+ return self.html2rgb(self.rgbString2hex(rgbString));
2344
+ };
2345
+ self.rgbString2hex = function (rgbString) {
2346
+ var parts = rgbString.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
2347
+ // parts now should be ["rgb(0, 70, 255", "0", "70", "255"]
2348
+ if (!parts) return '000000';
2349
+ delete(parts[0]);
2350
+ for (var i = 1; i <= 3; ++i) {
2351
+ parts[i] = parseInt(parts[i]).toString(16);
2352
+ if (parts[i].length == 1) parts[i] = '0' + parts[i];
2353
+ }
2354
+ var hexString = parts.join('');
2355
+ return hexString;
2356
+ };
2357
+ /*
2358
+ * Converts color from HEX/HTML-style (00-FF) to decimal color value (0-255)
2359
+ */
2360
+ self.html2dec = function (h) {
2361
+ return parseInt(h, 16);
2362
+ };
2363
+ /*
2364
+ *
2365
+ * MODAL WINDOWS AND OVERLAYS
2366
+ *
2367
+ */
2368
+ /*
2369
+ * Create new modal window
2370
+ */
2371
+ self.createNewModal = function (options) {
2372
+ var modal = $('<div class="draggableModal"><h1 class="draggableModalBar">' + options.title + '<a class="closeModal" href="#">x</a></h1></div>');
2373
+ modal.css({
2374
+ left: options.left,
2375
+ top: options.top,
2376
+ width: options.width,
2377
+ position: 'fixed',
2378
+ zIndex: 100000
2379
+ });
2380
+ if (options.nobar) {
2381
+ modal.find('h1.draggableModalBar').hide();
2382
+ }
2383
+ if (!options.show) {
2384
+ modal.hide();
2385
+ }
2386
+ if (options.id) {
2387
+ modal.attr('id', options.id);
2388
+ }
2389
+ self.modals[options.name] = modal;
2390
+
2391
+ //make draggable
2392
+ modal.draggable({
2393
+ handle: modal.find('.draggableModalBar'),
2394
+ start: function () {
2395
+ $(this).css('bottom', 'auto');
2396
+ }
2397
+ });
2398
+
2399
+ modal.find('.closeModal').click(function () {
2400
+ modal.fadeOut('slow');
2401
+ return;
2402
+ });
2403
+ modal.appendTo($('body'));
2404
+ //self.modalToTop(modal);
2405
+ return modal;
2406
+ };
2407
+ /*
2408
+ * create a popup with content for overlay links
2409
+ *
2410
+ * @returns {unresolved}
2411
+ */
2412
+ self.bindLinkOverlay = function () {
2413
+ $('body').on('click', 'a.font_url, a.overlay_url, button.overlay_url', function () {
2414
+ var modal,
2415
+ frameSrc,
2416
+ iframe,
2417
+ overlay,
2418
+ href = $(this).attr('href');
2419
+ if ($(this).attr('data-upgrade') === 'true') {
2420
+ self.setupApikeyCheckingInterval();
2421
+ }
2422
+ //create overlay
2423
+ overlay = $('<div id="memberOverlay"></div>');
2424
+ overlay.appendTo(document.body);
2425
+ overlay.css({
2426
+ position: 'fixed',
2427
+ top: 0,
2428
+ left: 0,
2429
+ width: '100%',
2430
+ height: '100%',
2431
+ 'background-color': '#333',
2432
+ filter: 'alpha(opacity=50)',
2433
+ '-moz-opacity': 0.5,
2434
+ '-khtml-opacity': 0.5,
2435
+ opacity: 0.5,
2436
+ 'z-index': 200000
2437
+ });
2438
+ modal = $('<div class="draggableModal ui-draggable"><h1 class="draggableModalBar">' + href + ' <a class="closeModal" href="#">x</a></h1></div>');
2439
+ modal.css({
2440
+ position: 'fixed',
2441
+ left: '-475px',
2442
+ marginLeft: '50%',
2443
+ width: '950px',
2444
+ top: '40px',
2445
+ zIndex: 200001
2446
+ });
2447
+ modal.find('.closeModal').bind('mousedown', function () {
2448
+ modal.remove();
2449
+ overlay.remove();
2450
+ return;
2451
+ });
2452
+ frameSrc = href;
2453
+ iframe = $('<iframe style="width:98%; height:490px; border:none; margin: 10px 1%" frameBorder="0" src="' + frameSrc + '"></iframe>');
2454
+ iframe.appendTo(modal);
2455
+ modal.appendTo($('body')).hide().fadeIn('slow');
2456
+ overlay.click(function () {
2457
+ modal.remove();
2458
+ $(this).remove();
2459
+ });
2460
+ return false;
2461
+ });
2462
+ return;
2463
+ };
2464
+ /*
2465
+ * adapt plugin looks to different modes - global or post page
2466
+ */
2467
+ self.adaptOptionsToMode = function () {
2468
+ if (self.mode === 'postPage') {
2469
+ self.settingFields.presets.hide();
2470
+ self.$presets.hide();
2471
+ self.$apr.show();
2472
+ self.settingFields.selector.hide();
2473
+ $('#fontSaveSettings').hide();
2474
+ $('#effectsButton').hide();
2475
+ }
2476
+ };
2477
+ /*
2478
+ * Show hide modal
2479
+ *
2480
+ * @param {type} modalName
2481
+ */
2482
+ self.toggleModal = function (modalName) {
2483
+ if (self.modals[modalName] === undefined) {
2484
+ return;
2485
+ }
2486
+ // if this is effects button
2487
+ if (modalName === 'effects') {
2488
+ // detect CSS text-shadow support in JavaScript
2489
+ if (document.createElement("detect").style.textShadow !== "") {
2490
+ alert('Sorry, but your browser does not support advanced effects. Please upgrade to Chrome, Firefox or Internet Explorer 10');
2491
+ return;
2492
+ }
2493
+ }
2494
+ self.modals[modalName].fadeToggle();
2495
+ self.modalToTop(self.modals[modalName]);
2496
+ };
2497
+ /*
2498
+ * Put modal on top
2499
+ *
2500
+ * @param {type} selectedModal
2501
+ */
2502
+ self.modalToTop = function (selectedModal) {
2503
+ var highestZindex = 10000;
2504
+ for (var index in self.modals) {
2505
+ var modal = self.modals[index],
2506
+ modalZindex = modal.css('zIndex');
2507
+ if (parseInt(modalZindex, 10) > parseInt(highestZindex, 10)) {
2508
+ highestZindex = modalZindex;
2509
+ }
2510
+ }
2511
+ $(selectedModal).css({
2512
+ 'zIndex': parseInt(highestZindex, 10) + 1
2513
+ });
2514
+ };
2515
+ /*
2516
+ *
2517
+ * TINY MCE EDITOR
2518
+ *
2519
+ */
2520
+ /*
2521
+ * set font for post or page in tinymce
2522
+ */
2523
+ self.setTinyMCEFont = function (fontId, fontName) {
2524
+ //get selection
2525
+ var selection = tinyMCE.activeEditor.selection.getContent(),
2526
+ selectorValid,
2527
+ $selectorContents,
2528
+ fontClass,
2529
+ node,
2530
+ newSpan,
2531
+ newHTML,
2532
+ inserted,
2533
+ $tempDiv,
2534
+ multipleSelectors;
2535
+ //only apply if something is selected
2536
+ if (!selection) {
2537
+ return;
2538
+ }
2539
+ //get node
2540
+ fontClass = "fontplugin_fontid_" + fontId + "_" + fontName;
2541
+ node = tinyMCE.activeEditor.selection.getNode();
2542
+ //selectorValid - validate selector created from selected text.
2543
+ //required because for example "." with nothing following breaks function execution
2544
+ selectorValid = true;
2545
+ try {
2546
+ $selectorContents = $(selection);
2547
+ } catch (e) {
2548
+ selectorValid = false;
2549
+ }
2550
+ if(selectorValid && $selectorContents.length > 1) {
2551
+ selectorValid = false;
2552
+ multipleSelectors = true;
2553
+ }
2554
+ if (selectorValid && ($.trim($(node).html()) === $.trim(selection) || $.trim($(node).html()) === $.trim($(selection).html()))) {
2555
+ //console.log('already isolated');
2556
+ tinyMCE.activeEditor.dom.setAttrib(node, 'class', fontClass);
2557
+ } else if (multipleSelectors) {
2558
+ $selectorContents.each(function () {
2559
+ $(this).removePrefixedClasses('fontplugin_fontid_');
2560
+ $(this).addClass(fontClass);
2561
+
2562
+ $(this).attr('class').split(' ');
2563
+ });
2564
+ $tempDiv = $('<div>').append($selectorContents);
2565
+ newHTML = $tempDiv.html();
2566
+
2567
+ inserted = tinyMCE.activeEditor.selection.setContent(newHTML);
2568
+ } else {
2569
+ newSpan = $("<span class=\"" + fontClass + "\">" + selection + '</span>');
2570
+ //get span html together with span itself
2571
+ newHTML = $('<div>').append(newSpan.clone()).html();
2572
+ //add font in use
2573
+ inserted = tinyMCE.activeEditor.selection.setContent(newHTML);
2574
+ tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('span.' + fontClass)[0]);
2575
+ }
2576
+ //loads font face to iframe editor
2577
+ self.loadFontFace(fontId);
2578
+ };
2579
+ /*
2580
+ * Load font to tinymce iframe
2581
+ */
2582
+ self.loadFontFace = function (fontId) {
2583
+ var head = self.postIframe[0].getElementsByTagName('head')[0],
2584
+ linkElement = $(document.createElement('link'));
2585
+ linkElement.attr({
2586
+ href: self.options.FFW_baseUrl + '/font/generatepreviewcss/?id=' + fontId,
2587
+ rel: 'stylesheet',
2588
+ type: 'text/css'
2589
+ });
2590
+ linkElement.appendTo(head);
2591
+ };
2592
+ /*
2593
+ *
2594
+ * UTILITY FUNCTIONS
2595
+ *
2596
+ */
2597
+ /*
2598
+ * execute cross domain request, JSON response
2599
+ *
2600
+ * @param {type} params
2601
+ * @param {type} callback
2602
+ * @returns {@exp;$@call;post}
2603
+ */
2604
+ self.xhrPost = function (params, callback) {
2605
+ var data = params;
2606
+ if (params.format === undefined) {
2607
+ params.format = 'json';
2608
+ }
2609
+ data.action = 'cross_domain_request';
2610
+
2611
+ return $.ajax({
2612
+ type: "POST",
2613
+ url: ajaxproxy,
2614
+ data: data,
2615
+ success: function (response) {
2616
+ if (typeof callback === 'function') {
2617
+ callback(response);
2618
+ }
2619
+ },
2620
+ dataType: params.format,
2621
+ error: function (xhr, textStatus, errorThrown) {
2622
+ alert("An error occurde. This might be a conflict with another plugin. Error message: " + textStatus);
2623
+ }
2624
+ });
2625
+ };
2626
+ /*
2627
+ * show loading spinner
2628
+ */
2629
+ self.showLoading = function () {
2630
+ if ($('.fontLoading').length) {
2631
+ //self.$apr.find('fieldset').hide();
2632
+ //self.$el.find('> div').hide();
2633
+ $('.fontLoading').show();
2634
+ $('.fontLoading').show();
2635
+ } else {
2636
+ $('body').append('<div class="fontLoading"></div>');
2637
+ }
2638
+ };
2639
+ /*
2640
+ * hide loading spinner
2641
+ */
2642
+ self.hideLoading = function () {
2643
+ $('.fontLoading').hide();
2644
+ $('.fontLoading').hide();
2645
+ };
2646
+ /*
2647
+ * detect if we're on post editing page or on any other page
2648
+ */
2649
+ self.detectMode = function () {
2650
+ var iframe = $('#content_ifr');
2651
+ if (iframe.length) {
2652
+ self.mode = 'postPage';
2653
+ self.postIframe = iframe.contents();
2654
+ //self.tinyMCE = $(self.postIframe).find('#tinymce');
2655
+ } else {
2656
+ self.mode = 'global';
2657
+ }
2658
+ // detect CSS text-shadow support in JavaScript
2659
+ if (document.createElement("detect").style.textShadow === "") {
2660
+ self.shadowSupport = true;
2661
+ } else {
2662
+ self.shadowSupport = false;
2663
+ }
2664
+ };
2665
+ /*
2666
+ * API FUNCTIONS
2667
+ */
2668
+ /*
2669
+ * check if api key is present in the database
2670
+ */
2671
+ self.checkForApikey = function () {
2672
+ self.xhrPost({
2673
+ url: self.options.FFW_baseUrl + '/api/getkey',
2674
+ data: {
2675
+ blogurl: fontBlogUrl,
2676
+ apikey: self.options.apikey,
2677
+ version: self.version
2678
+ }
2679
+ }, function (data) {
2680
+ if (!data || data.success !== 'true') {
2681
+ if (console !== undefined) console.log(data.message);
2682
+ //alert(data.message);
2683
+ alert('An error has occured and the plugin is not working. If you\'re working on local server, make sure \n\
2684
+ that your computer has an internet connection.');
2685
+ } else {
2686
+ self.loadEffects(data.effects);
2687
+ if (data.extended.length) {
2688
+ self.loadExtendedFields(data.extended);
2689
+ $('#upgradeToProButton').remove();
2690
+ $('#extrafieldsSettings').show();
2691
+ clearInterval(self.checkForApikeyInterval);
2692
+ }
2693
+ self.options.apikey = data.apikey;
2694
+ }
2695
+ });
2696
+ };
2697
+ //setup api key interval
2698
+ self.setupApikeyCheckingInterval = function () {
2699
+ if (!self.checkForApikeyInterval) {
2700
+ self.checkForApikeyInterval = setInterval(function () {
2701
+ self.checkForApikey();
2702
+ }, 5000);
2703
+ }
2704
+ };
2705
+ // finally INIT
2706
+ self.init();
2707
+ };
2708
+ /*
2709
+ * set default options
2710
+ */
2711
+ $.fontPlugin.defaultOptions = {
2712
+ FFW_baseUrl: 'http://fontsforweb.com'
2713
+ };
2714
+ /*
2715
+ * make jquery plugin
2716
+ */
2717
+ $.fn.fontPlugin = function (options) {
2718
+ return this.each(function () {
2719
+ var fontPlugin = new $.fontPlugin(this, options);
2720
+ });
2721
+ };
2722
+ /*
2723
+ * HANDLE PLUGIN
2724
+ *
2725
+ * options
2726
+ * startX -vstarting position
2727
+ * startY -vstarting position
2728
+ * name - handle name
2729
+ * label - visible label
2730
+ *
2731
+ *
2732
+ */
2733
+ var XYSlider = function (el, options) {
2734
+ var self = this;
2735
+ self.$el = $(el);
2736
+ self.$el.data('XYSlider', self);
2737
+ // immediate init funciton
2738
+ self.init = function () {
2739
+ // get handle element by name
2740
+ var handleHolder = self.$el.data(options.settingName),
2741
+ handle = (handleHolder && handleHolder[0]) ? handleHolder.find('.XYSlider') : false;
2742
+ // if doesn't exist create the handle
2743
+ if (!handleHolder || !handleHolder[0]) {
2744
+ handleHolder = $('<div class="XYSliderHolder"></div>');
2745
+ handle = $('<div class="XYSlider">' + options.label + '</div>');
2746
+ handleHolder.append(handle);
2747
+ self.$el.append(handleHolder);
2748
+ }
2749
+ self.$el.data(options.settingName, handleHolder);
2750
+ // save in object
2751
+ self.$handleHolder = handleHolder;
2752
+ self.$handle = handle;
2753
+ // make handle draggable
2754
+ handle.each(function () {
2755
+ // show handle
2756
+ $(this).parent().show();
2757
+ // make draggable
2758
+ $(this).draggable({
2759
+ drag: function (event, ui) {
2760
+ var top = ui.position.top,
2761
+ left = ui.position.left,
2762
+ // revert top: more is higher
2763
+ y = -top,
2764
+ x = left;
2765
+ self.commitDrag(x, y, true);
2766
+ }
2767
+ });
2768
+ });
2769
+ };
2770
+ /*
2771
+ * Change position of draggable
2772
+ *
2773
+ * x - x position
2774
+ * y - y position
2775
+ */
2776
+ self.setPosition = function (x, y) {
2777
+ var handle = self.$handle;
2778
+ if (x !== false) {
2779
+ self.x = x;
2780
+ } else if (self.x === undefined) {
2781
+ x = 0;
2782
+ self.x = 0;
2783
+ } else {
2784
+ x = self.x;
2785
+ }
2786
+ if (y !== false) {
2787
+ y = y;
2788
+ self.y = y;
2789
+ } else if (self.y === undefined) {
2790
+ y = 0;
2791
+ self.y = 0;
2792
+ } else {
2793
+ y = self.y;
2794
+ }
2795
+ if (x === false && y === false) {
2796
+ return;
2797
+ }
2798
+ // move x and y - revert top: more is higher
2799
+ handle.css({
2800
+ 'top': -y + 'px',
2801
+ 'left': x + 'px'
2802
+ });
2803
+ // commit drag
2804
+ self.commitDrag(x, y, true);
2805
+ };
2806
+ /*
2807
+ * Execute callbacks
2808
+ */
2809
+ self.commitDrag = function (x, y, stop) {
2810
+ var rad = Math.atan2(x, y),
2811
+ deg = rad * (180 / Math.PI),
2812
+ distance = 0;
2813
+ if (stop === undefined) {
2814
+ stop = false;
2815
+ }
2816
+ //get angle
2817
+ if (deg < 0) {
2818
+ deg = 360 + deg;
2819
+ }
2820
+ // round angle to full degrees
2821
+ deg = Math.round(deg);
2822
+ // calculate distance
2823
+ distance = Math.sqrt(x * x + y * y);
2824
+ // set current values
2825
+ self.setCurrentValues(x, y, deg, distance);
2826
+ // call actions
2827
+ options.actions.call(this, x, y, deg, distance);
2828
+ };
2829
+ self.setCurrentValues = function (x, y, deg, distance) {
2830
+ self.x = x;
2831
+ self.y = y;
2832
+ self.deg = deg;
2833
+ self.distance = distance;
2834
+ return self;
2835
+ };
2836
+ self.getCurrentValues = function () {
2837
+ return {
2838
+ 'x': self.x,
2839
+ 'y': self.y,
2840
+ 'deg': self.deg,
2841
+ 'distance': self.distance
2842
+ };
2843
+ };
2844
+ self.init();
2845
+ };
2846
+ // use prototype
2847
+ $.fn.XYSlider = function (options) {
2848
+ return this.each(function () {
2849
+ //new XYSlider(this, options);
2850
+ //var pluginName = 'XYSlider';
2851
+ new XYSlider(this, options);
2852
+ });
2853
+ };
2854
+ }(fQuery));
js/jquery.ui.slider.js ADDED
@@ -0,0 +1,603 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Slider 1.8.9
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Slider
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ * jquery.ui.mouse.js
13
+ * jquery.ui.widget.js
14
+ */
15
+ (function( $, undefined ) {
16
+ // number of pages in a slider
17
+ // (how many times can you page up/down to go through the whole range)
18
+ var numPages = 5;
19
+ $.widget( "ui.slider", $.ui.mouse, {
20
+ widgetEventPrefix: "slide",
21
+ options: {
22
+ animate: false,
23
+ distance: 0,
24
+ max: 100,
25
+ min: 0,
26
+ orientation: "horizontal",
27
+ range: false,
28
+ step: 1,
29
+ value: 0,
30
+ values: null
31
+ },
32
+ _create: function() {
33
+ var self = this,
34
+ o = this.options;
35
+ this._keySliding = false;
36
+ this._mouseSliding = false;
37
+ this._animateOff = true;
38
+ this._handleIndex = null;
39
+ this._detectOrientation();
40
+ this._mouseInit();
41
+ this.element
42
+ .addClass( "ui-slider" +
43
+ " ui-slider-" + this.orientation +
44
+ " ui-widget" +
45
+ " ui-widget-content" +
46
+ " ui-corner-all" );
47
+
48
+ if ( o.disabled ) {
49
+ this.element.addClass( "ui-slider-disabled ui-disabled" );
50
+ }
51
+ this.range = $([]);
52
+ if ( o.range ) {
53
+ if ( o.range === true ) {
54
+ this.range = $( "<div></div>" );
55
+ if ( !o.values ) {
56
+ o.values = [ this._valueMin(), this._valueMin() ];
57
+ }
58
+ if ( o.values.length && o.values.length !== 2 ) {
59
+ o.values = [ o.values[0], o.values[0] ];
60
+ }
61
+ } else {
62
+ this.range = $( "<div></div>" );
63
+ }
64
+ this.range
65
+ .appendTo( this.element )
66
+ .addClass( "ui-slider-range" );
67
+ if ( o.range === "min" || o.range === "max" ) {
68
+ this.range.addClass( "ui-slider-range-" + o.range );
69
+ }
70
+ // note: this isn't the most fittingly semantic framework class for this element,
71
+ // but worked best visually with a variety of themes
72
+ this.range.addClass( "ui-widget-header" );
73
+ }
74
+ if ( $( ".ui-slider-handle", this.element ).length === 0 ) {
75
+ $( "<a href='#'></a>" )
76
+ .appendTo( this.element )
77
+ .addClass( "ui-slider-handle" );
78
+ }
79
+ if ( o.values && o.values.length ) {
80
+ while ( $(".ui-slider-handle", this.element).length < o.values.length ) {
81
+ $( "<a href='#'></a>" )
82
+ .appendTo( this.element )
83
+ .addClass( "ui-slider-handle" );
84
+ }
85
+ }
86
+ this.handles = $( ".ui-slider-handle", this.element )
87
+ .addClass( "ui-state-default" +
88
+ " ui-corner-all" );
89
+ this.handle = this.handles.eq( 0 );
90
+ this.handles.add( this.range ).filter( "a" )
91
+ .click(function( event ) {
92
+ event.preventDefault();
93
+ })
94
+ .hover(function() {
95
+ if ( !o.disabled ) {
96
+ $( this ).addClass( "ui-state-hover" );
97
+ }
98
+ }, function() {
99
+ $( this ).removeClass( "ui-state-hover" );
100
+ })
101
+ .focus(function() {
102
+ if ( !o.disabled ) {
103
+ $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );
104
+ $( this ).addClass( "ui-state-focus" );
105
+ } else {
106
+ $( this ).blur();
107
+ }
108
+ })
109
+ .blur(function() {
110
+ $( this ).removeClass( "ui-state-focus" );
111
+ });
112
+ this.handles.each(function( i ) {
113
+ $( this ).data( "index.ui-slider-handle", i );
114
+ });
115
+ this.handles
116
+ .keydown(function( event ) {
117
+ var ret = true,
118
+ index = $( this ).data( "index.ui-slider-handle" ),
119
+ allowed,
120
+ curVal,
121
+ newVal,
122
+ step;
123
+
124
+ if ( self.options.disabled ) {
125
+ return;
126
+ }
127
+
128
+ switch ( event.keyCode ) {
129
+ case $.ui.keyCode.HOME:
130
+ case $.ui.keyCode.END:
131
+ case $.ui.keyCode.PAGE_UP:
132
+ case $.ui.keyCode.PAGE_DOWN:
133
+ case $.ui.keyCode.UP:
134
+ case $.ui.keyCode.RIGHT:
135
+ case $.ui.keyCode.DOWN:
136
+ case $.ui.keyCode.LEFT:
137
+ ret = false;
138
+ if ( !self._keySliding ) {
139
+ self._keySliding = true;
140
+ $( this ).addClass( "ui-state-active" );
141
+ allowed = self._start( event, index );
142
+ if ( allowed === false ) {
143
+ return;
144
+ }
145
+ }
146
+ break;
147
+ }
148
+
149
+ step = self.options.step;
150
+ if ( self.options.values && self.options.values.length ) {
151
+ curVal = newVal = self.values( index );
152
+ } else {
153
+ curVal = newVal = self.value();
154
+ }
155
+
156
+ switch ( event.keyCode ) {
157
+ case $.ui.keyCode.HOME:
158
+ newVal = self._valueMin();
159
+ break;
160
+ case $.ui.keyCode.END:
161
+ newVal = self._valueMax();
162
+ break;
163
+ case $.ui.keyCode.PAGE_UP:
164
+ newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
165
+ break;
166
+ case $.ui.keyCode.PAGE_DOWN:
167
+ newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
168
+ break;
169
+ case $.ui.keyCode.UP:
170
+ case $.ui.keyCode.RIGHT:
171
+ if ( curVal === self._valueMax() ) {
172
+ return;
173
+ }
174
+ newVal = self._trimAlignValue( curVal + step );
175
+ break;
176
+ case $.ui.keyCode.DOWN:
177
+ case $.ui.keyCode.LEFT:
178
+ if ( curVal === self._valueMin() ) {
179
+ return;
180
+ }
181
+ newVal = self._trimAlignValue( curVal - step );
182
+ break;
183
+ }
184
+
185
+ self._slide( event, index, newVal );
186
+
187
+ return ret;
188
+
189
+ })
190
+ .keyup(function( event ) {
191
+ var index = $( this ).data( "index.ui-slider-handle" );
192
+
193
+ if ( self._keySliding ) {
194
+ self._keySliding = false;
195
+ self._stop( event, index );
196
+ self._change( event, index );
197
+ $( this ).removeClass( "ui-state-active" );
198
+ }
199
+
200
+ });
201
+ this._refreshValue();
202
+ this._animateOff = false;
203
+ },
204
+ destroy: function() {
205
+ this.handles.remove();
206
+ this.range.remove();
207
+ this.element
208
+ .removeClass( "ui-slider" +
209
+ " ui-slider-horizontal" +
210
+ " ui-slider-vertical" +
211
+ " ui-slider-disabled" +
212
+ " ui-widget" +
213
+ " ui-widget-content" +
214
+ " ui-corner-all" )
215
+ .removeData( "slider" )
216
+ .unbind( ".slider" );
217
+ this._mouseDestroy();
218
+ return this;
219
+ },
220
+ _mouseCapture: function( event ) {
221
+ var o = this.options,
222
+ position,
223
+ normValue,
224
+ distance,
225
+ closestHandle,
226
+ self,
227
+ index,
228
+ allowed,
229
+ offset,
230
+ mouseOverHandle;
231
+ if ( o.disabled ) {
232
+ return false;
233
+ }
234
+ this.elementSize = {
235
+ width: this.element.outerWidth(),
236
+ height: this.element.outerHeight()
237
+ };
238
+ this.elementOffset = this.element.offset();
239
+ position = { x: event.pageX, y: event.pageY };
240
+ normValue = this._normValueFromMouse( position );
241
+ distance = this._valueMax() - this._valueMin() + 1;
242
+ self = this;
243
+ this.handles.each(function( i ) {
244
+ var thisDistance = Math.abs( normValue - self.values(i) );
245
+ if ( distance > thisDistance ) {
246
+ distance = thisDistance;
247
+ closestHandle = $( this );
248
+ index = i;
249
+ }
250
+ });
251
+ // workaround for bug #3736 (if both handles of a range are at 0,
252
+ // the first is always used as the one with least distance,
253
+ // and moving it is obviously prevented by preventing negative ranges)
254
+ if( o.range === true && this.values(1) === o.min ) {
255
+ index += 1;
256
+ closestHandle = $( this.handles[index] );
257
+ }
258
+ allowed = this._start( event, index );
259
+ if ( allowed === false ) {
260
+ return false;
261
+ }
262
+ this._mouseSliding = true;
263
+ self._handleIndex = index;
264
+ closestHandle
265
+ .addClass( "ui-state-active" )
266
+ .focus();
267
+
268
+ offset = closestHandle.offset();
269
+ mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
270
+ this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
271
+ left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
272
+ top: event.pageY - offset.top -
273
+ ( closestHandle.height() / 2 ) -
274
+ ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
275
+ ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
276
+ ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
277
+ };
278
+ if ( !this.handles.hasClass( "ui-state-hover" ) ) {
279
+ this._slide( event, index, normValue );
280
+ }
281
+ this._animateOff = true;
282
+ return true;
283
+ },
284
+ _mouseStart: function( event ) {
285
+ return true;
286
+ },
287
+ _mouseDrag: function( event ) {
288
+ var position = { x: event.pageX, y: event.pageY },
289
+ normValue = this._normValueFromMouse( position );
290
+
291
+ this._slide( event, this._handleIndex, normValue );
292
+ return false;
293
+ },
294
+ _mouseStop: function( event ) {
295
+ this.handles.removeClass( "ui-state-active" );
296
+ this._mouseSliding = false;
297
+ this._stop( event, this._handleIndex );
298
+ this._change( event, this._handleIndex );
299
+ this._handleIndex = null;
300
+ this._clickOffset = null;
301
+ this._animateOff = false;
302
+ return false;
303
+ },
304
+
305
+ _detectOrientation: function() {
306
+ this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
307
+ },
308
+ _normValueFromMouse: function( position ) {
309
+ var pixelTotal,
310
+ pixelMouse,
311
+ percentMouse,
312
+ valueTotal,
313
+ valueMouse;
314
+ if ( this.orientation === "horizontal" ) {
315
+ pixelTotal = this.elementSize.width;
316
+ pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
317
+ } else {
318
+ pixelTotal = this.elementSize.height;
319
+ pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
320
+ }
321
+ percentMouse = ( pixelMouse / pixelTotal );
322
+ if ( percentMouse > 1 ) {
323
+ percentMouse = 1;
324
+ }
325
+ if ( percentMouse < 0 ) {
326
+ percentMouse = 0;
327
+ }
328
+ if ( this.orientation === "vertical" ) {
329
+ percentMouse = 1 - percentMouse;
330
+ }
331
+ valueTotal = this._valueMax() - this._valueMin();
332
+ valueMouse = this._valueMin() + percentMouse * valueTotal;
333
+ return this._trimAlignValue( valueMouse );
334
+ },
335
+ _start: function( event, index ) {
336
+ var uiHash = {
337
+ handle: this.handles[ index ],
338
+ value: this.value()
339
+ };
340
+ if ( this.options.values && this.options.values.length ) {
341
+ uiHash.value = this.values( index );
342
+ uiHash.values = this.values();
343
+ }
344
+ return this._trigger( "start", event, uiHash );
345
+ },
346
+ _slide: function( event, index, newVal ) {
347
+ var otherVal,
348
+ newValues,
349
+ allowed;
350
+ if ( this.options.values && this.options.values.length ) {
351
+ otherVal = this.values( index ? 0 : 1 );
352
+ if ( ( this.options.values.length === 2 && this.options.range === true ) &&
353
+ ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
354
+ ) {
355
+ newVal = otherVal;
356
+ }
357
+ if ( newVal !== this.values( index ) ) {
358
+ newValues = this.values();
359
+ newValues[ index ] = newVal;
360
+ // A slide can be canceled by returning false from the slide callback
361
+ allowed = this._trigger( "slide", event, {
362
+ handle: this.handles[ index ],
363
+ value: newVal,
364
+ values: newValues
365
+ } );
366
+ otherVal = this.values( index ? 0 : 1 );
367
+ if ( allowed !== false ) {
368
+ this.values( index, newVal, true );
369
+ }
370
+ }
371
+ } else {
372
+ if ( newVal !== this.value() ) {
373
+ // A slide can be canceled by returning false from the slide callback
374
+ allowed = this._trigger( "slide", event, {
375
+ handle: this.handles[ index ],
376
+ value: newVal
377
+ } );
378
+ if ( allowed !== false ) {
379
+ this.value( newVal );
380
+ }
381
+ }
382
+ }
383
+ },
384
+ _stop: function( event, index ) {
385
+ var uiHash = {
386
+ handle: this.handles[ index ],
387
+ value: this.value()
388
+ };
389
+ if ( this.options.values && this.options.values.length ) {
390
+ uiHash.value = this.values( index );
391
+ uiHash.values = this.values();
392
+ }
393
+ this._trigger( "stop", event, uiHash );
394
+ },
395
+ _change: function( event, index ) {
396
+ if ( !this._keySliding && !this._mouseSliding ) {
397
+ var uiHash = {
398
+ handle: this.handles[ index ],
399
+ value: this.value()
400
+ };
401
+ if ( this.options.values && this.options.values.length ) {
402
+ uiHash.value = this.values( index );
403
+ uiHash.values = this.values();
404
+ }
405
+ this._trigger( "change", event, uiHash );
406
+ }
407
+ },
408
+ value: function( newValue ) {
409
+ if ( arguments.length ) {
410
+ this.options.value = this._trimAlignValue( newValue );
411
+ this._refreshValue();
412
+ this._change( null, 0 );
413
+ }
414
+ return this._value();
415
+ },
416
+ values: function( index, newValue ) {
417
+ var vals,
418
+ newValues,
419
+ i;
420
+ if ( arguments.length > 1 ) {
421
+ this.options.values[ index ] = this._trimAlignValue( newValue );
422
+ this._refreshValue();
423
+ this._change( null, index );
424
+ }
425
+ if ( arguments.length ) {
426
+ if ( $.isArray( arguments[ 0 ] ) ) {
427
+ vals = this.options.values;
428
+ newValues = arguments[ 0 ];
429
+ for ( i = 0; i < vals.length; i += 1 ) {
430
+ vals[ i ] = this._trimAlignValue( newValues[ i ] );
431
+ this._change( null, i );
432
+ }
433
+ this._refreshValue();
434
+ } else {
435
+ if ( this.options.values && this.options.values.length ) {
436
+ return this._values( index );
437
+ } else {
438
+ return this.value();
439
+ }
440
+ }
441
+ } else {
442
+ return this._values();
443
+ }
444
+ },
445
+ _setOption: function( key, value ) {
446
+ var i,
447
+ valsLength = 0;
448
+ if ( $.isArray( this.options.values ) ) {
449
+ valsLength = this.options.values.length;
450
+ }
451
+ $.Widget.prototype._setOption.apply( this, arguments );
452
+ switch ( key ) {
453
+ case "disabled":
454
+ if ( value ) {
455
+ this.handles.filter( ".ui-state-focus" ).blur();
456
+ this.handles.removeClass( "ui-state-hover" );
457
+ this.handles.attr( "disabled", "disabled" );
458
+ this.element.addClass( "ui-disabled" );
459
+ } else {
460
+ this.handles.removeAttr( "disabled" );
461
+ this.element.removeClass( "ui-disabled" );
462
+ }
463
+ break;
464
+ case "orientation":
465
+ this._detectOrientation();
466
+ this.element
467
+ .removeClass( "ui-slider-horizontal ui-slider-vertical" )
468
+ .addClass( "ui-slider-" + this.orientation );
469
+ this._refreshValue();
470
+ break;
471
+ case "value":
472
+ this._animateOff = true;
473
+ this._refreshValue();
474
+ this._change( null, 0 );
475
+ this._animateOff = false;
476
+ break;
477
+ case "values":
478
+ this._animateOff = true;
479
+ this._refreshValue();
480
+ for ( i = 0; i < valsLength; i += 1 ) {
481
+ this._change( null, i );
482
+ }
483
+ this._animateOff = false;
484
+ break;
485
+ }
486
+ },
487
+ //internal value getter
488
+ // _value() returns value trimmed by min and max, aligned by step
489
+ _value: function() {
490
+ var val = this.options.value;
491
+ val = this._trimAlignValue( val );
492
+ return val;
493
+ },
494
+ //internal values getter
495
+ // _values() returns array of values trimmed by min and max, aligned by step
496
+ // _values( index ) returns single value trimmed by min and max, aligned by step
497
+ _values: function( index ) {
498
+ var val,
499
+ vals,
500
+ i;
501
+ if ( arguments.length ) {
502
+ val = this.options.values[ index ];
503
+ val = this._trimAlignValue( val );
504
+ return val;
505
+ } else {
506
+ // .slice() creates a copy of the array
507
+ // this copy gets trimmed by min and max and then returned
508
+ vals = this.options.values.slice();
509
+ for ( i = 0; i < vals.length; i+= 1) {
510
+ vals[ i ] = this._trimAlignValue( vals[ i ] );
511
+ }
512
+ return vals;
513
+ }
514
+ },
515
+
516
+ // returns the step-aligned value that val is closest to, between (inclusive) min and max
517
+ _trimAlignValue: function( val ) {
518
+ if ( val <= this._valueMin() ) {
519
+ return this._valueMin();
520
+ }
521
+ if ( val >= this._valueMax() ) {
522
+ return this._valueMax();
523
+ }
524
+ var step = ( this.options.step > 0 ) ? this.options.step : 1,
525
+ valModStep = (val - this._valueMin()) % step;
526
+ alignValue = val - valModStep;
527
+ if ( Math.abs(valModStep) * 2 >= step ) {
528
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
529
+ }
530
+ // Since JavaScript has problems with large floats, round
531
+ // the final value to 5 digits after the decimal point (see #4124)
532
+ return parseFloat( alignValue.toFixed(5) );
533
+ },
534
+ _valueMin: function() {
535
+ return this.options.min;
536
+ },
537
+ _valueMax: function() {
538
+ return this.options.max;
539
+ },
540
+
541
+ _refreshValue: function() {
542
+ var oRange = this.options.range,
543
+ o = this.options,
544
+ self = this,
545
+ animate = ( !this._animateOff ) ? o.animate : false,
546
+ valPercent,
547
+ _set = {},
548
+ lastValPercent,
549
+ value,
550
+ valueMin,
551
+ valueMax;
552
+ if ( this.options.values && this.options.values.length ) {
553
+ this.handles.each(function( i, j ) {
554
+ valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;
555
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
556
+ $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
557
+ if ( self.options.range === true ) {
558
+ if ( self.orientation === "horizontal" ) {
559
+ if ( i === 0 ) {
560
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
561
+ }
562
+ if ( i === 1 ) {
563
+ self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
564
+ }
565
+ } else {
566
+ if ( i === 0 ) {
567
+ self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
568
+ }
569
+ if ( i === 1 ) {
570
+ self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
571
+ }
572
+ }
573
+ }
574
+ lastValPercent = valPercent;
575
+ });
576
+ } else {
577
+ value = this.value();
578
+ valueMin = this._valueMin();
579
+ valueMax = this._valueMax();
580
+ valPercent = ( valueMax !== valueMin ) ?
581
+ ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
582
+ 0;
583
+ _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
584
+ this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
585
+ if ( oRange === "min" && this.orientation === "horizontal" ) {
586
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
587
+ }
588
+ if ( oRange === "max" && this.orientation === "horizontal" ) {
589
+ this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
590
+ }
591
+ if ( oRange === "min" && this.orientation === "vertical" ) {
592
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
593
+ }
594
+ if ( oRange === "max" && this.orientation === "vertical" ) {
595
+ this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
596
+ }
597
+ }
598
+ }
599
+ });
600
+ $.extend( $.ui.slider, {
601
+ version: "1.8.9"
602
+ });
603
+ }(jQuery));
js/pluginscripts.js ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // JavaScript Document
2
+ jQuery(document).ready(function () {
3
+ clearInterval(documentLoaded);
4
+ // if there's no "draggable" then something's wrong so load provided jquery ui
5
+ if(!jQuery.fn.fontPlugin || !jQuery.ui || !jQuery.ui.draggable || !jQuery.fn.on) {
6
+ engageCompatibilityMode();
7
+ } else {
8
+ fQuery = jQuery;
9
+ initializeFontPlugin();
10
+ }
11
+ });
12
+ // this won't run unless jquery is completely overwritten by some plugin
13
+ var documentLoaded = setInterval(function () {
14
+ if(document.readyState === "complete") {
15
+ engageCompatibilityMode();
16
+ // stop checking if the document is laoded
17
+ clearInterval(documentLoaded);
18
+ }
19
+ }, 100);
20
+
21
+ function engageCompatibilityMode (callback) {
22
+ jQuery.getScript(fontBlogUrl + '/wp-content/plugins/font/js/jquery-1.10.2.min.js', function () {
23
+ fQuery = jQuery.noConflict(true);
24
+ fQuery.getScript(fontBlogUrl + '/wp-content/plugins/font/js/jquery-ui-1.9.2.custom.min.js', function () {
25
+ fQuery.getScript(fontBlogUrl + '/wp-content/plugins/font/js/colorpicker.js');
26
+ fQuery.getScript(fontBlogUrl + '/wp-content/plugins/font/js/jquery.fcarousel.min.js');
27
+ fQuery.getScript(fontBlogUrl + '/wp-content/plugins/font/js/jquery.fontPlugin.js', function () {
28
+ initializeFontPlugin(true);
29
+ if(callback !== undefined) {
30
+ callback();
31
+ }
32
+ });
33
+ });
34
+ });
35
+ }
36
+
37
+ function initializeFontPlugin (compatibilityMode) {
38
+ if(compatibilityMode === undefined) {
39
+ compatibilityMode = false;
40
+ }
41
+ /*
42
+ show font plugin browser BUTTON
43
+ */
44
+ 'use strict';
45
+ fQuery('#FFW_chooseFontButton, #content_FFWButton, #wp-admin-bar-font_settings > a').bind('click', function (e) {
46
+ e.preventDefault();
47
+
48
+ //if initialized already just toggle
49
+ if (fQuery('#fontplugin')[0] && fQuery('#fontplugin').data('fontPlugin') && fQuery('#fontplugin').data('fontPlugin').$presets) {
50
+ fQuery('#fontplugin').data('fontPlugin').$presets.fadeToggle(500);
51
+ } else {
52
+ if(compatibilityMode) {
53
+ alert('WARNING: Font plugin is running in safe mode. \n\n It may not work correctly! \n\nWhy?\n\nThis is usually caused by a conflict with a poorly written plugin.\n\n Try disabling all other plugins and then see if Font plugin starts without this message. If that works, enable other plguins one by one to find the one, which is causing the conflict.');
54
+ }
55
+ window.onbeforeunload = function () {
56
+ return 'Have you saved the changes?';
57
+ };
58
+
59
+ //open jquery plugin
60
+ var fontPluginWrapper = fQuery('<div id="fontplugin" class="draggableModal"></div>'),
61
+ settings;
62
+ fontPluginWrapper.appendTo('body');
63
+ settings = {
64
+ "compatibilityMode" : compatibilityMode,
65
+ "settingFields": [
66
+ {
67
+ "type": "text",
68
+ "label": "Selector",
69
+ "name": "selector",
70
+ "settingType": "general",
71
+ "settingName": "selector",
72
+ "extendWith": "selectorPicker"
73
+ },
74
+ {
75
+ "type": "text",
76
+ "label": "Font size",
77
+ "name": "font-size",
78
+ "settingType": "css",
79
+ "settingName": "fontSize",
80
+ "extendWith": "slider",
81
+ "unit": "px"
82
+ },
83
+ {
84
+ "type": "text",
85
+ "label": "Color",
86
+ "name": "color",
87
+ "settingType": "css",
88
+ "settingName": "color",
89
+ "extendWith": "colorPicker"
90
+ }]
91
+ };
92
+ if(!fQuery.fontPlugin) {
93
+ fQuery.fn.fontPlugin = fontPlugin;
94
+ }
95
+
96
+ try {
97
+ fontPluginWrapper.fontPlugin(settings);
98
+ } catch (e) {
99
+ alert('The plugin cannot start because of an error. This is usually caused by a conflict with a poorly written plugin. Try disabling all other plugins and then see if the "Font" plugin works. If that works, enable them one by one to find the one, which is causing the conflict.');
100
+ }
101
+ }
102
+ return false;
103
+ });
104
+
105
+ // extend with object size
106
+ if(!Object.size) {
107
+ Object.size = function(obj) {
108
+ var size = 0, key;
109
+ for (key in obj) {
110
+ if (obj.hasOwnProperty(key)) size++;
111
+ }
112
+ return size;
113
+ };
114
+ }
115
+ //make image colorpickable
116
+ /*function makeImagesColorpickable() {
117
+ var image = fQuery("#header1preview").contents().find('img');
118
+ fQuery("#header1preview").contents().find('a').click(function () {
119
+ return false;
120
+ });
121
+ image.click(function (e) {
122
+ var img = new Image(),
123
+ canvas,
124
+ context,
125
+ posX,
126
+ posY,
127
+ x,
128
+ y,
129
+ data,
130
+ color;
131
+ img.src = fQuery(this).attr('src');
132
+ canvas = fQuery('<canvas id="canvas" style="display:none"></canvas>');
133
+ canvas[0].setAttribute('width', fQuery(this).width());
134
+ canvas[0].setAttribute('height', fQuery(this).height());
135
+ fQuery('body').append(canvas);
136
+ context = document.getElementById('canvas').getContext('2d');
137
+ context.drawImage(img, 0, 0);
138
+ posX = fQuery(this).offset().left;
139
+ posY = fQuery(this).offset().top;
140
+ x = Math.round(e.pageX - posX);
141
+ y = Math.round(e.pageY - posY);
142
+ data = context.getImageData(x, y, 1, 1).data;
143
+ color = dec2html(data[0]) + dec2html(data[1]) + dec2html(data[2]);
144
+ ffwSetFontColor('#' + color);
145
+ return false;
146
+ });
147
+ //calculating functions
148
+ function dec2html(d) {
149
+ // Converts from decimal color value (0-255) to HTML-style (00-FF)
150
+ var hch = "0123456789ABCDEF",
151
+ a = d % 16,
152
+ b = (d - a) / 16;
153
+ return hch.charAt(b) + hch.charAt(a);
154
+ }
155
+ }*/
156
+ // Escape regex chars with \
157
+ RegExp.escapeX = function (text) {
158
+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
159
+ };
160
+ // The style function
161
+ fQuery.fn.style = function (styleName, value, priority) {
162
+ //console.log(styleName + ' - ' + value + ' - ' + priority);
163
+ var node,
164
+ style;
165
+ // For those who need them (< IE 9), add support for CSS functions
166
+ if (!CSSStyleDeclaration.prototype.getPropertyValue || !CSSStyleDeclaration.prototype.setProperty) {
167
+ CSSStyleDeclaration.prototype.getPropertyValue = function (a) {
168
+ return this.getAttribute(a);
169
+ };
170
+ CSSStyleDeclaration.prototype.setProperty = function (styleName, value, priority) {
171
+ var rule;
172
+ priority = typeof priority !== undefined ? priority : '';
173
+ this.setAttribute(styleName, value);
174
+ if (priority !== '') {
175
+ // Add priority manually
176
+ rule = new RegExp(RegExp.escapeX(styleName) + '\\s*:\\s*' + RegExp.escapeX(value) + '(\\s*;)?', 'gmi');
177
+ this.cssText = this.cssText.replace(rule, styleName + ': ' + value + ' !' + priority + ';');
178
+ }
179
+ };
180
+ CSSStyleDeclaration.prototype.removeProperty = function (a) {
181
+ return this.removeAttribute(a);
182
+ };
183
+ CSSStyleDeclaration.prototype.getPropertyPriority = function (styleName) {
184
+ var rule = new RegExp(RegExp.escapeX(styleName) + '\\s*:\\s*[^\\s]*\\s*!important(\\s*;)?', 'gmi');
185
+ return rule.test(this.cssText) ? 'important' : '';
186
+ };
187
+ }
188
+ function camelToDash(str) {
189
+ return str.replace(/\W+/g, '-')
190
+ .replace(/([a-z\d])([A-Z])/g, '$1-$2');
191
+ }
192
+ styleName = camelToDash(styleName);
193
+ // DOM node
194
+ node = this.get(0);
195
+ // Ensure we have a DOM node
196
+ if (typeof node === 'undefined') {
197
+ return;
198
+ }
199
+ // CSSStyleDeclaration
200
+ style = this.get(0).style;
201
+ // Getter/Setter
202
+ if (styleName !== undefined) {
203
+ if (value !== undefined) {
204
+ // Set style property
205
+ priority = priority !== undefined ? priority : '';
206
+ //console.log(styleName + ', ' + value + ', ' + priority)
207
+ style.setProperty(styleName, value, priority);
208
+ } else {
209
+ // Get style property
210
+ return style.getPropertyValue(styleName);
211
+ }
212
+ } else {
213
+ // Get CSSStyleDeclaration
214
+ return style;
215
+ }
216
+ };
217
+ if(!fQuery.fn.inlineStyle) {
218
+ fQuery.fn.inlineStyle = function (prop) {
219
+ return this.prop("style")[fQuery.camelCase(prop)];
220
+ };
221
+ }
222
+ (function ($) {
223
+ $.fn.removePrefixedClasses = function (prefix) {
224
+ if(!$(this).attr('class')) return;
225
+ var classNames = $(this).attr('class').split(' '),
226
+ className,
227
+ newClassNames = [],
228
+ i;
229
+ //loop class names
230
+ for(i = 0; i < classNames.length; i++) {
231
+ className = classNames[i];
232
+ // if prefix not found at the beggining of class name
233
+ if(className.indexOf(prefix) !== 0) {
234
+ newClassNames.push(className);
235
+ continue;
236
+ }
237
+ }
238
+ // write new list excluding filtered classNames
239
+ $(this).attr('class', newClassNames.join(' '));
240
+ };
241
+ }(fQuery));
242
+
243
+ if(!fQuery.fn.animateRotate) {
244
+ fQuery.fn.animateRotate = function(angle, duration, easing, complete) {
245
+ return this.each(function() {
246
+ var $elem = fQuery(this);
247
+ var currentRotationAngle = $elem.data('rotation');
248
+ if(currentRotationAngle === undefined) {
249
+ currentRotationAngle = 0;
250
+ }
251
+ $elem.data('rotation', angle);
252
+
253
+ fQuery({deg: currentRotationAngle}).animate({deg: angle}, {
254
+ duration: duration,
255
+ easing: easing,
256
+ step: function(now) {
257
+
258
+ $elem.css({
259
+ transform: 'rotate(' + now + 'deg)'
260
+ });
261
+ },
262
+ complete: complete || fQuery.noop
263
+ });
264
+ });
265
+ };
266
+ }
267
+ }
loadinfo.net.gif ADDED
Binary file
menu_item.png ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Font - official webfonts plugin. NO CODING! Just click & change font size, color and font face visually! ===
2
+ Contributors: killerdeveloper
3
+ Donate link: http://fontsforweb.com/
4
+ Tags: fonts, web fonts, font, fonts plugin, typekit, google webfont, TinyMCE plugin, ajax, webfonts
5
+ Requires at least: 2.8.0
6
+ Tested up to: 3.8.1
7
+ Stable tag: 7.1.9
8
+ Finally official* web fonts plugin for wordpress. CLICK ON ANYTHING TO CHANGE IT(see screenshots)! Then change color, size and font face using sliders and color picker!
9
+ == Description ==
10
+ Finally official web fonts plugin for wordpress. No need for any coding at all! How? This plugin has an unique method of recognizing of what you click at!
11
+
12
+ Isn't that natural to just click on something, drag it, choose color from color picker, use slider to change the size and do other modifications visually?
13
+
14
+ All other plugins were telling me to write a CSS rule and make changes in admin panel without seeing the effect. That wasn't the way it should work for a normal person. Even for me, a developer, making changes by coding and not seeing it gives me reults far from perfection. It's important to see what's changing as you look at the page, and then fine tune it to get a perfect result.
15
+
16
+ That's why I created this plugin. To be able to see the size change as I drag the slider, and see color change as I use the color picker. To be able to see how the new font face looks like after selecting it from the list.
17
+ See the 1 image tutorial [how to use this wordpress fonts plugin](http://wordpress.org/extend/plugins/font/screenshots/ "how to use this wordpres fonts plugin")
18
+
19
+ There are two modes:
20
+ Mode 1 - click on any element:
21
+ 1. When being logged in as admin go to your home page, or any other page
22
+ 2. Clic on "font settings" from the top bar and then on "Pick an element from the page"
23
+ 3. Click on anything you want and name it
24
+ 4. Change color, size and font face from over 1000 available or upload your own fonts
25
+ 5. Save
26
+
27
+ Mode 2 - select a portion of text:
28
+ 1. Go to the post editing page where you edit your posts and pages
29
+ 2. Clic on "font settings" from the top bar
30
+ 3. Select any portion of text. Can be a paragraph, one word or even a signle letter.
31
+ 4. Change color, size and font face from over 1000 available or upload your own fonts
32
+ 5. Update your post
33
+
34
+ Notice:
35
+ Always read each font's readme to make sure if it's free for your purposes! SOME fonts are free only for non commercial use, and some, probably just few need a small fee even for personal use.
36
+ Font is an official plugin of FontsFontWeb.com. Over 1000 free web fonts to choose from!
37
+ You'll need an API key to convert and store your own fonts on FontsForWeb.com server for commercial purposes.
38
+
39
+ == Installation ==
40
+ Easy way
41
+ 1. Go to your dashboard > plugin > add > upload
42
+ 2. Choose downloaded plugin zip file and upload
43
+ 3. Activate plugin
44
+ Alternative way
45
+ 1. Download and unzip `Font.zip` to the `/wp-content/plugins/` directory
46
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
47
+ 3. Go to text editor
48
+ == Frequently Asked Questions ==
49
+ == Screenshots ==
50
+ 1. General rules editing
51
+ 1. Post editing - select and apply styles
52
+ == Changelog ==
53
+ = 5.00 =
54
+ Completely redesigned! Fixes fonts list not loading bug and introduces many other changes and improvements.
55
+ = 5.1 =
56
+ UPDATE! Fixed bug related to not applied font changes. New visual indication for mouseover when selecting items. Related items are now also highlighted. Few other minor fixes.
57
+ = 5.11 =
58
+ Like on facebook
59
+ = 5.12 =
60
+ Quick bugfix to prevent ttf file not found error
61
+ = 5.13 =
62
+ Fixed saving on overly restrictive hostings
63
+ = 5.14 =
64
+ Important compatibility fix for new ajax handling file
65
+ = 5.15 =
66
+ Drag things and change their position
67
+ = 5.16 =
68
+ Fixed plugin crashing and no fonts' list displaying
69
+ = 5.17 =
70
+ Added 3D text feature
71
+ Click to select item
72
+ A few bugfixes
73
+ A few compatibility improvements
74
+ = 5.18 =
75
+ IE9 and 10 now displaying all fonts correctly. Added WOFF formats.
76
+ = 5.19 =
77
+ Fixed "PICK ELEMENT" fatal error, other minor improvements
78
+ = 5.20 =
79
+ No more silent crashes. Shows an error instead.
80
+ New Like/Dislike buttons and contact form.
81
+ = 5.21 =
82
+ Pick element much more precise
83
+ Cancel selecting mode button
84
+ Key entry of selector
85
+ = 5.22 =
86
+ Legacy wordpress compatibility 3.1 but not fully
87
+ 3.3.1 full support
88
+ Small selecting tool tweaks
89
+ = 5.23 =
90
+ Added reset button
91
+ = 5.24 =
92
+ Disabled errors
93
+ = 5.25 =
94
+ Added version number when requesting js or css to make sure the latest files are downloaded.
95
+ Browsers were serving cached old versions disregarding the update.
96
+ = 6.00 =
97
+ Moved main functions to thin top bar to reduce space taken
98
+ = 6.1 =
99
+ Compatibility fixes and errors on save shown instead of silent failure
100
+ = 6.11 =
101
+ Alerts when no selection made to give some guidance to the user
102
+ = 6.12 =
103
+ Added mime types htaccess for webfonts
104
+ = 6.13 =
105
+ Alert on api key error, and a new description.
106
+ New rules in htaccess for compatibility.
107
+ = 6.14 =
108
+ Font files folder is now created by script not unpacked when installing.
109
+ = 6.15 =
110
+ Wordpress in subdirectory support added. This should fix saving problems on affected websites.
111
+ = 6.16 =
112
+ Fixed error of ajax error message
113
+ "Font settings" can be only seen by admin not by any editor anymore
114
+ "Save button" blinks after being clicked and becomes disabled what prevents from second clicking and losing settings
115
+ = 6.17 =
116
+ Removed facebook api support, like button was dropped long time ago
117
+ Fade-in on first run
118
+ = 6.18 =
119
+ Connection check and error message displayed when can't connect
120
+ = 7.0 =
121
+ The biggest update and bug fixes compilation for "Font" plugin ever!
122
+
123
+ -Completely new "effects" window with 3d text
124
+ -New design, during work bar moved on top of admin bar to save space
125
+ -warning when using an old browser which does not support effects and advanced options
126
+ -notice when using very old Wordpress version
127
+ -When the plugin is used for the very first time, only one button is shown to pick up an element and start the journey
128
+ -Prevention of accidently leaving the page before saving changes
129
+
130
+ Fixed:
131
+ -warning instead of silent crash when file saving is disabled on user's server
132
+ -deleting multiple presets is not causing problems any more
133
+ -In selection mode when cancelling, a prompt window is not showing in a loop any more
134
+
135
+ -Lots of other improvements and bug fixes for better overall user experience
136
+
137
+ = 7.1 =
138
+ Compatibility mode, which makes the plugin work even when some poorly written plugin is breaking jQuery
139
+ Minor bug fixes
140
+ = 7.1.1 =
141
+ -Compatibility update for some restrictive hosting providers.
142
+ -Ajax calls only to built in ajax PHP script
143
+ -TinyMCE editor styles stored in a CSS file instead of pointing to PHP which generates CSS
144
+ -htaccess file compatibility improved
145
+ = 7.1.2 =
146
+ -htaccess compatibility issue fix
147
+ -css compatibity improvements
148
+ = 7.1.3 =
149
+ -htaccess mod
150
+ = 7.1.4 =
151
+ -Compatibility update with 3 alternative Ajax proxies
152
+ = 7.1.5 =
153
+ -Support for the latest fonts browser. Now blocked for older versions.
154
+ -Like Yes/No button is back
155
+ = 7.1.6 =
156
+ -Fixed the problem with changes sometimes not being saved in post/page editing modes
157
+ -Fixed version number in toolbar from hardcoded to be taken from variable
158
+ -Numerous improvements for applying settings in post/page editing view
159
+ = 7.1.7 =
160
+ -Selecting mode bug fixes
161
+ -Fixed pick an element button weird behaviour
162
+ -Added WP Super Cache support(fixes bug with changes not being shown)
163
+ = 7.1.8 =
164
+ -Now compatibility mode runs if no "on" detected
165
+ -fixed jCarousel conflict with other jCarousels
166
+ -fixed crashing on undefined jQuery.browser
167
+ = 7.1.9 =
168
+ -Fixed launching compatibility mode when jQuery completely overwritten
169
+
170
+ == Upgrade Notice ==
171
+ = 5.00 =
172
+ Completely redesigned! Fixes fonts list not loading bug and introduces many other changes and improvements.
173
+ = 5.1 =
174
+ UPDATE! Fixed bug related to not applied font changes. New visual indication for mouseover when selecting items. Related items are now also highlighted. Few other minor fixes.
175
+ = 5.11 =
176
+ Like on facebook
177
+ = 5.12 =
178
+ Quick bugfix to prevent ttf file not found error
179
+ = 5.13 =
180
+ Fixed saving on overly restrictive hostings
181
+ = 5.14 =
182
+ Important compatibility fix for new ajax handling file
183
+ = 5.15 =
184
+ Drag things and change their position
185
+ = 5.16 =
186
+ Fixed plugin crashing and no fonts' list displaying
187
+ = 5.17 =
188
+ Added 3D text feature
189
+ Click to select item
190
+ A few bugfixes
191
+ A few compatibility improvements
192
+ = 5.18 =
193
+ IE9 and 10 now displaying all fonts correctly. Added WOFF formats.
194
+ = 5.19 =
195
+ Fixed "PICK ELEMENT" fatal error, other minor improvements
196
+ = 5.20 =
197
+ No more silent crashes. Shows an error instead.
198
+ New Like/Dislike buttons and contact form.
199
+ = 5.21 =
200
+ Pick element much more precise
201
+ Cancel selecting mode button
202
+ Key entry of selector
203
+ = 5.22 =
204
+ Legacy wordpress compatibility 3.1 but not fully
205
+ 3.3.1 full support
206
+ Small selecting tool tweaks
207
+ = 5.23 =
208
+ Added reset button
209
+ = 5.24 =
210
+ Disabled errors
211
+ = 5.25 =
212
+ Added version number when requesting js or css to make sure the latest files are downloaded.
213
+ Browsers were serving cached old versions disregarding the update.
214
+ = 6.00 =
215
+ Moved main functions to thin top bar to reduce space usage
216
+ = 6.1 =
217
+ Compatibility fixes and errors on save shown instead of silent failure
218
+ = 6.11 =
219
+ Alerts when no selection made to give some guidance to the user
220
+ = 6.12 =
221
+ Added mime types htaccess for webfonts
222
+ = 6.13 =
223
+ Alert on api key error, and a new description.
224
+ New rules in htaccess for compatibility.
225
+ = 6.14 =
226
+ Font files folder is now created by script not unpacked when installing.
227
+ = 6.15 =
228
+ Wordpress in subdirectory support added. This should fix saving problems on affected websites.
229
+ = 6.16 =
230
+ Fixed error of ajax error message
231
+ "Font settings" can be only seen by admin not by any editor anymore
232
+ "Save button" blinks after being clicked and becomes disabled what prevents from second clicking and losing settings
233
+ = 6.17 =
234
+ Removed facebook api support, like button was dropped long time ago
235
+ Fade-in on first run
236
+ = 6.18 =
237
+ Connection check and error message displayed when can't connect
238
+ = 7.0 =
239
+ The biggest update and bug fixes compilation for "Font" plugin ever!
240
+ = 7.1 =
241
+ Compatibility mode, which makes the plugin work even when some poorly written plugin is breaking jQuery
242
+ Minor bug fixes
243
+
244
+ -Completely new "effects" window with 3d text
245
+ -New design, during work bar moved on top of admin bar to save space
246
+ -warning when using an old browser which does not support effects and advanced options
247
+ -notice when using very old Wordpress version
248
+ -When the plugin is used for the very first time, only one button is shown to pick up an element and start the journey
249
+ -Prevention of accidently leaving the page before saving changes
250
+
251
+ Fixed:
252
+ -warning instead of silent crash when file saving is disabled on user's server
253
+ -deleting multiple presets is not causing problems any more
254
+ -In selection mode when cancelling, a prompt window is not showing in a loop any more
255
+
256
+ -Lots of other improvements and bug fixes for better overall user experience
257
+
258
+ = 7.1.1 =
259
+ -Compatibility update for some restrictive hosting providers.
260
+ -Ajax calls only to built in ajax PHP script
261
+ -TinyMCE editor styles stored in a CSS file instead of pointing to PHP which generates CSS
262
+ -htaccess file compatibility improved
263
+ = 7.1.2 =
264
+ -htaccess compatibility issue fix
265
+ -css compatibity improvements
266
+ = 7.1.3 =
267
+ -htaccess mod
268
+ = 7.1.4 =
269
+ -Compatibility update with 3 alternative Ajax proxies
270
+ = 7.1.5 =
271
+ -Support for the latest fonts browser. Now blocked for older versions.
272
+ -Like Yes/No button is back
273
+ = 7.1.6 =
274
+ -Fixed the problem with changes sometimes not being saved in post/page editing modes
275
+ -Fixed version number in toolbar from hardcoded to be taken from variable
276
+ -Numerous improvements for applying settings in post/page editing view
277
+ = 7.1.7 =
278
+ -Selecting mode bug fixes
279
+ -Fixed pick an element button weird behaviour
280
+ -Added WP Super Cache support(fixes bug with changes not being shown)
281
+ = 7.1.8 =
282
+ -Now compatibility mode runs if no "on" detected
283
+ -fixed jCarousel conflict with other jCarousels
284
+ -fixed crashing on undefined jQuery.browser
285
+ = 7.1.9 =
286
+ -Fixed launching compatibility mode when jQuery completely overwritten
287
+
288
+ == Arbitrary section ==
289
+ == Source ==
290
+ Here's a link to [FontsForWeb.com](http://FontsForWeb.com/ "Free webfonts ready to use on your page")
screenshot-1.png ADDED
Binary file
screenshot-2.jpg ADDED
Binary file