diff --git a/ajax.php b/ajax.php
index a629af6392e312f35f02a5dc387b380fddf737eb..0786b41a43691fa1667212753c01d48d2fde05ad 100644
--- a/ajax.php
+++ b/ajax.php
@@ -27,7 +27,13 @@ require_once INCLUDE_DIR.'/class.ajax.php';
 
 $dispatcher = patterns('',
     url('^/config/', patterns('ajax.config.php:ConfigAjaxAPI',
-        url_get('^client', 'client')
+        url_get('^client$', 'client')
+    )),
+    url('^/draft/', patterns('ajax.draft.php:DraftAjaxAPI',
+        url_post('^(?P<id>\d+)$', 'updateDraftClient'),
+        url_post('^(?P<id>\d+)/attach$', 'uploadInlineImageClient'),
+        url_get('^(?P<namespace>[\w.]+)$', 'getDraftClient'),
+        url_post('^(?P<namespace>[\w.]+)$', 'createDraftClient')
     ))
 );
 print $dispatcher->resolve($ost->get_path_info());
diff --git a/assets/default/css/theme.css b/assets/default/css/theme.css
index c8b90631856d3c6810a52dc38468dd5c8fb61702..4a1af12ac59e2fab9b7179b1c4ba250ee50badd7 100644
--- a/assets/default/css/theme.css
+++ b/assets/default/css/theme.css
@@ -520,7 +520,7 @@ body {
 #kb-search #breadcrumbs #breadcrumbs a {
   color: #555;
 }
-#ticketForm div,
+#ticketForm div.clear,
 #clientLogin div {
   clear: both;
   padding: 3px 0;
@@ -648,8 +648,8 @@ body {
 #reply h2 {
   margin-bottom: 10px;
 }
-#reply table {
-  width: 800px;
+#reply > table {
+  width: auto;
 }
 #reply table td {
   vertical-align: top;
@@ -783,7 +783,8 @@ a.refresh {
 .infoTable th {
   text-align: left;
 }
-#ticketThread table {
+#ticketThread table.response,
+#ticketThread table.message {
   margin-top: 10px;
   border: 1px solid #aaa;
   border-bottom: 2px solid #aaa;
@@ -799,9 +800,6 @@ a.refresh {
   color: #888;
   padding-left: 20px;
 }
-#ticketThread table td {
-  padding: 5px;
-}
 #ticketThread .message th {
   background: #d8efff;
 }
@@ -824,3 +822,66 @@ a.refresh {
   background-position: 0 50%;
   background-repeat: no-repeat;
 }
+/* Inline image hovering with download link */
+.image-hover {
+    display: inline-block;
+    position: relative;
+}
+.image-hover .caption {
+    background-color: rgba(0,0,0,0.5);
+    min-width: 20em;
+    color: white;
+    padding: 1em;
+    display: none;
+    width: 100%;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
+}
+.image-hover .caption .filename {
+    display: inline-block;
+    max-width: 60%;
+}
+.ticket-thread-body img {
+    width: auto;
+    height: auto;
+    max-width: 100%;
+}
+.action-button {
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  -webkit-background-clip: padding-box;
+  -moz-background-clip: padding;
+  background-clip: padding-box;
+  color: #777 !important;
+  display: inline-block;
+  border: 1px solid #aaa;
+  cursor: pointer;
+  font-size: 11px;
+  height: 18px;
+  overflow: hidden;
+  background-color: #dddddd;
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #efefef), color-stop(100% #dddddd));
+  background-image: -webkit-linear-gradient(top, #efefef 0%, #dddddd 100%);
+  background-image: -moz-linear-gradient(top, #efefef 0%, #dddddd 100%);
+  background-image: -ms-linear-gradient(top, #efefef 0%, #dddddd 100%);
+  background-image: -o-linear-gradient(top, #efefef 0%, #dddddd 100%);
+  background-image: linear-gradient(top, #efefef 0%, #dddddd 100%);
+  padding: 0 5px;
+  text-decoration: none;
+  line-height:18px;
+  float:right;
+  margin-left:5px;
+}
+.action-button span,
+.action-button a {
+  color: #777 !important;
+  display: inline-block;
+  float: left;
+}
+.action-button a {
+  color: #777;
+  text-decoration: none;
+}
diff --git a/bootstrap.php b/bootstrap.php
index 35580ce9e89442862b1fd444c028ac98cddfdc6f..b2540b15936cfc82778b024fb9a0b42a1d7ad31b 100644
--- a/bootstrap.php
+++ b/bootstrap.php
@@ -60,11 +60,12 @@ class Bootstrap {
         define('CONFIG_TABLE',$prefix.'config');
 
         define('CANNED_TABLE',$prefix.'canned_response');
-        define('CANNED_ATTACHMENT_TABLE',$prefix.'canned_attachment');
         define('PAGE_TABLE', $prefix.'page');
         define('FILE_TABLE',$prefix.'file');
         define('FILE_CHUNK_TABLE',$prefix.'file_chunk');
 
+        define('ATTACHMENT_TABLE',$prefix.'attachment');
+
         define('STAFF_TABLE',$prefix.'staff');
         define('TEAM_TABLE',$prefix.'team');
         define('TEAM_MEMBER_TABLE',$prefix.'team_member');
@@ -73,10 +74,10 @@ class Bootstrap {
         define('GROUP_DEPT_TABLE', $prefix.'group_dept_access');
 
         define('FAQ_TABLE',$prefix.'faq');
-        define('FAQ_ATTACHMENT_TABLE',$prefix.'faq_attachment');
         define('FAQ_TOPIC_TABLE',$prefix.'faq_topic');
         define('FAQ_CATEGORY_TABLE',$prefix.'faq_category');
 
+        define('DRAFT_TABLE',$prefix.'draft');
         define('TICKET_TABLE',$prefix.'ticket');
         define('TICKET_THREAD_TABLE',$prefix.'ticket_thread');
         define('TICKET_ATTACHMENT_TABLE',$prefix.'ticket_attachment');
diff --git a/client.inc.php b/client.inc.php
index f8f6ddff1e0cab8dd8a8e047138b0b3974eced85..2ab016d15c6a252af4816ef867748c991f8fd760 100644
--- a/client.inc.php
+++ b/client.inc.php
@@ -63,6 +63,9 @@ if ($_POST  && !$ost->checkCSRFToken()) {
     die('Action denied (400)!');
 }
 
+//Add token to the header - used on ajax calls [DO NOT CHANGE THE NAME]
+$ost->addExtraHeader('<meta name="csrf_token" content="'.$ost->getCSRFToken().'" />');
+
 /* Client specific defaults */
 define('PAGE_LIMIT', DEFAULT_PAGE_LIMIT);
 
diff --git a/css/osticket.css b/css/osticket.css
index 7417c890e8fb10ac8e7a0011d59bc53a593c39b8..fcf145d59b1b646e5066a9851d773de75c7da524 100644
--- a/css/osticket.css
+++ b/css/osticket.css
@@ -23,3 +23,7 @@
 }
 
 #loading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; }
+
+.pull-right {
+    float: right;
+}
diff --git a/css/redactor.css b/css/redactor.css
new file mode 100644
index 0000000000000000000000000000000000000000..6a5c8df81fb6f5a2c929221d6bbc92a66d84790a
--- /dev/null
+++ b/css/redactor.css
@@ -0,0 +1,801 @@
+.redactor_box {
+	position: relative;
+	overflow: visible;
+	border: 1px solid #ddd;
+	background-color: #fff;
+}
+
+body .redactor_air {
+	position: absolute;
+	z-index: 2;
+}
+
+/*
+	Fullscreen
+*/
+body .redactor_box_fullscreen {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: 2000;
+    overflow: hidden;
+    width: 100%;
+}
+
+.redactor_box iframe {
+	display: block;
+	margin: 0;
+	padding: 0;
+}
+
+.redactor_box textarea, .redactor_box textarea:focus {
+	position: relative;
+	z-index: 1004;
+	display: block;
+	overflow: auto;
+	margin: 0;
+	padding: 0;
+	width: 100%;
+	outline: none;
+	outline: none;
+	border: none;
+	background-color: #222;
+	box-shadow: none;
+	color: #ccc;
+	font-size: 13px;
+	font-family: Menlo, Monaco, monospace, sans-serif;
+	resize: none;
+}
+
+.redactor_editor,
+.redactor_editor:focus,
+.redactor_editor div,
+.redactor_editor p,
+.redactor_editor ul,
+.redactor_editor ol,
+.redactor_editor table,
+.redactor_editor dl,
+.redactor_editor blockquote,
+.redactor_editor pre,
+.redactor_editor h1,
+.redactor_editor h2,
+.redactor_editor h3,
+.redactor_editor h4,
+.redactor_editor h5,
+.redactor_editor h6 {
+	font-family: Arial, Helvetica, Verdana, Tahoma, sans-serif !important;
+}
+
+.redactor_editor code,
+.redactor_editor pre {
+	font-family: Menlo, Monaco, monospace, sans-serif !important;
+}
+
+.redactor_editor,
+.redactor_editor:focus,
+.redactor_editor div,
+.redactor_editor p,
+.redactor_editor ul,
+.redactor_editor ol,
+.redactor_editor table,
+.redactor_editor dl,
+.redactor_editor blockquote,
+.redactor_editor pre {
+	font-size: 15px;
+	line-height: 1.5rem;
+}
+
+.redactor_editor,
+.redactor_editor:focus {
+	position: relative;
+	overflow: auto;
+	margin: 0 !important;
+	padding: 10px;
+	padding-bottom: 5px;
+	outline: none;
+	background: none;
+	background: #fff !important;
+	box-shadow: none !important;
+	white-space: normal;
+}
+.redactor_editor a {
+	color: #15c !important;
+	text-decoration: underline !important;
+}
+
+.redactor_editor .redactor_placeholder {
+	color: #999 !important;
+	display: block !important;
+	margin-bottom: 10px !important;
+}
+
+.redactor_editor object,
+.redactor_editor embed,
+.redactor_editor video,
+.redactor_editor img {
+	max-width: 100%;
+	width: auto;
+}
+.redactor_editor video,
+.redactor_editor img {
+	height: auto;
+}
+
+.redactor_editor div,
+.redactor_editor p,
+.redactor_editor ul,
+.redactor_editor ol,
+.redactor_editor table,
+.redactor_editor dl,
+.redactor_editor blockquote,
+.redactor_editor pre {
+	margin: 0;
+	margin-bottom: 10px !important;
+	border: none;
+	background: none !important;
+	box-shadow: none !important;
+}
+.redactor_editor iframe,
+.redactor_editor object,
+.redactor_editor hr {
+	margin-bottom: 15px !important;
+}
+.redactor_editor blockquote {
+	margin-left: 3em !important;
+	color: #777;
+	font-style: italic !important;
+}
+.redactor_editor ul,
+.redactor_editor ol {
+	padding-left: 2em !important;
+}
+.redactor_editor ul ul,
+.redactor_editor ol ol,
+.redactor_editor ul ol,
+.redactor_editor ol ul {
+	margin: 2px !important;
+	padding: 0 !important;
+	padding-left: 2em !important;
+	border: none;
+}
+.redactor_editor dl dt { font-weight: bold; }
+.redactor_editor dd { margin-left: 1em;}
+
+.redactor_editor table {
+	border-collapse: collapse;
+	font-size: 1em !important;
+}
+.redactor_editor table td {
+	padding: 5px !important;
+	border: 1px solid #ddd;
+	vertical-align: top;
+}
+.redactor_editor table thead td {
+	border-bottom: 2px solid #000 !important;
+	font-weight: bold !important;
+}
+.redactor_editor code {
+	background-color: #d8d7d7 !important;
+}
+.redactor_editor pre {
+	overflow: auto;
+	padding: 1em !important;
+	border: 1px solid #ddd !important;
+	border-radius: 3px !important;
+	background: #f8f8f8 !important;
+	white-space: pre;
+	font-size: 90% !important;
+}
+.redactor_editor hr {
+  display: block;
+  height: 1px;
+  border: 0;
+  border-top: 1px solid #ccc;
+}
+
+.redactor_editor h1,
+.redactor_editor h2,
+.redactor_editor h3,
+.redactor_editor h4,
+.redactor_editor h5,
+.redactor_editor h6 {
+	margin-top: 0 !important;
+	margin-right: 0 !important;
+	margin-left: 0;
+	padding: 0 !important;
+	background: none;
+	color: #000;
+	font-weight: bold;
+}
+
+.redactor_editor h1 {
+	margin-bottom: 10px;
+	font-size: 36px !important;
+	line-height: 40px !important;
+}
+.redactor_editor h2 {
+	margin-bottom: 10px;
+	font-size: 30px !important;
+	line-height: 38px !important;
+}
+.redactor_editor h3 {
+	margin-bottom: 10px;
+	font-size: 24px !important;
+	line-height: 30px;
+}
+.redactor_editor h4 {
+	margin-bottom: 10px;
+	font-size: 18px !important;
+	line-height: 24px !important;
+}
+.redactor_editor h5 {
+	margin-bottom: 10px;
+	font-size: 1em !important;
+}
+
+.redactor_editor.redactor_editor_wym {
+	padding: 10px 7px 0 7px !important;
+	background: #f6f6f6 !important;
+}
+.redactor_editor_wym div,
+.redactor_editor_wym p,
+.redactor_editor_wym ul,
+.redactor_editor_wym ol,
+.redactor_editor_wym table,
+.redactor_editor_wym dl,
+.redactor_editor_wym pre,
+.redactor_editor_wym h1,
+.redactor_editor_wym h2,
+.redactor_editor_wym h3,
+.redactor_editor_wym h4,
+.redactor_editor_wym h5,
+.redactor_editor_wym h6,
+.redactor_editor_wym blockquote {
+	margin: 0 0 5px 0;
+	padding: 10px !important;
+	border: 1px solid #e4e4e4 !important;
+	background-color: #fff !important;
+}
+.redactor_editor_wym blockquote:before {
+	content: '';
+}
+.redactor_editor_wym div {
+	border: 1px dotted #aaa !important;
+}
+.redactor_editor_wym pre {
+	border: 2px dashed #e4e4e4 !important;
+	background-color: #f8f8f8 !important;
+}
+.redactor_editor_wym ul,
+.redactor_editor_wym ol {
+	padding-left: 2em !important;
+}
+.redactor_editor_wym ul li ul,
+.redactor_editor_wym ul li ol,
+.redactor_editor_wym ol li ol,
+.redactor_editor_wym ol li ul {
+	border: none !important;
+}
+
+/*
+	TOOLBAR
+*/
+.redactor_toolbar {
+	position: relative;
+	top: 0;
+	left: 0;
+	margin: 0 !important;
+	padding: 0 !important;
+	padding-left: 2px !important;
+	border: 1px solid #ddd;
+	border-bottom-color: #b8b8b8;
+	background: #fafafa;
+	background: -moz-linear-gradient(top,  #fafafa 0%, #e5e5e5 94%, #d3d3d3 94%, #d3d3d3 100%);
+	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fafafa), color-stop(94%,#e5e5e5), color-stop(94%,#d3d3d3), color-stop(100%,#d3d3d3));
+	background: -webkit-linear-gradient(top,  #fafafa 0%,#e5e5e5 94%,#d3d3d3 94%,#d3d3d3 100%);
+	background: -o-linear-gradient(top,  #fafafa 0%,#e5e5e5 94%,#d3d3d3 94%,#d3d3d3 100%);
+	background: -ms-linear-gradient(top,  #fafafa 0%,#e5e5e5 94%,#d3d3d3 94%,#d3d3d3 100%);
+	background: linear-gradient(to bottom,  #fafafa 0%,#e5e5e5 94%,#d3d3d3 94%,#d3d3d3 100%);
+	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#d3d3d3',GradientType=0 );
+
+	list-style: none !important;
+	font-size: 0;
+	font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif !important;
+	line-height: 0 !important;
+
+}
+.redactor_toolbar:after {
+	display: block;
+	visibility: hidden;
+	clear: both;
+	height: 0;
+	content: ".";
+}
+.redactor_box .redactor_toolbar {
+	border: none;
+	border-bottom: 1px solid #b8b8b8;
+}
+.redactor_toolbar.toolbar_fixed_box {
+	border: 1px solid #ddd;
+	border-bottom-color: #b8b8b8;
+}
+body .redactor_air .redactor_toolbar {
+	padding-right: 2px !important;
+}
+.redactor_toolbar li {
+	float: left !important;
+	margin: 0 !important;
+	padding: 1px 0 3px 1px;
+	outline: none;
+	list-style: none !important;
+}
+.redactor_toolbar li.redactor_separator {
+	float: left;
+	margin: 0 2px 0 3px !important;
+	padding: 0;
+	height: 29px;
+	border-right: 1px solid #f4f4f4;
+	border-left: 1px solid #d8d8d8;
+}
+.redactor_toolbar li a {
+	display: block;
+	width: 25px;
+	height: 25px;
+	outline: none;
+	border: 1px solid transparent;
+	text-decoration: none;
+	font-size: 0;
+	line-height: 0;
+	cursor: pointer;
+	zoom: 1;
+	*border: 1px solid #eee;
+}
+.redactor_toolbar li.redactor_btn_right {
+	float: none;
+	float: right !important;
+}
+.redactor_toolbar li a {
+	display: block;
+	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAAAZCAYAAABpXuA7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpCQTAzNkE5MzBENTdFMTExODJDNjhBMUI3REEyODQzMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3QjA3Mzk4NEJBMkExMUUyODgwRjgyOEZCRDVFNjYzMyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3QjA3Mzk4M0JBMkExMUUyODgwRjgyOEZCRDVFNjYzMyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDU4MDExNzQwNzIwNjgxMTgyMkE5Q0VDNTNDRTc5RkEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QkEwMzZBOTMwRDU3RTExMTgyQzY4QTFCN0RBMjg0MzAiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5gGig/AAAgiklEQVR42uxdCXgNV/ufbDe73EgiEaGxpwQh8dlqbdNEqZZawoOKSj5qr1raog2lEX/VlsiHKoKi1BZf8QUJSqkigtIiiZBIRZKbTfbk/74378S4zXJn7twrbc/vec5zZ+bOzLnnzHmX33veOdeooqKCY2BgYGBgYGBgYGBgYPjnwZh1AQMDAwMDAwMDAwMDAyOEDAwMDAwMDAwMDAwMDIwQMjAwMDAwMDAwMDAwMPzdYcq6gIHhnwkjIyNtTnOHYg3lEZR0PMDeO2ZgYGCQDMvg4OB1KpVqgpiLlErlNxs2bJgGmwWsCxkYGOQGmyFkYGCoSTeEQbkE5WcoN6C4sW5hYGD4p+vG9evXtx85ciRGxpQSrm8slgwi4JqJeC3rfr1CWcNztXJ3d9+Kn6yLGP6uqG8zhKZTp071VSgUJrhTXFxcFh4eHg2bpexRMdQDWEyZMiU0IyNjptQbODg4fBkREbEANgtrO+/GjRumkZGRnfLz8/sXFBS8VFpa2hLkAQmZUXl5uQ2dVm5sbPwEPkvMzc3vmpmZJVhYWPxibW0d/cYbb/zao0ePMok/E2cEt5NRdCb5C4ASBcUHSll96qvnCMWMGTNmp6WlhUJf+8yePfsKPhOpNwsLC5M09Tpv3jwjJpoMzJEfmaV58LvvvrNHLiVnHRMmTOh94sSJM3gA9yXU4Sz4fXFaXIv1egmuTWCPW+9jyB1KnJDE37t3bzx8LoFyl3UVAyOE+oNlUFBQeF5e3siysjJrje8wIpam4/1tQYn/9OTJk/bVfdm0adMVq1at+hg2i2Rsk93o0aOToT0NqqyAs/N/1qxZ8x7HUj7+qnDRheAg6PovoCTVJpeHDh3yT0xMPASErxzIXqFCoShTKpUlsI+pQ6lAEI2hmMCYVlRUVBiD7LQvLCzskJubO/LRo0fGJ0+eHAIk5aiEYAqSzsNc5czgSCi9ocRA2QNlJ8oqlLx61FfPEw1BvtFJwOj9u/AxU8u+EQU/Pz/uhRde4DZs2MAkkEEnmxQQEJBcXl7eoKYTQL/k7Nq1qxlsZkusw2zx4sUTb9269R/+gJWV1Y0tW7a8Cjb4f7wNDgwMbDlw4MBE2JQr/7xhaGjokgULFizWOK7p2OsCvBcHbTkjPCiBFJoLtnHWKQnusb+6E+G+Q6ler2qurS9QzJs3b3ZSUlKor6+vD/hyOgXG6kNAAbavaAQVGtFuI0YIGRgh1ICRkdF8dBrBGT2u428wAUfHLzs7O1BDER4AoXyTHFSdCSEo8eVg6Gbs27evW9euXZPnzp174PDhw96RkZG97t+/Pz8sLCwNlFo4nFsil/HduXPnB2D4Vufn5ytmz569Gxx0VPoWEghhlbKCfmkO24naXqiloTKfNm3aR+np6Qt2797diDdyMtfxJ6UrBiINrr7qcRGcF8eJiwoLo7wudZCcBsnJyctQzOCaGzBuEuzs7ArAsSpGggdOFTpZJSS/OJtuAvJjDqTE6sKFC8337t3rmZqaGgLHz0HJFPEbcfbvIJTPqWCQpAsRwkFQHqDx15Y819BXFiBz7uPHj8f2F1azL7avnheMgbR3sbS0VDvXQML90SnVByFs27YtZ2FhoSaF9+7dk9Xx0aMMalWXDjM4+m6HIfvJUGjcrFmzpBEjRlwHG5i6Zs0a/zNnznjC2CoBGVwL3xeDXcRx3FgHQqhYsmTJ1fj4+I2ffvppkI+PTxLYVUw9bww2OHT16tVzwRZiZANT0o1kJIRG1ZBB9XOUkzRUd3DlypVfkuxLeeaoG5NgzATyhFOAJPpeVc/lvGFpaaneA2Patlmi/CnhuhC4/mPqgy3wcY+egVJAxOsjITckzOfMmROCPnM1gZ1nvlMqlUfAtx8Bm/ky1oGwmThx4rG8vLye1tbWv4IuG/vuu+9eFRmEqKsO6+Dg4D0wngeamJjkeHt7v/X++++jHyQ168pk2bJlfRISEua4urp+s3Tp0kNcZbDeGHSi582bN+dBW67A9hrUw/WaEAL5awHEL0Gw/wp8hEJpqfmdBNgkJiYGV3OcF2gbGdqZCyWVDBBGQdGJvj148OCC/fv3d8/NzTUBB7s7HIsU6UDXhvzo6OiWSAabNGlSDE49Rpzuc9LS34SGop+Ea+uKkFr5+fnlbdu2zQy2X+D7SeY6uGoMnj7q0Gc9FoLtrXSeFThRC8gxQJl4UsO1XtzTKK9FHb/BGUhfK9zo37//aXt7+xOw+ZirnMG2BOW3ddSoUYtBgV2nZ2UKhNEKiiOM45eREML1bbjKaKa243k4lAgo+J4K1reHHMPBUHAhg4+g9BJxv+r6Sk3w0tLSJsDnFgr0aO6L7SvjVatWtbl+/foaaHN/0EcloI9QvsudnJxWhoSELD9//rxlVFTUZ5mZmUHwfSmUMjjHyNbW9mD79u0XgIOaJMExRfI9ZPLkyTFQ/6iMjAzXo0ePdvH393/AyRgd79Sp09OB6e4uByE0lAxqW5fYexqqHYbsJ0OhNCws7HMiYzjeB5I9Rx2CNjwNdFgcp9srGujMPC4vLy8iW4s+Bi5G9RCKQ3FxcQHZwUwZySASgTvPo0OBVJ90dnY+rwOBVgN+/+YayFnzei7nxrGxsT6gW1viTkpKit4CY9oSYImkEM+NE0xEXBWQ8ar79OnTJzw5OVk1bNiwqZ9//nm8CF2v76D+nwgP2LWPwS6NLywsbIIHZMqEs4B7nAZyNBH6walNmzbNiTiX0XfHrl275gSEZ6KLiwv6D04SCGFtdZgvWbIkFMmg2snOz2939+5dDMi8LlIGa6tDsWjRolnQhr3ATfLhOQ9/9OgRBtgxa0pKkMV83rx5S0E2pgwaNGj9mDFjfodj6GsbQVuCwHcJ9/X1XR8UFBRLAYf6RwjBRuAgDKaCxsJX8DUe24NEEM6LRlII+xj12wDHxHaYTdu2bfPgoWoevydjO5EQJoBgqIWqpKQESdnFr7/+uiOSQWDsRQEBAbhwhomMdZZfvXrVAzc6d+6Mwo+zNbelGltQCl9obHtpGX3UBmWvv/56ChBCPgqarYc6xP52yXUYqB4892cgZ989fvwY0yo52M5Zt27dyFpIobawA8eJJ0LniKA9IePTDoiP+/bt28PPnTs3FZTWLhpTOHatFQD4nAxjHV9+t9OyvoUk06+QwsM6L0MZA2U5kUIMmKRIaQz0iXt8fPwL6HjaAIC0qoBEvwJKPU9zH/RHRceOHcUEJGzu3LmzHt+z9PDwuNesWbOMnJwcqwcPHijBWAx3cHDYAPd3BgfVHwhVqpubm8rS0rIQ9I1zQkLCSLjWFu4xinSEGDSAZ2TXqlWr81D6geFteunSpeFACI/L6QyBUeWAeHJ9+/ZVzxSeOnVK53saSga1qCuuPrfDkP1kICApO0YOoSPoCHUgtqJy2WD83Ri0tNJRf2Hmwh8gyg/VDLS0FOtKpoCsDdhbtMG3ZAy8qm2WcHYHERERkTplyhRXfXfo9OnTB0DdUyQ6isKxVtMMYX2Xc6uLFy8OBf/pxjfffNMlNTXV9dChQ/2HDBmynXfgZSAmdd3jT7OhEkghnhdL/XaKtoV9kXv27Nmvs7OzrYEcJLz99tt5FFjRlhAKn20/AwSYGoEdnAT99GTZsmUREyZMmIizYZGRkRfGjx9/iJM+04W+c4mpqak6U8jc3Bz72Ejw3cOysjL1pAfYXbSt1jLXoYT9ZvCMdsC4671y5cpmYNtbE/HMlqkOc/CrMCDuHh0drc6Y8/HxwaBWAwlybhYWFjYlKSlp7ocffhjh5eX1ExzLwXED/MMfyWBgYOCegQMHnqYxKIasK4YNGzYjMzNzALRD1adPn5UwNpW3bt0Kwi/Bj9oEetj+999/n4i+F7iGCceOHVsAY8EXfs8k9cByd/96y5Yt/Gxl9YQQrl0PHyNodw+RPf67FvQdTxAXkDOJU6/z4Xskiv8WY0CgM34+efLkMBB2E84AuHz5cktQGBjV48CZywPhPu3o6BgnIZJRGxqCs9mT6rhMBlFq5FUFv3cWKav+NUUTq0E/OP9LLc7Ddt+GcyeRUFXVJ2MdvIHD2aJT+M4EGkEt2yKmjqr+ovcvVGQw9stcjxWRwUH8AdzGY0QKMQ1hC35u3rx5glglAkpOrZwaNGjwmJ4Pb3gaUlDD9rfffoucNm3aS2vXrp1JCi4X+JX6ryFAKaOx0ia9E2Ud00L/BQWjvPjeIaZ44WwhGnUXIoMYudqIzRI7eKFPfuUqVynFqJgSDNSEkJCQXfyz0dhHh7J9bGystrdvDAqxd8uWLTPhHpjSkQpE0C4mJqZTWlpa7mefffaOiYmJolu3breALJoOGDAgDvZxlqIZOIxvqVSqAVzlQg1iCKEJPNO+9+7dC4BxFcAfBJL5Gnw4yEUIlUolpmBx8JzVhBD3kRTivg4QI9ucQIZUWjqoYlLV0DGaJTESzuuSgyLkW4yMi+onHXSVIZEvsHH2dXxf34Erfb544sSJ6zSLVjW7A5/4DvQ1+Mzg5E3dVWmQLHTsTpNd1ykrQA8zhPqW86rgJRAPN39//9PgbHqmpKQobt68+RYQwgPkS8hBTOq6BwYEZsPnG9BmlL9YXi9w4mcJY2u47n7Pnj2/Jfv7mHS8qGeu56D+n8jCpk2bloD9aAXEozdlxaE/ge/w/k8HOUfCkgn+ifq5bd26debVq1f3CNbHSAESkqKjnNVWR9j8+fNX43Po2rVrEvg78z09PTGzyFLGOpDTqBYtWjQebG0fqKPU2to6X6KMNwTyNROI4G0ov3CVs4wYLLMBovaBg4NDNvCfs3QcMye0nR00HzNmzDKQi6GLFy/eDnJXZmZm1mXv3r1fLFy4ENP/uU8//fTA4MGDDxYXFzu/8847xyMiIvq+8cYbUa1bt8YJPme4/vtXX331JvllNRNCIng82dOc9UPid5x/dxA+LwEJxPOwklC6VgwhzIGH8DMI9zegUF7/9ttvnQsKCvS6at5LL72UOWPGjKMbNmzoc/z4cTd48K95e3vHwUA7K5exOnfunBc4qkocTKBIonWMiCpriDSJvbYm2IIivYAbQUFB3Xx9fe31UAevcJOEL2zroY6qc4l02ovsM23rcRWSQSEpnD59+j61d5Wf70eEyApI4jox44ffQIUFBEaYWvVM0MTFxcWNnDtUMhWlpaVqpQUGoIKr+29lfEhecVYA24K/cSwUVFwnSEHhrKEnGdgQieM3g+6Fv8cFFBSS1zQqmvvlnOD9Qy3gQIYOxxY6IXe2bds27uTJk33o+0GCYFZFVlYWOo1oEDvCNQNBoSrpHmJSzqwTExNfDg8PD3NycsK+awrP+DV49vY7d+4cMHr06EgdIrBV4MkfkkJMFcV3CD08PHQlhGLfqUri5E8TlSMSrhKc66WHPlAaoI8lv+clgUTXWFdhYaEZfHdG4n3FoMLc3BwDL7qkila30mciT5zgE1P9sMRTPZlS66iBnPFBCOE41Hm2Uw8zhPqWc7X/CGbNz9XVFTOf4sGv+n337t2eoBt7k07NlomY1HWPqtk9CjIdpH0p41dVw3Vow34m5xl1e4FIgqDvoL4mMo8cOVIEBGEMyjbYPvW7B+AfuFKgWJbAz1tvvZUBZCQHng2+Q7qC+klWaNTxJY3Tiri4ODsLC4uCYcOGRVFwRs52ZC9duvR7QCcc01CGDho06CMJt3YBv8Ad+j9v3Lhxa6D/S+l9xBTwPV4sKiqyAp97UXZ29hcdO3YcBWRuH6fdxBHK10v+/v63BwwYgCmojz7++ONJ3bt3T4TnjfLIxcTE3G/cuHFT4CEWvXv3fmBqavoz8J4gOB/7riVwrbfs7e3/B8S6qr6aCCHOFIwg8hcKjVkBxG8BzQ6iA+krcLJC6bwsIpB7JDD1a6ho/fz80kHwP9R3aLGkpASF+XJwcPAjcLSCbt++bQ0lmBziFBmqUKdR4EaHDh3SSdnm6nJDPUeXHCZPnvz5rVu3OsAg2QGEcJKeIliahlapZT1iDZVSEHnF1JH+eqinUU1f/PHHH36aJJHIivaW1tS0AsapEQizubOz858ZvK1txaRJk6736NHj4DNWAM5Xs8ZnSWRNwJnFKWTc9hDxQ2KJwYG9UD4kPYBygWkI+6WMXXAaesfHx78kSBnl5s6dO0mQMlq1LyFl1AzfB4R2o6HGvPPksWPHxlpaWvaEYy3AWcmFfjSGZ2Lt5uZ2DcbDRZJHG1D+uEKrEaf9Qjlqrr19+/bOcD8fIINLyHloAXLeARRwix9//PF9IIQH5XAS8f1BnBkUAkkhLjADTryuukRv0ennkWqpjzYZoB3KGoiAGCde21kQzbrsN2zYMPT48eNNQf7KtwAoaCP2vtUSP6VSWa29A8fHRUexUP/+alb65ElhXC1OvbaoacVSJaenlGA9zBAaYhbKDsjfRPCheoHuE9og5caNG8eBo7tcJmJS1z2yqA1KQXvEtsn4vffe67hv375wIJxGbdq0+ebo0aNI/vlFBpEEmglSUcVme+k7qC+EUWxsrNOOHTtWgx9gAn51EhCaCvILTDkZX40C+5ptZ2eHPo5VQkJC6xYtWmTKLRsadTSFOjAiaoMrsY8aNWoXkBqcpX8scztwcigRiOJ3+GrI/v37mx4+fLj/4MGDxQZ71YvOpaenV62FQu8jfoLPIj8/34zIHZeamopcCgUpXYv72oD/UQ4+DF6Pa0nkubu7Z125cqUquA33U4IvlVNWVoZj9Xfw79s3b948H/R9A3BXMocOHRoNZPCxsD3VEkJaJAZZ8goQPiRK/IyR+n1CjZVFURj/DcekroleQfe4yMm7IlhthBC9KcwTdwCMREKoUCjQkXaSiRDaw8PopmbWLVvi4H3E6faivr6jS3ndunW7EhUVNXTz5s3o5JbqKWVU810PbNdqPUbJsL9CyODOkrkehcif0kjEueW4oig4TxY5OTmWQAiNBUJbBvuqWbNmXYWx9R3sn+Ge5rUb4/nqiETliqR1RTALSP7MaB9JoQXJPsrzUijjoPSnoI0k6DlltAxI0qP79++7TZ069WvQQ3eALCtBCTaHYjl79uxdQN5s4P5jQBG3uXjx4nxQwuisdszKymoAhl9sKrf9Dz/88F9wRqwDAwNXgLx0X7lyZQ+4bwtS/O3mzJnz1apVq4I4Hf5eBmcH8d3Bq1evqveRBAYHB6s/kSjid7rqklpkRmr6GE8mtE7l1LEuKXXWp5RRfpZTarvFEB/NuhoXFRW9TPYe9cQVcizE3rdaE+vp6ZkAzocKnBC3AwcOdHnzzTeTQAZngL1FB0SXDKDaVvpEPanrf/QZg3y7AuHU94qlmnIg9wyhvuXcCHSTe5MmTZ5A368mO9Js8eLFr8MzN09OTh4C+xGgx5U6EhNDkRtzGJu9wMluunDhwmMwXvH1iCMa/qC7IMgsegbdgCmjSDR6A5GxBpRcv37dIS8vT+3rgz9vrKP8PWt8y8rSygHqyKyZmQ1Xd1aSHHUovvjiizcbNWqU3rdv36OhoaHtcnNzi8CPOMdJzMyppg6cqFKnU0I9PaAfnYEM/kHjTUwdFUC+Hl+7ds2RPwD+CY4d+/bt26fB2G7FHwefzYb8RG0IYfGkSZMOT58+fc7AgQM3gyxkDR8+/C76MyNGjFheUFBgg/fHE4HgNhs7duzSmzdven7yySdnUlJSlL/++qsj9Jn/pk2bzLdu3foh76vUucooT/QEi8ws0Ph+hUzPvZgz7PsLpevXr/8X/6D69et3WyZBMT516pQXOKFNcQceyk+cji+cGyC6VDRz5swPYYA0nzJlyvyIiIj39BTB0lzJS6mHOoQK+ACnw+xiXW0RqdTFLNRQDEpIhdF0cKYGl5SU3AGilwpEMAsITsby5csXg1JB5YQK8I/PPvvMuLCw0Alk1B2UCq62xTk6OmZzdeejY5pFTyJ/LhSpQjlHFoJONb4v4a1r9I17NmW0Efx2lLVUCpRo7otNGc2cOHHioW3btg27c+dOD9jv8fjxY0wnyvP19Y0GRX/EEuDj49M2JiamFzjBVQoYiNWjgICAgyLl0/bbb7/FjAhcxRXfDbafO3cukvL/g/IiV/nXHD9w0v5epor8devWDcdv1TGcEcS0USSKSAiRKEqcJdRmfCdx0mcNxKZy6lKX1DrrS8qoijPcIjSadbVUqVQlZMP5RWV+lCvmio70tGnT9q1Zs2YoyEskFm9v76j58+dv4nRfdOsZyLXSJx/w0Zx9NAT0MEOobzm3AWcyrE+fPjcFQcnmXl5e7YAQtvvtt9+6gE4eBXaoSEdiYihyo2jcuLHTgwcPGq1du3ZYSEjIMbJ/+dWlD0tZtMaAKaPGgwYNevjjjz/m3L17t0F8fHzrXr16pZ89e9YpLi6uK5BdhYxDt4T0Bz4PJEvG4EfiYjLckydPzGV6PlV14KrFFy5caA32byWMC+eTJ0++CwQub8eOHd4SyFq1dSgUCvvRo0dn2tvb/7Bu3bpFQKhKOnbsiAth5Um4f8aECRMO7dq1a8zFixctPDw8isaNG4cTahm4Wjxw0LmnT59u0KRJk1LwY05w2qchZwLRPAeEsgCeqxu4OMldunRBAngJZAQntow9PT3Rv1OA3m0NTStr0aLFEScnJzzHFI55gUypwM/E32LO+ypG1Ad1h2kqCaG3DP87WOvgB0GJIaFRzySh8HBP88OlwhbY9C/gVLfR/MLFxaXglVdeSRsyZAj+/8de7mnajKQoEy4viysKCQ/OmTOnAzh4Nzjp706gk/M2baOz3kkEEdmqhdLH5YHxXTHMyb9GDryfzHUIDVU/IrYqLdsitg4vqiOJxo479Z+u9VSNTx2jwXWNaQ8Q8pCvvvpqJMhduYmJST58FkDJNTU1LcI/qgc5LAByYwOfpqBUbOHTAj4toVjjH9WDstnft2/fjyjKVZNMYy4qBizwncEAUkYYIMHZc0yZmMpV87+cWuoMQ/UV6iWcjcfz3PiAH43hn8jJNaPvu3KVKRwmJIu4+m8MtV8bZ1Lrd77gd6NMifr/1LCwMHXHzpgxQ00KEZGRkVxaWpo6dRRJohAwPtSkEHSOkQRd4iWTrNWXuuSu00tLnWGINskN28DAwEvgULUWHgQH49VFixad5GR4/5XkEgM0+Fc1liSPCdzTWUqps+fV6hWQt7ZcZaqUrn/5gjP9uNjZQv4Av2KpTL6Ipp/Tn/qjH1f9DKHafmmcH/ucZc965syZUQ8fPsTfwr344otrgEB9FB4ePu3UqVPLhSeOHTt28/nz54fjas5ARM6lp6e3RmLSrl27+E8++QQX4aorIwud1Zc/+OCDnUhuarhHfg3vfIohbPaga98HEjsZnOVssLE3oU2zKajKP5sXoJ4JvH/KVf5VUpK2eolfO0HEYnp8OzqLfE5o3zpwla97OJKdc6SA7zkKWErNhDNfsWJF+KVLl97BnbZt294H8q+e/GjVqtUvYLd+BkLyLn8ykTU3kcGaGuuA7ct5eXmKlJQUT/5kR0dHXN39VbLjZbrWAXrwZkFBgQWMWXUwBtcAmTVr1k7yi8RmICjJP/Ej3YIrLv+X/HgcU7iCuycFw49SHdq8h2lM925GuhbJKqbrmtJx9Aly6Tx89gp6BunkDzUmHwgD2Kl8kE5rQmggaBIfXnHpalxdSaj7UEfk0QNQUAei04yGENM7dfmPFlzmH4V3AAmkEQngAR2NlVJgLFS0r00EkE8FqUsp2pAzzb83kkeDSM46NNujrGZbrjqUgraoBP2naz3dN27cuDk6OtpD6gDx9fW9FRQUhOlB52s5DRX3K4mJiaOuXbvWHBSVDRhB66ysLJvi4mKz0tJSEywKhaIEF4+xtrYutLGxKXB2ds4FxZbv4eHxwN3dfTeQR4xyPq6FEHIkAxi19xEYYJztqnERHC11hqH6yphInitFdE1JznKJkGXQORg1QwJsTXJZTN895LRfMc5L2wWRJBjxKkIoFiIJYV2yIEWe60Ndcteprc4wRJvkhivZqH6k9/NJxo6SDZTjf7CMyR42IYdF/XcUJJMFOtxXk+jwK33u53RPFxUGLN/GLBaafbxIjtQJmYi+5GCZCEKoT9lzoj7qSWMnhnyoluTgdiTHHBf2wQA7BuKtJBITbcgNOrhvCl8/oVVHD4ggbDgz/F5UVFTg999/H+Xj4/NaQEDAHPoz8qbUj6j/V1Pm0VZO3MI1+g7q/ynoQ7JtTc8I7aIF/d5UTno2nh0FeYZQHWk0HoxIh2RQ2zyIZKBsHiEiJEcd8XROJ/LlcZyhfOIKsDdkqiOJgli2pLNuUb0JnPjsBt4/aUx15tGYz6Y6XGksF9DxLJEBORPy4cq5p8F7PvOzlNpjLvB5Suk3aR6rqI+EUJP4cJzu7zMIhcORezbnvJwE4xGVIh3rwU52ocIvg4sP/h496HrV2QyigWMTU137ctJSylQUAarLUJkSefEkY+pMTpUNGT8j7mkqRhn3NN06ixQYLq5ynchOaR2EsIrA0VjFdv1UWyO01BmG6qvnEbCSe0abgcGQqM4e5pLznsHJMEMIjnNFHcRGaipZdURHbhLOk0JvcjIvkx7NlKmO7hEREZExMTGtxVyEqwlOnjz57ToCZIaANTmyTjRW0qhv+MAc/99z+UTYLchuSSUmdZEbMyGJl0jYsA7vK1eudO/cufP95ORks6ysrMROnTqdF/iFmplHKgnjlh+vcgf1DQWhj2tGJMSMexqELaVxYMk9XR/kHidyhrCWOgrI97HingZ/M4lw5uihjlKZAll/CdQ3QsjAUJ9hIVAiFhKuF/69Ql0vgBlTHbakYK1IiQlfpK8gg1xKRusJKeU8un/ZP6SvDB2wkntGm4GBoX4BZbwhObJZnO6pqEJgKhofLLPT8hr8HXyALJE9nhpJPJK2OAmEzZQCJDZEDkyJAKRzT2deNDOPGBgYIXxe2LNnT9WPHTFihBF7fAwMfz8YSs6ZPmFgYHgOwAAZppA5c9oHyzAohjMVDzk9Bsj+4jpRV8JmTEXoFJdzNWR2GaKv/i51MDBCqDeFxQYtA8PfnxQaQs6ZPmFgYGBgOrG+9tXfpQ4GRggZGBgYGBgYGBgYGBgY6imMWRcwMDAwMDAwMDAwMDAwQsjAwMDAwMDAwMDAwMDwD8L/CzAAUxE84n7mIpAAAAAASUVORK5CYII=);
+	background-position: 0;
+	background-repeat: no-repeat;
+	text-indent: -9999px;
+}
+@media
+only screen and (-webkit-min-device-pixel-ratio: 2),
+only screen and (   min--moz-device-pixel-ratio: 2),
+only screen and (     -o-min-device-pixel-ratio: 2/1),
+only screen and (        min-device-pixel-ratio: 2),
+only screen and (                min-resolution: 192dpi),
+only screen and (                min-resolution: 2dppx) {
+
+	.redactor_toolbar li a {
+		background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABwgAAAAyCAYAAABI1Y/DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2hpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpCQTAzNkE5MzBENTdFMTExODJDNjhBMUI3REEyODQzMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3QjA3Mzk4OEJBMkExMUUyODgwRjgyOEZCRDVFNjYzMyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3QjA3Mzk4N0JBMkExMUUyODgwRjgyOEZCRDVFNjYzMyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChNYWNpbnRvc2gpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDU4MDExNzQwNzIwNjgxMTgyMkE5Q0VDNTNDRTc5RkEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QkEwMzZBOTMwRDU3RTExMTgyQzY4QTFCN0RBMjg0MzAiLz4gPC9yZGY6RGVzY3Jp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);
+		background-size: auto 25px;
+	}
+
+}
+.redactor_toolbar li a:hover {
+	outline: none;
+	border-color: #98a6ba;
+	border-color: rgba(162, 185, 208, .8);
+	background-color: #d4dce9;
+	background-color: rgba(176, 199, 223, .5);
+}
+.redactor_toolbar li a:active,
+.redactor_toolbar li a.redactor_act {
+	outline: none;
+	border-color: #b5b5b5;
+	background-color: #ddd;
+}
+.redactor_button_disabled {
+	opacity: .3 ;
+}
+.redactor_button_disabled:hover {
+	outline: none;
+	border-color: transparent !important;
+	background-color: transparent !important;
+	cursor: default;
+}
+
+/*
+	BUTTONS
+	step 25px
+*/
+body .redactor_toolbar li a.redactor_btn_html				{ background-position: 0px; }
+body .redactor_toolbar li a.redactor_btn_formatting		    { background-position: -25px; }
+body .redactor_toolbar li a.redactor_btn_bold				{ background-position: -50px; }
+body .redactor_toolbar li a.redactor_btn_italic			    { background-position: -75px; }
+body .redactor_toolbar li a.redactor_btn_deleted		 	{ background-position: -500px; }
+body .redactor_toolbar li a.redactor_btn_unorderedlist 	    { background-position: -100px; }
+body .redactor_toolbar li a.redactor_btn_orderedlist   	    { background-position: -125px; }
+body .redactor_toolbar li a.redactor_btn_outdent	 		{ background-position: -150px; }
+body .redactor_toolbar li a.redactor_btn_indent		 	  	{ background-position: -175px; }
+body .redactor_toolbar li a.redactor_btn_image		 		{ background-position: -200px; }
+body .redactor_toolbar li a.redactor_btn_video		 		{ background-position: -225px; }
+body .redactor_toolbar li a.redactor_btn_file		 		{ background-position: -250px; }
+body .redactor_toolbar li a.redactor_btn_table		 		{ background-position: -275px; }
+body .redactor_toolbar li a.redactor_btn_link		 		{ background-position: -300px; }
+body .redactor_toolbar li a.redactor_btn_fontcolor		 	{ background-position: -325px; }
+body .redactor_toolbar li a.redactor_btn_backcolor		 	{ background-position: -350px; }
+body .redactor_toolbar li a.redactor_btn_alignleft		  	{ background-position: -375px; }
+body .redactor_toolbar li a.redactor_btn_aligncenter		{ background-position: -400px; }
+body .redactor_toolbar li a.redactor_btn_alignright		  	{ background-position: -425px; }
+body .redactor_toolbar li a.redactor_btn_justify		 	{ background-position: -450px; }
+body .redactor_toolbar li a.redactor_btn_horizontalrule 	{ background-position: -475px; }
+body .redactor_toolbar li a.redactor_btn_underline		 	{ background-position: -525px; }
+
+body .redactor_toolbar li a.redactor_btn_fullscreen		 	{ background-position: -550px; }
+body .redactor_toolbar li a.redactor_btn_normalscreen		{ background-position: -575px; }
+body .redactor_toolbar li a.redactor_btn_clips		 		{ background-position: -600px; }
+
+body .redactor_toolbar li a.redactor_btn_alignment	 		{ background-position: -625px; }
+
+body .redactor_toolbar li a.redactor_btn_fontfamily	 		{ background-position: -650px; }
+body .redactor_toolbar li a.redactor_btn_fontsize	 		{ background-position: -675px; }
+
+body .redactor_toolbar li a.redactor_btn_direction	 		{ background-position: -700px; }
+body .redactor_toolbar li a.redactor_btn_lists		 		{ background-position: -725px; }
+body .redactor_toolbar li a.redactor_btn_font		 		{ background-position: -750px; }
+
+body .redactor_toolbar li a.redactor_btn_h1			 		{ background-position: -775px; }
+body .redactor_toolbar li a.redactor_btn_h2			 		{ background-position: -800px; }
+body .redactor_toolbar li a.redactor_btn_h3			 		{ background-position: -825px; }
+body .redactor_toolbar li a.redactor_btn_quote		 		{ background-position: -850px; }
+body .redactor_toolbar li a.redactor_btn_pre		 		{ background-position: -875px; }
+
+/*
+	Toolbar classes
+*/
+.redactor_format_blockquote {
+	padding-left: 10px;
+	color: #666 !important;
+	font-style: italic;
+}
+.redactor_format_pre {
+	font-family: monospace, sans-serif;
+}
+.redactor_format_h1,
+.redactor_format_h2,
+.redactor_format_h3,
+.redactor_format_h4,
+.redactor_format_h5 {
+	font-weight: bold;
+}
+.redactor_format_h1 {
+	font-size: 30px;
+	line-height: 36px;
+}
+.redactor_format_h2 {
+	font-size: 24px;
+	line-height: 36px;
+}
+.redactor_format_h3 {
+	font-size: 20px;
+	line-height: 30px;
+}
+.redactor_format_h4 {
+	font-size: 16px;
+	line-height: 26px;
+}
+.redactor_format_h5 {
+	font-size: 14px;
+	line-height: 23px;
+}
+
+
+/*
+	DROPDOWN
+*/
+.redactor_dropdown {
+	position: absolute;
+	top: 28px;
+	left: 0;
+	z-index: 2004;
+	padding: 10px;
+	width: 200px;
+	border: 1px solid #ccc;
+	background-color: #fff;
+	box-shadow: 0 2px 4px #ccc;
+	font-size: 13px;
+	font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+	line-height: 21px;
+}
+.redactor_separator_drop {
+	padding: 0 !important;
+	border-top: 1px solid #ddd;
+	font-size: 0;
+	line-height: 0;
+}
+.redactor_dropdown a {
+	display: block;
+	padding: 3px 5px;
+	color: #000;
+	text-decoration: none;
+}
+.redactor_dropdown a:hover {
+	background-color: #dde4ef;
+	color: #444 !important;
+	text-decoration: none;
+}
+
+/* MODAL */
+#redactor_modal_overlay {
+	position: fixed;
+	top: 0;
+	left: 0;
+	z-index: 50000;
+	margin: auto;
+	width: 100%;
+	height: 100%;
+
+	background-color: #333 !important;
+	opacity: 0.50;
+	-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+	filter:alpha(opacity=50);
+}
+
+#redactor_modal {
+	position: fixed;
+	top: 30%;
+	left: 50%;
+  	z-index: 50001;
+	padding: 0;
+  	border-radius: 3px;
+	background: #f5f5f5;
+	box-shadow: 0px 5px 60px #000;
+	color: #000;
+	text-shadow: 0 1px 0 #fff;
+	font-size: 12px !important;
+	font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+
+}
+#redactor_modal header {
+	padding: 11px 30px 0 15px;
+	border-radius: 3px 3px 0 0;
+	font-weight: bold;
+	font-size: 12px;
+}
+#redactor_modal section {
+	padding: 20px 30px;
+
+}
+#redactor_modal_close {
+	position: absolute;
+	top: 5px;
+	right: 5px;
+	width: 20px;
+	height: 20px;
+	color: #777;
+	font-size: 20px;
+	cursor: pointer;
+}
+#redactor_modal_close:hover {
+	color: #000;
+}
+#redactor_modal label {
+	display: block !important;
+	float: none !important;
+	margin: 10px 0 3px 0 !important;
+	padding: 0 !important;
+	font-size: 12px !important;
+}
+#redactor_modal textarea {
+	display: block;
+	margin-top: 4px;
+}
+.redactor_input  {
+	width: 99%;
+	font-size: 14px;
+}
+.redactor_modal_box {
+	overflow: auto;
+	margin-bottom: 10px;
+	height: 350px;
+}
+#redactor_image_box {
+	overflow: auto;
+	margin-bottom: 10px;
+	height: 270px;
+}
+#redactor_image_box_select {
+	display: block;
+	margin-bottom: 15px !important;
+	width: 200px;
+}
+#redactor_image_box img {
+	margin-right: 10px;
+	margin-bottom: 10px;
+	max-width: 100px;
+	cursor: pointer;
+}
+#redactor_tabs {
+	margin-bottom: 18px;
+}
+#redactor_tabs a {
+	display: inline-block;
+	margin-right: 5px;
+	padding: 4px 14px;
+	border: 1px solid #d2d2d2;
+	border-radius: 10px;
+	background-color: #fff;
+	color: #000;
+	text-decoration: none;
+	font-size: 12px;
+	line-height: 1;
+}
+#redactor_tabs a:hover, #redactor_tabs a.redactor_tabs_act {
+	padding: 5px 15px;
+	border: none;
+	background-color: #ddd;
+	box-shadow: 0 1px 2px rgba(0, 0, 0, .4) inset;
+	color: #777 !important;
+	text-decoration: none !important;
+	text-shadow: 0 1px 0 #eee;
+}
+#redactor_modal footer {
+	padding: 9px 30px 20px 30px;
+	border-radius: 0 0 3px 3px;
+	text-align: right;
+}
+
+#redactor_modal input[type="radio"],
+#redactor_modal input[type="checkbox"] {
+	position: relative;
+	top: -1px;
+}
+#redactor_modal input[type="text"],
+#redactor_modal input[type="password"],
+#redactor_modal input[type="email"],
+#redactor_modal textarea {
+	position: relative;
+	z-index: 2;
+	margin: 0;
+	padding: 1px 2px;
+	height: 23px;
+	border: 1px solid #ccc;
+	border-radius: 1px;
+	background-color: white;
+	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+	color: #333;
+	font-size: 13px;
+	font-family: Helvetica, Arial, Tahoma, sans-serif;
+	line-height: 1;
+	-webkit-transition: border 0.3s ease-in;
+	-moz-transition: border 0.3s ease-in;
+	-ms-transition: border 0.3s ease-in;
+	-o-transition: border 0.3s ease-in;
+	transition: border 0.3s ease-in;
+}
+#redactor_modal textarea {
+	line-height: 1.4em;
+}
+#redactor_modal input:focus,
+#redactor_modal textarea:focus {
+	outline: none;
+	border-color: #5ca9e4;
+	box-shadow: 0 0 0 2px rgba(70, 161, 231, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+}
+.redactor_modal_btn {
+	position: relative;
+	display: inline-block;
+	margin-left: 8px;
+	padding: 6px 16px 5px 16px;
+	outline: none;
+	border: 1px solid #ccc;
+	border-bottom-color: #aaa;
+	border-radius: 4px;
+	background-color: #f3f3f3;
+	background-image: -moz-linear-gradient(top, #ffffff, #e1e1e1);
+	background-image: -ms-linear-gradient(top, #ffffff, #e1e1e1);
+	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e1e1e1));
+	background-image: -webkit-linear-gradient(top, #ffffff, #e1e1e1);
+	background-image: -o-linear-gradient(top, #ffffff, #e1e1e1);
+	background-image: linear-gradient(top, #ffffff, #e1e1e1);
+	box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
+	color: #000;
+	text-align: center;
+	text-decoration: none;
+	text-shadow: 0 1px 0px #ffffff;
+	font-weight: normal;
+	font-size: 12px;
+	font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif;
+	line-height: 1;
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e1e1e1', GradientType=0);
+	cursor: pointer;
+}
+.redactor_modal_btn:hover {
+	color: #555;
+	background: none;
+	background: #f3f3f3;
+	text-decoration: none;
+	text-shadow: 0 1px 0px rgba(255, 255, 255, 0.8);
+	filter: none;
+}
+
+
+/* Drag and Drop Area */
+.redactor_droparea {
+	position: relative;
+    margin: auto;
+    margin-bottom: 5px;
+    width: 100%;
+}
+.redactor_droparea .redactor_dropareabox {
+	position: relative;
+	z-index: 1;
+    padding: 60px 0;
+    width: 99%;
+    border: 2px dashed #bbb;
+    background-color: #fff;
+    text-align: center;
+}
+.redactor_droparea .redactor_dropareabox, .redactor_dropalternative {
+    color: #555;
+    font-size: 12px;
+}
+.redactor_dropalternative {
+	margin: 4px 0 2px 0;
+}
+.redactor_dropareabox.hover {
+    border-color: #aaa;
+    background: #efe3b8;
+}
+.redactor_dropareabox.error {
+    border-color: #dcc3c3;
+    background: #f7e5e5;
+}
+.redactor_dropareabox.drop {
+    border-color: #e0e5d6;
+    background: #f4f4ee;
+}
+
+/* =Progress
+-----------------------------------------------------------------------------*/
+#redactor-progress-drag {
+	position: fixed;
+	top: 50%;
+	left: 50%;
+	width: 200px;
+	margin-left: -130px;
+	margin-top: -35px;
+	z-index: 10000;
+	padding: 30px;
+	background: rgba(0, 0, 0, .7);
+	box-shadow: none;
+}
+.redactor-progress {
+	height: 12px;
+	overflow: hidden;
+	background-color: #f4f4f4;
+	border-radius: 3px;
+	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
+	margin-bottom: 1.5em;
+}
+.redactor-progress .redactor-progress-bar {
+	top: 1px;
+	left: 1px;
+	position: relative;
+	background-color: #55aaff;
+	width: 0;
+	height: 12px;
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	-ms-box-sizing: border-box;
+	box-sizing: border-box;
+
+}
+.redactor-progress-striped .redactor-progress-bar {
+	background-image: url('data:image/gif;base64,R0lGODlhIAAQAIABAP///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowMTgwMTE3NDA3MjA2ODExODE3QTgyOEM0MzAwRkUyMyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3NEY2MUMyQTlDMzgxMUUwOUFFQ0M4MEYwM0YzNUE2RCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3NEY2MUMyOTlDMzgxMUUwOUFFQ0M4MEYwM0YzNUE2RCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAxODAxMTc0MDcyMDY4MTE4MTdBODI4QzQzMDBGRTIzIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAxODAxMTc0MDcyMDY4MTE4MTdBODI4QzQzMDBGRTIzIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkECQoAAQAsAAAAACAAEAAAAiwMjqkQ7Q/bmijaR+ndee7bLZ8VKmNUJieUVqvTHi8cz1Jtx0yOz7pt6L10BQAh+QQJCgABACwAAAAAIAAQAAACLYwNqctwD2GbKtpH6d157ts1nxUyY1Qup5QmK9Y6LxLPdGsHsTvv8uuzBXuhAgAh+QQJCgABACwAAAAAIAAQAAACLIx/oMsNCKNxdMk7K8VXbx55DhiKDAmZJ5qoFhu4LysrcFzf9QPvet4D0igFACH5BAkKAAEALAAAAAAgABAAAAIsjI8Hy+2QYnyUyWtqxVdvnngUGIoOiZgnmqkWG7gvKy9wXN81BO963gPSGAUAIfkECQoAAQAsAAAAACAAEAAAAixEjqkB7Q/bmijaR+ndee7bLZ8VKmNUJieUVqvTHi8cz1Jtx0yOz7pt6L10BQAh+QQJCgABACwAAAAAIAAQAAACLYQdqctxD2GbKtpH6d157ts1nxUyY1Qup5QmK9Y6LxLPdGsDsTvv8uuzBXuhAgAh+QQJCgABACwAAAAAIAAQAAACLIR/ocsdCKNxdMk7K8VXbx55DhiKDAmZJ5qoFgu4LysrcFzf9QPvet4D0igFACH5BAUKAAEALAAAAAAgABAAAAIshI8Xy+2RYnyUyWtqxVdvnngUGIoOiZgnmqkWC7gvKy9wXN81BO963gPSGAUAOw==');
+}
+.redactor-progress-striped .redactor-progress-bar:after {
+	content: "";
+	position: absolute;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA6lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFRTE5QjlCQTlDMkQxMUUwOUFFQ0M4MEYwM0YzNUE2RCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowNkRFQUIzNjlDMkUxMUUwOUFFQ0M4MEYwM0YzNUE2RCI+IDxkYzp0aXRsZT4gPHJkZjpBbHQ+IDxyZGY6bGkgeG1sOmxhbmc9IngtZGVmYXVsdCI+Z3JhZGllbnQ8L3JkZjpsaT4gPC9yZGY6QWx0PiA8L2RjOnRpdGxlPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFRTE5QjlCODlDMkQxMUUwOUFFQ0M4MEYwM0YzNUE2RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFRTE5QjlCOTlDMkQxMUUwOUFFQ0M4MEYwM0YzNUE2RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pq477Q0AAAD2SURBVHjaxFIxDsIwDLRF/1AmRp7AM9iYWHkD76AP6h9Qi1SGfqAMqGJg6XA4jts0RUwZiKLEsZ3L+Rwmoi0lDC6Ky4rAMuGO5DY5iuWH93oDegMuK8QA7JIYCMDpvwDDMBzNHCGtONYq2enjHKYLMObCp7dtu/+FDppDgyJpTemsrm/9l7L2ku4aUy4BTEmKR1hmVXV9OjfsqlqC7irAhBKxDnmOQdPc+ynKMXdenEELAFmzrnu8RoK6jpRhHkGJmFgdXmsByNf5Wx+fJPbigEI3OKrB77Bfy2VZzppqC0IfAtlIAusC9CNtUn/iIRXgnALwEWAA/+5+ZNOapmcAAAAASUVORK5CYII=');
+}
+
+
diff --git a/css/thread.css b/css/thread.css
new file mode 100644
index 0000000000000000000000000000000000000000..9623bcf25466d22155c67ae03b2b6e2a6dddfbdc
--- /dev/null
+++ b/css/thread.css
@@ -0,0 +1,412 @@
+/*!
+ * Bootstrap v3.0.0
+ *
+ * Copyright 2013 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */
+
+/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
+.thread-body article,
+.thread-body aside,
+.thread-body details,
+.thread-body figcaption,
+.thread-body figure,
+.thread-body footer,
+.thread-body header,
+.thread-body hgroup,
+.thread-body main,
+.thread-body nav,
+.thread-body section,
+.thread-body summary {
+  display: block;
+}
+.thread-body {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 14px !important;
+  line-height: 1.428571429;
+  color: #333333;
+  background-color: #ffffff;
+  margin: 0;
+  padding: 0.5em;
+}
+.thread-body a:focus {
+  outline: thin dotted;
+}
+.thread-body a:active,
+.thread-body a:hover {
+  outline: 0;
+}
+.thread-body h1 {
+  font-size: 2em;
+  margin: 0.67em 0;
+}
+.thread-body abbr[title] {
+  border-bottom: 1px dotted;
+}
+.thread-body b,
+.thread-body strong {
+  font-weight: bold;
+}
+.thread-body dfn {
+  font-style: italic;
+}
+.thread-body hr {
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+  height: 0;
+}
+.thread-body mark {
+  background: #ff0;
+  color: #000;
+}
+.thread-body code,
+.thread-body kbd,
+.thread-body pre,
+.thread-body samp {
+  font-family: monospace, serif;
+  font-size: 1em;
+}
+.thread-body pre {
+  white-space: pre-wrap;
+}
+.thread-body q {
+  quotes: "\201C" "\201D" "\2018" "\2019";
+}
+.thread-body small {
+  font-size: 80%;
+}
+.thread-body sub,
+.thread-body sup {
+  font-size: 75%;
+  line-height: 0;
+  position: relative;
+  vertical-align: baseline;
+}
+.thread-body sup {
+  top: -0.5em;
+}
+.thread-body sub {
+  bottom: -0.25em;
+}
+.thread-body img {
+  border: 0;
+}
+.thread-body svg:not(:root) {
+  overflow: hidden;
+}
+.thread-body table {
+  border-collapse: collapse;
+  border-spacing: 0;
+}
+.thread-body *,
+.thread-body *:before,
+.thread-body *:after {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+.thread-body a {
+  color: #428bca;
+  text-decoration: none;
+}
+.thread-body a:hover,
+.thread-body a:focus {
+  color: #2a6496;
+  text-decoration: underline;
+}
+.thread-body a:focus {
+  outline: thin dotted #333;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+.thread-body img {
+  vertical-align: middle;
+}
+.thread-body hr {
+  margin-top: 20px;
+  margin-bottom: 20px;
+  border: 0;
+  border-top: 1px solid #eeeeee;
+}
+.thread-body .sr-only {
+  position: absolute;
+  width: 1px;
+  height: 1px;
+  margin: -1px;
+  padding: 0;
+  overflow: hidden;
+  clip: rect(0 0 0 0);
+  border: 0;
+}
+.thread-body p {
+  margin: 0 0 10px;
+}
+.thread-body .lead {
+  margin-bottom: 20px;
+  font-size: 16.099999999999998px;
+  font-weight: 200;
+  line-height: 1.4;
+}
+@media (min-width: 768px) {
+  .thread-body .lead {
+    font-size: 21px;
+  }
+}
+.thread-body small {
+  font-size: 85%;
+}
+.thread-body cite {
+  font-style: normal;
+}
+.thread-body .text-muted {
+  color: #999999;
+}
+.thread-body .text-primary {
+  color: #428bca;
+}
+.thread-body .text-warning {
+  color: #c09853;
+}
+.thread-body .text-danger {
+  color: #b94a48;
+}
+.thread-body .text-success {
+  color: #468847;
+}
+.thread-body .text-info {
+  color: #3a87ad;
+}
+.thread-body .text-left {
+  text-align: left;
+}
+.thread-body .text-right {
+  text-align: right;
+}
+.thread-body .text-center {
+  text-align: center;
+}
+.thread-body h1,
+.thread-body h2,
+.thread-body h3,
+.thread-body h4,
+.thread-body h5,
+.thread-body h6,
+.thread-body .h1,
+.thread-body .h2,
+.thread-body .h3,
+.thread-body .h4,
+.thread-body .h5,
+.thread-body .h6 {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-weight: 500;
+  line-height: 1.1;
+  color: black;
+}
+.thread-body h1 small,
+.thread-body h2 small,
+.thread-body h3 small,
+.thread-body h4 small,
+.thread-body h5 small,
+.thread-body h6 small,
+.thread-body .h1 small,
+.thread-body .h2 small,
+.thread-body .h3 small,
+.thread-body .h4 small,
+.thread-body .h5 small,
+.thread-body .h6 small {
+  font-weight: normal;
+  line-height: 1;
+  color: #999999;
+}
+.thread-body h1,
+.thread-body h2,
+.thread-body h3 {
+  margin-top: 20px;
+  margin-bottom: 10px;
+}
+.thread-body h4,
+.thread-body h5,
+.thread-body h6 {
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+.thread-body h1,
+.thread-body .h1 {
+  font-size: 36px;
+}
+.thread-body h2,
+.thread-body .h2 {
+  font-size: 30px;
+}
+.thread-body h3,
+.thread-body .h3 {
+  font-size: 24px;
+}
+.thread-body h4,
+.thread-body .h4 {
+  font-size: 18px;
+}
+.thread-body h5,
+.thread-body .h5 {
+  font-size: 14px;
+}
+.thread-body h6,
+.thread-body .h6 {
+  font-size: 12px;
+}
+.thread-body h1 small,
+.thread-body .h1 small {
+  font-size: 24px;
+}
+.thread-body h2 small,
+.thread-body .h2 small {
+  font-size: 18px;
+}
+.thread-body h3 small,
+.thread-body .h3 small,
+.thread-body h4 small,
+.thread-body .h4 small {
+  font-size: 14px;
+}
+.thread-body .page-header {
+  padding-bottom: 9px;
+  margin: 40px 0 20px;
+  border-bottom: 1px solid #eeeeee;
+}
+.thread-body ul,
+.thread-body ol {
+  margin-top: 0;
+  margin-bottom: 10px;
+}
+.thread-body ul ul,
+.thread-body ol ul,
+.thread-body ul ol,
+.thread-body ol ol {
+  margin-bottom: 0;
+}
+.thread-body .list-unstyled {
+  padding-left: 0;
+  list-style: none;
+}
+.thread-body .list-inline {
+  padding-left: 0;
+  list-style: none;
+}
+.thread-body .list-inline > li {
+  display: inline-block;
+  padding-left: 5px;
+  padding-right: 5px;
+}
+.thread-body blockquote {
+  padding: 10px 20px;
+  margin: 0 0 20px;
+  border-left: 5px solid #eeeeee;
+}
+.thread-body blockquote p {
+  font-size: 17.5px;
+  font-weight: 300;
+  line-height: 1.25;
+}
+.thread-body blockquote p:last-child {
+  margin-bottom: 0;
+}
+.thread-body blockquote small {
+  display: block;
+  line-height: 1.428571429;
+  color: #999999;
+}
+.thread-body blockquote small:before {
+  content: '\2014 \00A0';
+}
+.thread-body blockquote.pull-right {
+  padding-right: 15px;
+  padding-left: 0;
+  border-right: 5px solid #eeeeee;
+  border-left: 0;
+}
+.thread-body blockquote.pull-right p,
+.thread-body blockquote.pull-right small {
+  text-align: right;
+}
+.thread-body blockquote.pull-right small:before {
+  content: '';
+}
+.thread-body blockquote.pull-right small:after {
+  content: '\00A0 \2014';
+}
+.thread-body q:before,
+.thread-body q:after,
+.thread-body blockquote:before,
+.thread-body blockquote:after {
+  content: "";
+}
+.thread-body address {
+  display: block;
+  margin-bottom: 20px;
+  font-style: normal;
+  line-height: 1.428571429;
+}
+.thread-body th {
+  text-align: left;
+}
+.thread-body table {
+  max-width: 100%;
+  background-color: transparent;
+  width: auto;
+  margin-bottom: 20px;
+}
+.thread-body table thead > tr > td,
+.thread-body table thead > tr > th,
+.thread-body table tr > th {
+  background-color: #f0f0f0 !important;
+  font-weight: bold;
+}
+.thread-body table thead > tr > th,
+.thread-body table tbody > tr > th,
+.thread-body table tfoot > tr > th,
+.thread-body table thead > tr > td,
+.thread-body table tbody > tr > td,
+.thread-body table tfoot > tr > td {
+  padding: 8px;
+  line-height: 1.428571429;
+  vertical-align: top;
+  border-top: 1px solid #dddddd;
+}
+.thread-body table thead > tr > th {
+  vertical-align: bottom;
+  border-bottom: 2px solid #dddddd;
+}
+.thread-body table caption + thead tr:first-child th,
+.thread-body table colgroup + thead tr:first-child th,
+.thread-body table thead:first-child tr:first-child th,
+.thread-body table caption + thead tr:first-child td,
+.thread-body table colgroup + thead tr:first-child td,
+.thread-body table thead:first-child tr:first-child td {
+  border-top: 0;
+}
+.thread-body table tbody + tbody {
+  border-top: 2px solid #dddddd;
+}
+.thread-body table table {
+  background-color: #ffffff;
+}
+.thread-body table thead > tr > th,
+.thread-body table tbody > tr > th,
+.thread-body table tfoot > tr > th,
+.thread-body table thead > tr > td,
+.thread-body table tbody > tr > td,
+.thread-body table tfoot > tr > td {
+  padding: 5px;
+}
+.thread-body table col[class*="col-"] {
+  float: none;
+  display: table-column;
+}
+.thread-body table td[class*="col-"],
+.thread-body table th[class*="col-"] {
+  float: none;
+  display: table-cell;
+}
diff --git a/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
index 954e22dbd99e8c6dd7091335599abf2d10bf8003..1809bf651d75d41c9ea648e8e1cc2e647781405a 100644
Binary files a/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and b/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png differ
diff --git a/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
index 64ece5707d91a6edf9fad4bfcce0c4dbcafcf58d..d19ed46b851e3855f75e337ed6d34875da412fe0 100644
Binary files a/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and b/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png differ
diff --git a/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
index abdc01082bf3534eafecc5819d28c9574d44ea89..a0d671ae107a7f099054385498c863964fdfb2e5 100644
Binary files a/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and b/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png differ
diff --git a/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
index 9b383f4d2eab09c0f2a739d6b232c32934bc620b..a56e90d081556c1de237c763a5cce6c66a4cc6f2 100644
Binary files a/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and b/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png differ
diff --git a/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
index a23baad25b1d1ff36e17361eab24271f2e9b7326..6a6a2e1bde8f31e606f768620bf9f1756cf41a08 100644
Binary files a/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and b/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png differ
diff --git a/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
index 42ccba269b6e91bef12ad0fa18be651b5ef0ee68..aa527fea06911eb27663c94504883ec99e8a87f1 100644
Binary files a/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and b/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
index 39d5824d6af5456f1e89fc7847ea3599ea5fd815..f7855bf1e32ef6141a69aabaf27a3d7ad90aa258 100644
Binary files a/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and b/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png differ
diff --git a/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
index f1273672d253263b7564e9e21d69d7d9d0b337d9..fd6dc2ac238839b9808b8cf845af0b480360e0bc 100644
Binary files a/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and b/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ
diff --git a/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
index 359397acffdd84bd102f0e8a951c9d744f278db5..155c7e35a0c2a619d58e508d24ac6b4625d32061 100644
Binary files a/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and b/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png differ
diff --git a/css/ui-lightness/images/ui-icons_222222_256x240.png b/css/ui-lightness/images/ui-icons_222222_256x240.png
index b273ff111d219c9b9a8b96d57683d0075fb7871a..c1cb1170c8b3795835b8831ab81fa9ae63b606b1 100644
Binary files a/css/ui-lightness/images/ui-icons_222222_256x240.png and b/css/ui-lightness/images/ui-icons_222222_256x240.png differ
diff --git a/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/css/ui-lightness/images/ui-icons_228ef1_256x240.png
index a641a371afa0fbb08ba599dc7ddf14b9bfc3c84f..3a0140cff67999e0b6daf269723e019335f5fee6 100644
Binary files a/css/ui-lightness/images/ui-icons_228ef1_256x240.png and b/css/ui-lightness/images/ui-icons_228ef1_256x240.png differ
diff --git a/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
index 85e63e9f604ce042d59eb06a8428eeb7cb7896c9..036ee072d4aea1db3a78cbede62f8a0ba31972dc 100644
Binary files a/css/ui-lightness/images/ui-icons_ef8c08_256x240.png and b/css/ui-lightness/images/ui-icons_ef8c08_256x240.png differ
diff --git a/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
index e117effa3dca24e7978cfc5f8b967f661e81044f..8b6c05868b55d63ff932afa2efbd9d7cedd5909a 100644
Binary files a/css/ui-lightness/images/ui-icons_ffd27a_256x240.png and b/css/ui-lightness/images/ui-icons_ffd27a_256x240.png differ
diff --git a/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/css/ui-lightness/images/ui-icons_ffffff_256x240.png
index 42f8f992c727ddaa617da224a522e463df690387..4f624bb2b193750f1a5b36c8c307168c6681a861 100644
Binary files a/css/ui-lightness/images/ui-icons_ffffff_256x240.png and b/css/ui-lightness/images/ui-icons_ffffff_256x240.png differ
diff --git a/css/ui-lightness/jquery-ui-1.10.3.custom.min.css b/css/ui-lightness/jquery-ui-1.10.3.custom.min.css
new file mode 100755
index 0000000000000000000000000000000000000000..90265f613b6fd0ed3b90f3a014d8ad2658956e33
--- /dev/null
+++ b/css/ui-lightness/jquery-ui-1.10.3.custom.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.10.3 - 2013-08-24
+* http://jqueryui.com
+* Includes: jquery.ui.core.css, jquery.ui.datepicker.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
+* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.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}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.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 #fbcb09;background:#fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_ffffff_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_228ef1_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_ffd27a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px}
\ No newline at end of file
diff --git a/image.php b/image.php
new file mode 100644
index 0000000000000000000000000000000000000000..405c87c9f6de2df262738aded389343189285331
--- /dev/null
+++ b/image.php
@@ -0,0 +1,31 @@
+<?php
+/*********************************************************************
+    image.php
+
+    Simply downloads the file...on hash validation as follows;
+
+    * Hash must be 64 chars long.
+    * First 32 chars is the perm. file hash
+    * Next 32 chars  is md5(file_id.session_id().file_hash)
+
+    Peter Rotich <peter@osticket.com>
+    Copyright (c)  2006-2013 osTicket
+    http://www.osticket.com
+
+    Released under the GNU General Public License WITHOUT ANY WARRANTY.
+    See LICENSE.TXT for details.
+
+    vim: expandtab sw=4 ts=4 sts=4:
+**********************************************************************/
+
+require('client.inc.php');
+require_once(INCLUDE_DIR.'class.file.php');
+$h=trim($_GET['h']);
+//basic checks
+if(!$h  || strlen($h)!=64  //32*2
+        || !($file=AttachmentFile::lookup(substr($h,0,32))) //first 32 is the file hash.
+        || strcasecmp($h, $file->getDownloadHash())) //next 32 is file id + session hash.
+    Http::response(404, 'Unknown or invalid file');
+
+$file->display();
+?>
diff --git a/include/ajax.config.php b/include/ajax.config.php
index 2a01e284071ca6122024ffc78c390759f3b48467..5a1ff54206a27c2540baa6664875005a9ffbf03e 100644
--- a/include/ajax.config.php
+++ b/include/ajax.config.php
@@ -15,7 +15,7 @@
 **********************************************************************/
 
 if(!defined('INCLUDE_DIR')) die('!');
-	    
+
 class ConfigAjaxAPI extends AjaxController {
 
     //config info UI might need.
@@ -24,7 +24,8 @@ class ConfigAjaxAPI extends AjaxController {
 
         $config=array(
                       'lock_time'       => ($cfg->getLockTime()*3600),
-                      'max_file_uploads'=> (int) $cfg->getStaffMaxFileUploads()
+                      'max_file_uploads'=> (int) $cfg->getStaffMaxFileUploads(),
+                      'html_thread'     => (bool) $cfg->isHtmlThreadEnabled(),
                       );
         return $this->json_encode($config);
     }
@@ -35,7 +36,8 @@ class ConfigAjaxAPI extends AjaxController {
         $config=array(
                       'file_types'      => $cfg->getAllowedFileTypes(),
                       'max_file_size'   => (int) $cfg->getMaxFileSize(),
-                      'max_file_uploads'=> (int) $cfg->getClientMaxFileUploads()
+                      'max_file_uploads'=> (int) $cfg->getClientMaxFileUploads(),
+                      'html_thread'     => (bool) $cfg->isHtmlThreadEnabled(),
                       );
 
         return $this->json_encode($config);
diff --git a/include/ajax.draft.php b/include/ajax.draft.php
new file mode 100644
index 0000000000000000000000000000000000000000..8ab99c946f8ac68c77850edfa656d62aacc78001
--- /dev/null
+++ b/include/ajax.draft.php
@@ -0,0 +1,283 @@
+<?php
+
+if(!defined('INCLUDE_DIR')) die('!');
+
+require_once(INCLUDE_DIR.'class.draft.php');
+
+class DraftAjaxAPI extends AjaxController {
+
+    function _createDraft($vars) {
+        foreach (array('response', 'note', 'answer', 'body', 'message',
+                'issue') as $field) {
+            if (isset($_POST[$field])) {
+                $vars['body'] = urldecode($_POST[$field]);
+                break;
+            }
+        }
+        if (!isset($vars['body']))
+            return Http::response(422, "Draft body not found in request");
+
+        $errors = array();
+        if (!($draft = Draft::create($vars, $errors)))
+            Http::response(500, print_r($errors, true));
+
+        // If the draft is created from an existing document, ensure inline
+        // attachments from the cloned document are attachned to the draft
+        // XXX: Actually, I think this is just wasting time, because the
+        //     other object already has the items attached, so the database
+        //     won't clean up the files. They don't have to be attached to
+        //     the draft for Draft::getAttachmentIds to return the id of the
+        //     attached file
+        //$draft->syncExistingAttachments();
+
+        echo JsonDataEncoder::encode(array(
+            'draft_id' => $draft->getId(),
+        ));
+    }
+
+    function _getDraft($id) {
+        if (!($draft = Draft::lookup($id)))
+            Http::response(205, "Draft not found. Create one first");
+
+        $body = Format::viewableImages($draft->getBody());
+
+        echo JsonDataEncoder::encode(array(
+            'body' => $body,
+            'draft_id' => (int)$id,
+        ));
+    }
+
+    function _updateDraft($draft) {
+        foreach (array('response', 'note', 'answer', 'body', 'message',
+                'issue') as $field) {
+            if (isset($_POST[$field])) {
+                $body = urldecode($_POST[$field]);
+                break;
+            }
+        }
+        if (!isset($body))
+            return Http::response(422, "Draft body not found in request");
+
+        if (!$draft->setBody($body))
+            return Http::response(500, "Unable to update draft body");
+    }
+
+    function _uploadInlineImage($draft) {
+        if (!isset($_POST['data']) && !isset($_FILES['file']))
+            Http::response(422, "File not included properly");
+
+        # Fixup for expected multiple attachments
+        if (isset($_FILES['file'])) {
+            foreach ($_FILES['file'] as $k=>$v)
+                $_FILES['image'][$k] = array($v);
+            unset($_FILES['file']);
+
+            $file = AttachmentFile::format($_FILES['image'], true);
+            # TODO: Detect unacceptable attachment extension
+            # TODO: Verify content-type and check file-content to ensure image
+            if (!($ids = $draft->attachments->upload($file))) {
+                if ($file[0]['error']) {
+                    return Http::response(403,
+                        JsonDataEncoder::encode(array(
+                            'error' => $file[0]['error'],
+                        ))
+                    );
+                }
+                else
+                    return Http::response(500, 'Unable to attach image');
+            }
+
+            $id = $ids[0];
+        }
+        else {
+            $type = explode('/', $_POST['contentType']);
+            $info = array(
+                'data' => base64_decode($_POST['data']),
+                'name' => Misc::randCode(10).'.'.$type[1],
+                // TODO: Ensure _POST['contentType']
+                'type' => $_POST['contentType'],
+            );
+            // TODO: Detect unacceptable filetype
+            // TODO: Verify content-type and check file-content to ensure image
+            $id = $draft->attachments->save($info);
+        }
+        if (!($f = AttachmentFile::lookup($id)))
+            return Http::response(500, 'Unable to attach image');
+
+        echo JsonDataEncoder::encode(array(
+            'content_id' => 'cid:'.$f->getHash(),
+            'filelink' => sprintf('image.php?h=%s', $f->getDownloadHash())
+        ));
+    }
+
+    // Client interface for drafts =======================================
+    function createDraftClient($namespace) {
+        global $thisclient;
+
+        if (!$thisclient && substr($namespace, -12) != substr(session_id(), -12))
+            Http::response(403, "Valid session required");
+
+        $vars = array(
+            'staff_id' => ($thisclient) ? $thisclient->getId() : 0,
+            'namespace' => $namespace,
+        );
+
+        $info = self::_createDraft($vars);
+        $info['draft_id'] = $namespace;
+    }
+
+    function getDraftClient($namespace) {
+        global $thisclient;
+
+        if ($thisclient) {
+            if (!($id = Draft::findByNamespaceAndStaff($namespace,
+                    $thisclient->getId())))
+                Http::response(205, "Draft not found. Create one first");
+        }
+        else {
+            if (substr($namespace, -12) != substr(session_id(), -12))
+                Http::response(404, "Draft not found");
+            elseif (!($id = Draft::findByNamespaceAndStaff($namespace, 0)))
+                Http::response(205, "Draft not found. Create one first");
+        }
+
+        return self::_getDraft($id);
+    }
+
+    function updateDraftClient($id) {
+        global $thisclient;
+
+        if (!($draft = Draft::lookup($id)))
+            Http::response(205, "Draft not found. Create one first");
+        // Check the owning client-id (for logged-in users), and the
+        // session_id() for others
+        elseif ($thisclient) {
+            if ($draft->getStaffId() != $thisclient->getId())
+                Http::response(404, "Draft not found");
+        }
+        else {
+            if (substr(session_id(), -12) != substr($draft->getNamespace(), -12))
+                Http::response(404, "Draft not found");
+        }
+
+        return self::_updateDraft($draft);
+    }
+
+    function uploadInlineImageClient($id) {
+        global $thisclient;
+
+        if (!($draft = Draft::lookup($id)))
+            Http::response(205, "Draft not found. Create one first");
+        elseif ($thisclient) {
+            if ($draft->getStaffId() != $thisclient->getId())
+                Http::response(404, "Draft not found");
+        }
+        else {
+            if (substr(session_id(), -12) != substr($draft->getNamespace(), -12))
+                Http::response(404, "Draft not found");
+        }
+
+        return self::_uploadInlineImage($draft);
+    }
+
+    // Staff interface for drafts ========================================
+    function createDraft($namespace) {
+        global $thisstaff;
+
+        if (!$thisstaff)
+            Http::response(403, "Login required for draft creation");
+
+        $vars = array(
+            'staff_id' => $thisstaff->getId(),
+            'namespace' => $namespace,
+        );
+
+        return self::_createDraft($vars);
+    }
+
+    function getDraft($namespace) {
+        global $thisstaff;
+
+        if (!$thisstaff)
+            Http::response(403, "Login required for draft creation");
+        elseif (!($id = Draft::findByNamespaceAndStaff($namespace,
+                $thisstaff->getId())))
+            Http::response(205, "Draft not found. Create one first");
+
+        return self::_getDraft($id);
+    }
+
+    function updateDraft($id) {
+        global $thisstaff;
+
+        if (!$thisstaff)
+            Http::response(403, "Login required for image upload");
+        elseif (!($draft = Draft::lookup($id)))
+            Http::response(205, "Draft not found. Create one first");
+        elseif ($draft->getStaffId() != $thisstaff->getId())
+            Http::response(404, "Draft not found");
+
+        return self::_updateDraft($draft);
+    }
+
+    function uploadInlineImage($draft_id) {
+        global $thisstaff;
+
+        if (!$thisstaff)
+            Http::response(403, "Login required for image upload");
+        elseif (!($draft = Draft::lookup($draft_id)))
+            Http::response(205, "Draft not found. Create one first");
+        elseif ($draft->getStaffId() != $thisstaff->getId())
+            Http::response(404, "Draft not found");
+
+        return self::_uploadInlineImage($draft);
+    }
+
+    function deleteDraft($id) {
+        global $thisstaff;
+
+        if (!$thisstaff)
+            Http::response(403, "Login required for draft edits");
+        elseif (!($draft = Draft::lookup($id)))
+            Http::response(205, "Draft not found. Create one first");
+        elseif ($draft->getStaffId() != $thisstaff->getId())
+            Http::response(404, "Draft not found");
+
+        $draft->delete();
+    }
+
+    function getFileList() {
+        global $thisstaff;
+
+        if (!$thisstaff)
+            Http::response(403, "Login required for file queries");
+
+        $sql = 'SELECT distinct f.id, COALESCE(a.type, f.ft) FROM '.FILE_TABLE
+            .' f LEFT JOIN '.ATTACHMENT_TABLE.' a ON (a.file_id = f.id)
+            WHERE (a.`type` IN (\'C\', \'F\', \'T\') OR f.ft = \'L\')
+                AND f.`type` LIKE \'image/%\'';
+        if (!($res = db_query($sql)))
+            Http::response(500, 'Unable to lookup files');
+
+        $files = array();
+        $folders = array(
+            'C' => 'Canned Responses',
+            'F' => 'FAQ Articles',
+            'T' => 'Email Templates',
+            'L' => 'Logos',
+        );
+        while (list($id, $type) = db_fetch_row($res)) {
+            $f = AttachmentFile::lookup($id);
+            $url = 'image.php?h='.$f->getDownloadHash();
+            $files[] = array(
+                'thumb'=>$url.'&s=128',
+                'image'=>$url,
+                'title'=>$f->getName(),
+                'folder'=>$folders[$type]
+            );
+        }
+        echo JsonDataEncoder::encode($files);
+    }
+
+}
+?>
diff --git a/include/ajax.kbase.php b/include/ajax.kbase.php
index e467f51300dee94c438e81762421f5202baf96e1..adf136ffcea81a75a99e31369b1f852d1d3de99e 100644
--- a/include/ajax.kbase.php
+++ b/include/ajax.kbase.php
@@ -19,7 +19,7 @@ if(!defined('INCLUDE_DIR')) die('!');
 class KbaseAjaxAPI extends AjaxController {
 
     function cannedResp($id, $format='') {
-        global $thisstaff, $_GET;
+        global $thisstaff, $cfg;
 
         include_once(INCLUDE_DIR.'class.canned.php');
 
@@ -36,17 +36,24 @@ class KbaseAjaxAPI extends AjaxController {
             case 'json':
                 $resp['id'] = $canned->getId();
                 $resp['ticket'] = $canned->getTitle();
-                $resp['response'] = $ticket?$ticket->replaceVars($canned->getResponse()):$canned->getResponse();
-                $resp['files'] = $canned->getAttachments();
+                $resp['response'] = $ticket
+                    ? $ticket->replaceVars($canned->getResponseWithImages())
+                    : $canned->getResponseWithImages();
+                $resp['files'] = $canned->attachments->getSeparates();
 
+                if (!$cfg->isHtmlThreadEnabled())
+                    $resp['response'] = convert_html_to_text($resp['response'], 90);
 
                 $response = $this->json_encode($resp);
                 break;
+
             case 'txt':
             default:
                 $response =$ticket?$ticket->replaceVars($canned->getResponse()):$canned->getResponse();
-        }
 
+                if (!$cfg->isHtmlThreadEnabled())
+                    $response = convert_html_to_text($response, 90);
+        }
 
         return $response;
     }
@@ -62,12 +69,13 @@ class KbaseAjaxAPI extends AjaxController {
         //TODO: $fag->getJSON() for json format. (nolint)
         $resp = sprintf(
                 '<div style="width:650px;">
-                 <strong>%s</strong><p>%s</p>
+                 <strong>%s</strong><div class="thread-body">%s</div>
+                 <div class="clear"></div>
                  <div class="faded">Last updated %s</div>
                  <hr>
                  <a href="faq.php?id=%d">View</a> | <a href="faq.php?id=%d">Attachments (%s)</a>',
                 $faq->getQuestion(),
-                Format::safe_html($faq->getAnswer()),
+                $faq->getAnswer(),
                 Format::db_daydatetime($faq->getUpdateDate()),
                 $faq->getId(),
                 $faq->getId(),
diff --git a/include/api.tickets.php b/include/api.tickets.php
index afad901d50593b06693771ae43f854612fdd3c87..f49680ce7f60c62b9e61cfe5d6fdbd8e21f7ab44 100644
--- a/include/api.tickets.php
+++ b/include/api.tickets.php
@@ -18,10 +18,12 @@ class TicketApiController extends ApiController {
             "message", "ip", "priorityId"
         );
 
-        if(!strcasecmp($format, 'email'))
+        if(!strcasecmp($format, 'email')) {
             $supported = array_merge($supported, array('header', 'mid',
                 'emailId', 'ticketId', 'reply-to', 'reply-to-name',
                 'in-reply-to', 'references'));
+            $supported['attachments']['*'][] = 'cid';
+        }
 
         return $supported;
     }
diff --git a/include/class.api.php b/include/class.api.php
index 28053565f4ac1846538e1546f5457c029b302cd7..019d3fba39e46286e98cbe6664e229645e88adfc 100644
--- a/include/class.api.php
+++ b/include/class.api.php
@@ -130,7 +130,7 @@ class API {
             .',isactive='.db_input($vars['isactive'])
             .',can_create_tickets='.db_input($vars['can_create_tickets'])
             .',can_exec_cron='.db_input($vars['can_exec_cron'])
-            .',notes='.db_input($vars['notes']);
+            .',notes='.db_input(Format::sanitize($vars['notes']));
 
         if($id) {
             $sql='UPDATE '.API_KEY_TABLE.' SET '.$sql.' WHERE id='.db_input($id);
diff --git a/include/class.attachment.php b/include/class.attachment.php
index e16650ffc511122aed298b284c6e3e84e5f89a85..36d197bb53d1d85e722e28cf62e89591ff73489e 100644
--- a/include/class.attachment.php
+++ b/include/class.attachment.php
@@ -22,7 +22,7 @@ class Attachment {
     var $ticket_id;
 
     var $info;
-    
+
     function Attachment($id,$tid=0) {
 
         $sql='SELECT * FROM '.TICKET_ATTACHMENT_TABLE.' WHERE attach_id='.db_input($id);
@@ -31,19 +31,19 @@ class Attachment {
 
         if(!($res=db_query($sql)) || !db_num_rows($res))
             return false;
-        
+
         $this->ht=db_fetch_array($res);
-        
+
         $this->id=$this->ht['attach_id'];
         $this->file_id=$this->ht['file_id'];
         $this->ticket_id=$this->ht['ticket_id'];
-        
+
         $this->file=null;
         $this->ticket=null;
-        
+
         return true;
     }
-    
+
     function getId() {
         return $this->id;
     }
@@ -58,7 +58,7 @@ class Attachment {
 
         return $this->ticket;
     }
-    
+
     function getFileId() {
         return $this->file_id;
     }
@@ -73,7 +73,7 @@ class Attachment {
     function getCreateDate() {
         return $this->ht['created'];
     }
-    
+
     function getHashtable() {
         return $this->ht;
     }
@@ -102,4 +102,103 @@ class Attachment {
     }
 
 }
+
+class GenericAttachments {
+
+    var $id;
+    var $type;
+
+    function GenericAttachments($object_id, $type) {
+        $this->id = $object_id;
+        $this->type = $type;
+    }
+
+    function getId() { return $this->id; }
+    function getType() { return $this->type; }
+
+    function upload($files, $inline=false) {
+        $i=array();
+        if (!is_array($files)) $files=array($files);
+        foreach ($files as $file) {
+            if (($fileId = is_numeric($file)
+                    ? $file : AttachmentFile::upload($file))
+                    && is_numeric($fileId)) {
+                $sql ='INSERT INTO '.ATTACHMENT_TABLE
+                    .' SET `type`='.db_input($this->getType())
+                    .',object_id='.db_input($this->getId())
+                    .',file_id='.db_input($fileId)
+                    .',inline='.db_input($inline ? 1 : 0);
+                if (db_query($sql))
+                    $i[] = $fileId;
+            }
+        }
+        return $i;
+    }
+
+    function save($info, $inline=true) {
+        if (!($fileId = AttachmentFile::save($info)))
+            return false;
+
+        $sql ='INSERT INTO '.ATTACHMENT_TABLE
+            .' SET `type`='.db_input($this->getType())
+            .',object_id='.db_input($this->getId())
+            .',file_id='.db_input($fileId)
+            .',inline='.db_input($inline ? 1 : 0);
+        if (!db_query($sql) || !db_affected_rows())
+            return false;
+
+        return $fileId;
+    }
+
+    function getInlines() { return $this->_getList(false, true); }
+    function getSeparates() { return $this->_getList(true, false); }
+    function getAll() { return $this->_getList(true, true); }
+
+    function _getList($separate=false, $inlines=false) {
+        if(!isset($this->attachments)) {
+            $this->attachments = array();
+            $sql='SELECT f.id, f.size, f.hash, f.name '
+                .' FROM '.FILE_TABLE.' f '
+                .' INNER JOIN '.ATTACHMENT_TABLE.' a ON(f.id=a.file_id) '
+                .' WHERE a.`type`='.db_input($this->getType())
+                .' AND a.object_id='.db_input($this->getId());
+            if ($inlines && !$separate)
+                $sql .= ' AND a.inline';
+            elseif (!$inlines && $separate)
+                $sql .= ' AND NOT a.inline';
+
+            if(($res=db_query($sql)) && db_num_rows($res)) {
+                while($rec=db_fetch_array($res)) {
+                    $rec['key'] = md5($rec['id'].session_id().$rec['hash']);
+                    $rec['file_id'] = $rec['id'];
+                    $this->attachments[] = $rec;
+                }
+            }
+        }
+        return $this->attachments;
+    }
+
+    function delete($file_id) {
+        $deleted = 0;
+        $sql='DELETE FROM '.ATTACHMENT_TABLE
+            .' WHERE object_id='.db_input($this->getId())
+            .'   AND `type`='.db_input($this->getType())
+            .'   AND file_id='.db_input($file_id);
+        return db_query($sql) && db_affected_rows() > 0;
+    }
+
+    function deleteAll($inline_only=false){
+        $deleted=0;
+        $sql='DELETE FROM '.ATTACHMENT_TABLE
+            .' WHERE object_id='.db_input($this->getId())
+            .'   AND `type`='.db_input($this->getType());
+        if ($inline_only)
+            $sql .= ' AND inline = 1';
+        return db_query($sql) && db_affected_rows() > 0;
+    }
+
+    function deleteInlines() {
+        return $this->deleteAll(true);
+    }
+}
 ?>
diff --git a/include/class.canned.php b/include/class.canned.php
index 04af9f025bf53fd46ee94dea13a713151622431d..d67e8a03e952aa35a0a382796c75305c4464adb0 100644
--- a/include/class.canned.php
+++ b/include/class.canned.php
@@ -20,7 +20,7 @@ class Canned {
     var $ht;
 
     var $attachments;
-    
+
     function Canned($id){
         $this->id=0;
         $this->load($id);
@@ -34,7 +34,8 @@ class Canned {
         $sql='SELECT canned.*, count(attach.file_id) as attachments, '
             .' count(filter.id) as filters '
             .' FROM '.CANNED_TABLE.' canned '
-            .' LEFT JOIN '.CANNED_ATTACHMENT_TABLE.' attach ON (attach.canned_id=canned.canned_id) ' 
+            .' LEFT JOIN '.ATTACHMENT_TABLE.' attach
+                    ON (attach.object_id=canned.canned_id AND attach.`type`=\'C\' AND NOT attach.inline) '
             .' LEFT JOIN '.FILTER_TABLE.' filter ON (canned.canned_id = filter.canned_response_id) '
             .' WHERE canned.canned_id='.db_input($id)
             .' GROUP BY canned.canned_id';
@@ -42,18 +43,18 @@ class Canned {
         if(!($res=db_query($sql)) ||  !db_num_rows($res))
             return false;
 
-        
+
         $this->ht = db_fetch_array($res);
         $this->id = $this->ht['canned_id'];
-        $this->attachments = array();
-    
+        $this->attachments = new GenericAttachments($this->id, 'C');
+
         return true;
     }
-  
+
     function reload() {
         return $this->load();
     }
-    
+
     function getId(){
         return $this->id;
     }
@@ -69,7 +70,7 @@ class Canned {
     function getNumFilters() {
         return $this->ht['filters'];
     }
-    
+
     function getTitle() {
         return $this->ht['title'];
     }
@@ -77,6 +78,9 @@ class Canned {
     function getResponse() {
         return $this->ht['response'];
     }
+    function getResponseWithImages() {
+        return Format::viewableImages($this->getResponse());
+    }
 
     function getReply() {
         return $this->getResponse();
@@ -85,7 +89,7 @@ class Canned {
     function getNotes() {
         return $this->ht['notes'];
     }
-    
+
     function getDeptId(){
         return $this->ht['dept_id'];
     }
@@ -115,84 +119,22 @@ class Canned {
 
         if(!$this->save($this->getId(),$vars,$errors))
             return false;
-        
+
         $this->reload();
 
         return true;
     }
-   
+
     function getNumAttachments() {
         return $this->ht['attachments'];
     }
-   
-    function getAttachments() {
-
-        if(!$this->attachments && $this->getNumAttachments()) {
-            
-            $sql='SELECT f.id, f.size, f.hash, f.name '
-                .' FROM '.FILE_TABLE.' f '
-                .' INNER JOIN '.CANNED_ATTACHMENT_TABLE.' a ON(f.id=a.file_id) '
-                .' WHERE a.canned_id='.db_input($this->getId());
-
-            $this->attachments = array();
-            if(($res=db_query($sql)) && db_num_rows($res)) {
-                while($rec=db_fetch_array($res)) {
-                    $rec['key'] =md5($rec['id'].session_id().$rec['hash']);
-                    $this->attachments[] = $rec;
-                }
-            }
-        }
-        
-        return $this->attachments;
-    }
-    /*
-    @files is an array - hash table of multiple attachments.
-    */
-    function uploadAttachments($files) {
-
-        $i=0;
-        foreach($files as $file) {
-            if(($fileId=is_numeric($file)?$file:AttachmentFile::upload($file)) && is_numeric($fileId)) {
-                $sql ='INSERT INTO '.CANNED_ATTACHMENT_TABLE
-                     .' SET canned_id='.db_input($this->getId()).', file_id='.db_input($fileId);
-                if(db_query($sql)) $i++;
-            }
-        }
-
-        if($i) $this->reload();
-
-        return $i;
-    }
-
-    function deleteAttachment($file_id) {
-        $deleted = 0;
-        $sql='DELETE FROM '.CANNED_ATTACHMENT_TABLE
-            .' WHERE canned_id='.db_input($this->getId())
-            .'   AND file_id='.db_input($file_id);
-        if(db_query($sql) && db_affected_rows()) {
-            $deleted = AttachmentFile::deleteOrphans();
-        }
-        return ($deleted > 0);
-    }
-
-    function deleteAttachments(){
-
-        $deleted=0;
-        $sql='DELETE FROM '.CANNED_ATTACHMENT_TABLE
-            .' WHERE canned_id='.db_input($this->getId());
-        if(db_query($sql) && db_affected_rows()) {
-            $deleted = AttachmentFile::deleteOrphans();
-        }
-
-        return $deleted;
-    }
 
     function delete(){
         if ($this->getNumFilters() > 0) return false;
 
         $sql='DELETE FROM '.CANNED_TABLE.' WHERE canned_id='.db_input($this->getId()).' LIMIT 1';
         if(db_query($sql) && ($num=db_affected_rows())) {
-            $this->deleteAttachments();
+            $this->attachments->deleteAll();
         }
 
         return $num;
@@ -203,7 +145,7 @@ class Canned {
         return ($id && is_numeric($id) && ($c= new Canned($id)) && $c->getId()==$id)?$c:null;
     }
 
-    function create($vars,&$errors) { 
+    function create($vars,&$errors) {
         return self::save(0,$vars,$errors);
     }
 
@@ -241,10 +183,9 @@ class Canned {
     }
 
     function save($id,$vars,&$errors) {
+        global $cfg;
 
-        //We're stripping html tags - until support is added to tickets.
         $vars['title']=Format::striptags(trim($vars['title']));
-        $vars['response']=Format::striptags(trim($vars['response']));
         $vars['notes']=Format::striptags(trim($vars['notes']));
 
         if($id && $id!=$vars['id'])
@@ -259,14 +200,15 @@ class Canned {
 
         if(!$vars['response'])
             $errors['response']='Response text required';
-            
+
         if($errors) return false;
 
         $sql=' updated=NOW() '.
              ',dept_id='.db_input($vars['dept_id']?$vars['dept_id']:0).
              ',isenabled='.db_input($vars['isenabled']).
              ',title='.db_input($vars['title']).
-             ',response='.db_input($vars['response']).
+             ',response='.db_input(Format::sanitize($vars['response'],
+                    !$cfg->isHtmlThreadEnabled())).
              ',notes='.db_input($vars['notes']);
 
         if($id) {
diff --git a/include/class.config.php b/include/class.config.php
index 76fec8e783522fa57c9bce71df831b19e043d526..7d3aad655565903b1c68586a13c010f033d831e6 100644
--- a/include/class.config.php
+++ b/include/class.config.php
@@ -141,6 +141,7 @@ class OsticketConfig extends Config {
     var $defaults = array(
         'allow_pw_reset' =>     true,
         'pw_reset_window' =>    30,
+        'enable_html_thread' => true,
     );
 
     function OsticketConfig($section=null) {
@@ -281,6 +282,10 @@ class OsticketConfig extends Config {
         return $this->get('show_notes_inline');
     }
 
+    function isHtmlThreadEnabled() {
+        return $this->get('enable_html_thread');
+    }
+
     function getClientTimeout() {
         return $this->getClientSessionTimeout();
     }
@@ -863,6 +868,7 @@ class OsticketConfig extends Config {
             'show_notes_inline'=>isset($vars['show_notes_inline'])?1:0,
             'clickable_urls'=>isset($vars['clickable_urls'])?1:0,
             'hide_staff_name'=>isset($vars['hide_staff_name'])?1:0,
+            'enable_html_thread'=>isset($vars['enable_html_thread'])?1:0,
             'allow_attachments'=>isset($vars['allow_attachments'])?1:0,
             'allowed_filetypes'=>strtolower(preg_replace("/\n\r|\r\n|\n|\r/", '',trim($vars['allowed_filetypes']))),
             'max_file_size'=>$vars['max_file_size'],
diff --git a/include/class.dept.php b/include/class.dept.php
index 1d838be2ba326b2cf5e2221d3be9fe04b1a64875..2bc2f30b3470beada4e89d15fe46072ee5ad1d69 100644
--- a/include/class.dept.php
+++ b/include/class.dept.php
@@ -380,7 +380,7 @@ class Dept {
             .' ,autoresp_email_id='.db_input(isset($vars['autoresp_email_id'])?$vars['autoresp_email_id']:0)
             .' ,manager_id='.db_input($vars['manager_id']?$vars['manager_id']:0)
             .' ,dept_name='.db_input(Format::striptags($vars['name']))
-            .' ,dept_signature='.db_input(Format::striptags($vars['signature']))
+            .' ,dept_signature='.db_input(Format::sanitize($vars['signature']))
             .' ,group_membership='.db_input(isset($vars['group_membership'])?1:0)
             .' ,ticket_auto_response='.db_input(isset($vars['ticket_auto_response'])?$vars['ticket_auto_response']:1)
             .' ,message_auto_response='.db_input(isset($vars['message_auto_response'])?$vars['message_auto_response']:1);
diff --git a/include/class.dispatcher.php b/include/class.dispatcher.php
index 929a5db4a61949f2a4d1752e1173b48b6aa8276e..44d710b55b1256bfe5709c0ddc0254a80695031a 100644
--- a/include/class.dispatcher.php
+++ b/include/class.dispatcher.php
@@ -29,7 +29,7 @@ class Dispatcher {
     function resolve($url, $args=null) {
         if ($this->file) { $this->lazy_load(); }
         # Support HTTP method emulation with the _method GET argument
-        if (isset($_GET['_method'])) { 
+        if (isset($_GET['_method'])) {
             $_SERVER['REQUEST_METHOD'] = strtoupper($_GET['_method']);
             unset($_GET['_method']);
         }
@@ -114,15 +114,15 @@ class UrlMatcher {
             # level)
             return $this->func->resolve(
                 substr($url, strlen($this->matches[0])),
-                array_merge(($prev_args) ? $prev_args : array(), 
+                array_merge(($prev_args) ? $prev_args : array(),
                     array_slice($this->matches, 1)));
         } else {
             # Drop the first item of the matches array (which is the whole
             # matched url). Then merge in any initial arguments.
-            array_shift($this->matches);
+            unset($this->matches[0]);
             # Prepend received arguments (from a parent Dispatcher). This is
             # different from the static args, which are postpended
-            if (is_array($prev_args)) 
+            if (is_array($prev_args))
                 $args = array_merge($prev_args, $this->matches);
             else $args = $this->matches;
             # Add in static args specified in the constructor
@@ -135,7 +135,7 @@ class UrlMatcher {
                 $func = array(new $class, $func);
             }
             if (!is_callable($func))
-                Http::response(500, 
+                Http::response(500,
                     'Dispatcher compile error. Function not callable');
             return call_user_func_array($func, $args);
         }
@@ -183,7 +183,7 @@ function url_get($regex, $func, $args=false) {
     return url($regex, $func, $args, "GET");
 }
 
-function url_del($regex, $func, $args=false) {
+function url_delete($regex, $func, $args=false) {
     return url($regex, $func, $args, "DELETE");
 }
 ?>
diff --git a/include/class.draft.php b/include/class.draft.php
new file mode 100644
index 0000000000000000000000000000000000000000..b183736c705293a3695c0bad71775b0256443141
--- /dev/null
+++ b/include/class.draft.php
@@ -0,0 +1,156 @@
+<?php
+
+class Draft {
+
+    var $id;
+    var $ht;
+
+    var $_attachments;
+
+    function Draft($id) {
+        $this->id = $id;
+        $this->load();
+    }
+
+    function load() {
+        $this->attachments = new GenericAttachments($this->id, 'D');
+        $sql = 'SELECT * FROM '.DRAFT_TABLE.' WHERE id='.db_input($this->id);
+        return (($res = db_query($sql))
+            && ($this->ht = db_fetch_array($res)));
+    }
+
+    function getId() { return $this->id; }
+    function getBody() { return $this->ht['body']; }
+    function getStaffId() { return $this->ht['staff_id']; }
+    function getNamespace() { return $this->ht['namespace']; }
+
+    function getAttachmentIds($body=false) {
+        if (!isset($this->_attachments)) {
+            $this->_attachments = array();
+            if (!$body)
+                $body = $this->getBody();
+            $body = Format::localizeInlineImages($body);
+            $matches = array();
+            if (preg_match_all('/"cid:([\\w.-]{32})"/', $body, $matches)) {
+                foreach ($matches[1] as $hash) {
+                    if ($file_id = AttachmentFile::getIdByHash($hash))
+                        $this->_attachments[] = $file_id;
+                }
+            }
+        }
+        return $this->_attachments;
+    }
+
+    /*
+     * Ensures that the inline attachments cited in the body of this draft
+     * are also listed in the draft_attachment table. After calling this,
+     * the ::getAttachments() function should correctly return all inline
+     * attachments. This function should be called after creating a draft
+     * with an existing body
+     */
+    function syncExistingAttachments() {
+        $matches = array();
+        if (!preg_match_all('/"cid:([\\w.-]{32})"/', $this->getBody(), $matches))
+            return;
+
+        // Purge current attachments
+        $this->attachments->deleteInlines();
+        foreach ($matches[1] as $hash)
+            if ($file = AttachmentFile::getIdByHash($hash))
+                $this->attachments->upload($file, true);
+    }
+
+    function setBody($body) {
+        // Change image.php urls back to content-id's
+        $body = Format::sanitize($body, false);
+        $this->ht['body'] = $body;
+
+        $sql='UPDATE '.DRAFT_TABLE.' SET updated=NOW()'
+            .',body='.db_input($body)
+            .' WHERE id='.db_input($this->getId());
+        return db_query($sql) && db_affected_rows() == 1;
+    }
+
+    function delete() {
+        $this->attachments->deleteAll();
+        $sql = 'DELETE FROM '.DRAFT_TABLE
+            .' WHERE id='.db_input($this->getId());
+        return (db_query($sql) && db_affected_rows() == 1);
+    }
+
+    function save($id, $vars, &$errors) {
+        // Required fields
+        if (!$vars['namespace'] || !isset($vars['body']) || !isset($vars['staff_id']))
+            return false;
+
+        $sql = ' SET `namespace`='.db_input($vars['namespace'])
+            .' ,body='.db_input(Format::sanitize($vars['body'], false))
+            .' ,staff_id='.db_input($vars['staff_id']);
+
+        if (!$id) {
+            $sql = 'INSERT INTO '.DRAFT_TABLE.$sql
+                .' ,created=NOW()';
+            if(!db_query($sql) || !($draft=self::lookup(db_insert_id())))
+                return false;
+
+            // Cloned attachments...
+            if($vars['attachments'] && is_array($vars['attachments']))
+                $draft->attachments->upload($vars['attachments'], true);
+
+            return $draft;
+        }
+        else {
+            $sql = 'UPDATE '.DRAFT_TABLE.$sql
+                .' WHERE id='.db_input($id);
+            if (db_query($sql) && db_affected_rows() == 1)
+                return $this;
+        }
+    }
+
+    function create($vars, &$errors) {
+        return self::save(0, $vars, $errors);
+    }
+
+    function lookup($id) {
+        return ($id && is_numeric($id)
+                && ($d = new Draft($id))
+                && $d->getId()==$id
+                ) ? $d : null;
+    }
+
+    function findByNamespaceAndStaff($namespace, $staff_id) {
+        $sql = 'SELECT id FROM '.DRAFT_TABLE
+            .' WHERE `namespace`='.db_input($namespace)
+            .' AND staff_id='.db_input($staff_id);
+        if (($res = db_query($sql)) && (list($id) = db_fetch_row($res)))
+            return $id;
+        else
+            return false;
+    }
+
+    /**
+     * Delete drafts saved for a particular namespace. If the staff_id is
+     * specified, only drafts owned by that staff are deleted. Usually, if
+     * closing a ticket, the staff_id should be left null so that all drafts
+     * are cleaned up.
+     */
+    /* static */
+    function deleteForNamespace($namespace, $staff_id=false) {
+        $sql = 'DELETE attach FROM '.ATTACHMENT_TABLE.' attach
+                INNER JOIN '.DRAFT_TABLE.' draft
+                ON (attach.object_id = draft.id AND attach.`type`=\'D\')
+                WHERE draft.`namespace` LIKE '.db_input($namespace);
+        if ($staff_id)
+            $sql .= ' AND draft.staff_id='.db_input($staff_id);
+        if (!db_query($sql))
+            return false;
+
+        $sql = 'DELETE FROM '.DRAFT_TABLE
+             .' WHERE `namespace` LIKE '.db_input($namespace);
+        if ($staff_id)
+            $sql .= ' AND staff_id='.db_input($staff_id);
+        return (!db_query($sql) || !db_affected_rows());
+    }
+}
+
+?>
diff --git a/include/class.email.php b/include/class.email.php
index 9f7ea95b0c76ceac926d5bdedea534afc1830ea4..e5ebabf40eb1c9a2f8c52ec5d0a6e8917b53737b 100644
--- a/include/class.email.php
+++ b/include/class.email.php
@@ -366,7 +366,7 @@ class Email {
              ',smtp_port='.db_input($vars['smtp_port']?$vars['smtp_port']:0).
              ',smtp_auth='.db_input($vars['smtp_auth']).
              ',smtp_spoofing='.db_input(isset($vars['smtp_spoofing'])?1:0).
-             ',notes='.db_input($vars['notes']);
+             ',notes='.db_input(Format::sanitize($vars['notes']));
 
         //Post fetch email handling...
         if($vars['postfetch'] && !strcasecmp($vars['postfetch'],'delete'))
diff --git a/include/class.export.php b/include/class.export.php
index 67da6d5e463d968072e577c71fd3cd7e02ba6df6..35036aaaa6445e1bbc749afaa97fc9cb032a70fa 100644
--- a/include/class.export.php
+++ b/include/class.export.php
@@ -157,8 +157,8 @@ class DatabaseExporter {
     var $tables = array(CONFIG_TABLE, SYSLOG_TABLE, FILE_TABLE,
         FILE_CHUNK_TABLE, STAFF_TABLE, DEPT_TABLE, TOPIC_TABLE, GROUP_TABLE,
         GROUP_DEPT_TABLE, TEAM_TABLE, TEAM_MEMBER_TABLE, FAQ_TABLE,
-        FAQ_ATTACHMENT_TABLE, FAQ_TOPIC_TABLE, FAQ_CATEGORY_TABLE,
-        CANNED_TABLE, CANNED_ATTACHMENT_TABLE, TICKET_TABLE,
+        FAQ_TOPIC_TABLE, FAQ_CATEGORY_TABLE, DRAFT_TABLE,
+        CANNED_TABLE, TICKET_TABLE, ATTACHMENT_TABLE,
         TICKET_THREAD_TABLE, TICKET_ATTACHMENT_TABLE, TICKET_PRIORITY_TABLE,
         TICKET_LOCK_TABLE, TICKET_EVENT_TABLE, TICKET_EMAIL_INFO_TABLE,
         EMAIL_TABLE, EMAIL_TEMPLATE_TABLE, EMAIL_TEMPLATE_GRP_TABLE,
diff --git a/include/class.faq.php b/include/class.faq.php
index fb07e5effbdad6ab1f9e52ed12f9292c33af85c6..4069ebd7b57cf5a2d699ea19271ea0712061d387 100644
--- a/include/class.faq.php
+++ b/include/class.faq.php
@@ -34,8 +34,9 @@ class FAQ {
         $sql='SELECT faq.*,cat.ispublic, count(attach.file_id) as attachments '
             .' FROM '.FAQ_TABLE.' faq '
             .' LEFT JOIN '.FAQ_CATEGORY_TABLE.' cat ON(cat.category_id=faq.category_id) '
-            .' LEFT JOIN '.FAQ_ATTACHMENT_TABLE.' attach ON(attach.faq_id=faq.faq_id) '
-            .' WHERE faq.faq_id='.db_input($id)
+            .' LEFT JOIN '.ATTACHMENT_TABLE.' attach
+                 ON(attach.object_id=faq.faq_id AND attach.`type`=\'F\') '
+            .' WHERE attach.inline=0 AND faq.faq_id='.db_input($id)
             .' GROUP BY faq.faq_id';
 
         if (!($res=db_query($sql)) || !db_num_rows($res))
@@ -44,7 +45,7 @@ class FAQ {
         $this->ht = db_fetch_array($res);
         $this->ht['id'] = $this->id = $this->ht['faq_id'];
         $this->category = null;
-        $this->attachments = array();
+        $this->attachments = new GenericAttachments($this->id, 'F');
 
         return true;
     }
@@ -58,7 +59,9 @@ class FAQ {
     function getHashtable() { return $this->ht; }
     function getKeywords() { return $this->ht['keywords']; }
     function getQuestion() { return $this->ht['question']; }
-    function getAnswer() { return $this->ht['answer']; }
+    function getAnswer() {
+        return Format::viewableImages($this->ht['answer']);
+    }
     function getNotes() { return $this->ht['notes']; }
     function getNumAttachments() { return $this->ht['attachments']; }
 
@@ -162,47 +165,32 @@ class FAQ {
 
         //Delete removed attachments.
         $keepers = $vars['files']?$vars['files']:array();
-        if(($attachments = $this->getAttachments())) {
+        if(($attachments = $this->attachments->getSeparates())) {
             foreach($attachments as $file) {
                 if($file['id'] && !in_array($file['id'], $keepers))
-                    $this->deleteAttachment($file['id']);
+                    $this->attachments->delete($file['id']);
             }
         }
 
         //Upload new attachments IF any.
         if($_FILES['attachments'] && ($files=AttachmentFile::format($_FILES['attachments'])))
-            $this->uploadAttachments($files);
+            $this->attachments->upload($files);
+
+        // Inline images (attached to the draft)
+        $this->attachments->deleteInlines();
+        if (isset($vars['draft_id']) && $vars['draft_id'])
+            if ($draft = Draft::lookup($vars['draft_id']))
+                $this->attachments->upload($draft->getAttachmentIds(), true);
 
         $this->reload();
 
         return true;
     }
 
-
-    function getAttachments() {
-
-        if(!$this->attachments && $this->getNumAttachments()) {
-
-            $sql='SELECT f.id, f.size, f.hash, f.name '
-                .' FROM '.FILE_TABLE.' f '
-                .' INNER JOIN '.FAQ_ATTACHMENT_TABLE.' a ON(f.id=a.file_id) '
-                .' WHERE a.faq_id='.db_input($this->getId());
-
-            $this->attachments = array();
-            if(($res=db_query($sql)) && db_num_rows($res)) {
-                while($rec=db_fetch_array($res)) {
-                    $rec['key'] =md5($rec['id'].session_id().$rec['hash']);
-                    $this->attachments[] = $rec;
-                }
-            }
-        }
-        return $this->attachments;
-    }
-
     function getAttachmentsLinks($separator=' ',$target='') {
 
         $str='';
-        if(($attachments=$this->getAttachments())) {
+        if(($attachments=$this->attachments->getSeparates())) {
             foreach($attachments as $attachment ) {
             /* The h key must match validation in file.php */
             $hash=$attachment['hash'].md5($attachment['id'].session_id().$attachment['hash']);
@@ -217,46 +205,6 @@ class FAQ {
         return $str;
     }
 
-    function uploadAttachments($files) {
-
-        $i=0;
-        foreach($files as $file) {
-            if(($fileId=is_numeric($file)?$file:AttachmentFile::upload($file)) && is_numeric($fileId)) {
-                $sql ='INSERT INTO '.FAQ_ATTACHMENT_TABLE
-                     .' SET faq_id='.db_input($this->getId()).', file_id='.db_input($fileId);
-                if(db_query($sql)) $i++;
-            }
-        }
-
-        if($i) $this->reload();
-
-        return $i;
-    }
-
-    function deleteAttachment($file_id) {
-        $deleted = 0;
-        $sql='DELETE FROM '.FAQ_ATTACHMENT_TABLE
-            .' WHERE faq_id='.db_input($this->getId())
-            .'   AND file_id='.db_input($file_id);
-        if(db_query($sql) && db_affected_rows()) {
-            $deleted = AttachmentFile::deleteOrphans();
-        }
-        return ($deleted > 0);
-    }
-
-    function deleteAttachments(){
-
-        $deleted=0;
-        $sql='DELETE FROM '.FAQ_ATTACHMENT_TABLE
-            .' WHERE faq_id='.db_input($this->getId());
-        if(db_query($sql) && db_affected_rows()) {
-            $deleted = AttachmentFile::deleteOrphans();
-        }
-
-        return $deleted;
-    }
-
-
     function delete() {
 
         $sql='DELETE FROM '.FAQ_TABLE
@@ -268,7 +216,7 @@ class FAQ {
         //Cleanup help topics.
         db_query('DELETE FROM '.FAQ_TOPIC_TABLE.' WHERE faq_id='.db_input($this->id));
         //Cleanup attachments.
-        $this->deleteAttachments();
+        $this->attachments->deleteAll();
 
         return true;
     }
@@ -283,7 +231,12 @@ class FAQ {
             $faq->updateTopics($vars['topics']);
 
             if($_FILES['attachments'] && ($files=AttachmentFile::format($_FILES['attachments'])))
-                $faq->uploadAttachments($files);
+                $faq->attachments->upload($files);
+
+            // Inline images (attached to the draft)
+            if (isset($vars['draft_id']) && $vars['draft_id'])
+                if ($draft = Draft::lookup($vars['draft_id']))
+                    $faq->attachments->upload($draft->getAttachmentIds(), true);
 
             $faq->reload();
         }
@@ -350,7 +303,7 @@ class FAQ {
         //save
         $sql=' updated=NOW() '
             .', question='.db_input($vars['question'])
-            .', answer='.db_input(Format::safe_html($vars['answer']))
+            .', answer='.db_input(Format::sanitize($vars['answer'], false))
             .', category_id='.db_input($vars['category_id'])
             .', ispublished='.db_input(isset($vars['ispublished'])?$vars['ispublished']:0)
             .', notes='.db_input($vars['notes']);
diff --git a/include/class.file.php b/include/class.file.php
index d53ff3d50bfe2210210d85e1fa82ab04c0281456..03ea0473646bd60dcb05be4e819a02585ad7d4ee 100644
--- a/include/class.file.php
+++ b/include/class.file.php
@@ -27,10 +27,10 @@ class AttachmentFile {
         if(!$id && !($id=$this->getId()))
             return false;
 
-        $sql='SELECT id, type, size, name, hash, f.created, '
-            .' count(DISTINCT c.canned_id) as canned, count(DISTINCT t.ticket_id) as tickets '
+        $sql='SELECT id, f.type, size, name, hash, f.created, '
+            .' count(DISTINCT a.object_id) as canned, count(DISTINCT t.ticket_id) as tickets '
             .' FROM '.FILE_TABLE.' f '
-            .' LEFT JOIN '.CANNED_ATTACHMENT_TABLE.' c ON(c.file_id=f.id) '
+            .' LEFT JOIN '.ATTACHMENT_TABLE.' a ON(a.file_id=f.id) '
             .' LEFT JOIN '.TICKET_ATTACHMENT_TABLE.' t ON(t.file_id=f.id) '
             .' WHERE f.id='.db_input($id)
             .' GROUP BY f.id';
@@ -154,6 +154,28 @@ class AttachmentFile {
     function display() {
         $this->makeCacheable();
 
+        if ($scale && extension_loaded('gd')) {
+            $image = imagecreatefromstring($this->getData());
+            $width = imagesx($image);
+            if ($scale <= $width) {
+                $height = imagesy($image);
+                if ($width > $height) {
+                    $heightp = $height * (int)$scale / $width;
+                    $widthp = $scale;
+                } else {
+                    $widthp = $width * (int)$scale / $height;
+                    $heightp = $scale;
+                }
+                $thumb = imagecreatetruecolor($widthp, $heightp);
+                $white = imagecolorallocate($thumb, 255,255,255);
+                imagefill($thumb, 0, 0, $white);
+                imagecopyresized($thumb, $image, 0, 0, 0, 0, $widthp,
+                    $heightp, $width, $height);
+                header('Content-Type: image/png');
+                imagepng($thumb);
+                return;
+            }
+        }
         header('Content-Type: '.($this->getType()?$this->getType():'application/octet-stream'));
         header('Content-Length: '.$this->getSize());
         $this->sendData();
@@ -234,11 +256,13 @@ class AttachmentFile {
 
         if(!$file['hash'])
             $file['hash']=MD5(MD5($file['data']).time());
+        if (is_callable($file['data']))
+            $file['data'] = $file['data']();
         if(!$file['size'])
             $file['size']=strlen($file['data']);
 
         $sql='INSERT INTO '.FILE_TABLE.' SET created=NOW() '
-            .',type='.db_input($file['type'])
+            .',type='.db_input(strtolower($file['type']))
             .',size='.db_input($file['size'])
             .',name='.db_input($file['name'])
             .',hash='.db_input($file['hash']);
@@ -275,6 +299,16 @@ class AttachmentFile {
         return ($id && ($file = new AttachmentFile($id)) && $file->getId()==$id)?$file:null;
     }
 
+    static function create($info, &$errors) {
+        if (isset($info['encoding'])) {
+            switch ($info['encoding']) {
+                case 'base64':
+                    $info['data'] = base64_decode($info['data']);
+            }
+        }
+        return self::save($info);
+    }
+
     /*
       Method formats http based $_FILE uploads - plus basic validation.
       @restrict - make sure file type & size are allowed.
@@ -332,9 +366,7 @@ class AttachmentFile {
                 .'SELECT DISTINCT(file_id) FROM ('
                     .'SELECT file_id FROM '.TICKET_ATTACHMENT_TABLE
                     .' UNION ALL '
-                    .'SELECT file_id FROM '.CANNED_ATTACHMENT_TABLE
-                    .' UNION ALL '
-                    .'SELECT file_id FROM '.FAQ_ATTACHMENT_TABLE
+                    .'SELECT file_id FROM '.ATTACHMENT_TABLE
                 .') still_loved'
             .') AND `ft` = "T"';
 
diff --git a/include/class.filter.php b/include/class.filter.php
index 25c51603db2d88f9b114e88501a5d598b7092f73..1f94120793d338ddb57be5979eb31a500d9c1ada 100644
--- a/include/class.filter.php
+++ b/include/class.filter.php
@@ -459,7 +459,7 @@ class Filter {
             .',use_replyto_email='.db_input(isset($vars['use_replyto_email'])?1:0)
             .',disable_autoresponder='.db_input(isset($vars['disable_autoresponder'])?1:0)
             .',canned_response_id='.db_input($vars['canned_response_id'])
-            .',notes='.db_input($vars['notes']);
+            .',notes='.db_input(Format::sanitize($vars['notes']));
 
 
         //Auto assign ID is overloaded...
diff --git a/include/class.format.php b/include/class.format.php
index f016896deb39cfefb05b43bf4913bb06feb6fe84..a327f1289737c8dc6c15477ab3b4ddfaf8f31927 100644
--- a/include/class.format.php
+++ b/include/class.format.php
@@ -141,17 +141,27 @@ class Format {
         $config = array(
                 'safe' => 1, //Exclude applet, embed, iframe, object and script tags.
                 'balance' => 1, //balance and close unclosed tags.
-                'comment' => 1  //Remove html comments (OUTLOOK LOVE THEM)
+                'comment' => 1, //Remove html comments (OUTLOOK LOVE THEM)
+                'tidy' => -1, // Clean extra whitspace
+                'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; src: cid, http, https, data'
                 );
 
         return Format::html($html, $config);
     }
 
-    function sanitize($text, $striptags= true) {
+    function localizeInlineImages($text) {
+        // Change image.php urls back to content-id's
+        return preg_replace('/image\\.php\\?h=([\\w.-]{32})\\w{32}/',
+            'cid:$1', $text);
+    }
+
+    function sanitize($text, $striptags=false) {
 
         //balance and neutralize unsafe tags.
         $text = Format::safe_html($text);
 
+        $text = self::localizeInlineImages($text);
+
         //If requested - strip tags with decoding disabled.
         return $striptags?Format::striptags($text, false):$text;
     }
@@ -195,13 +205,21 @@ class Format {
             $text=Format::clickableurls($text);
 
         //Wrap long words...
-        $text=preg_replace_callback('/\w{75,}/',
-            create_function(
-                '$matches',                                     # nolint
-                'return wordwrap($matches[0],70,"\n",true);'),  # nolint
+        #$text=preg_replace_callback('/\w{75,}/',
+        #    create_function(
+        #        '$matches',                                     # nolint
+        #        'return wordwrap($matches[0],70,"\n",true);'),  # nolint
+        #    $text);
+
+        // Make showing offsite images optional
+        return preg_replace_callback('/<img ([^>]*)(src="http.+)\/>/',
+            function($match) {
+                // Drop embedded classes -- they don't refer to ours
+                $match = preg_replace('/class="[^"]*"/', '', $match);
+                return sprintf('<div %s class="non-local-image" data-%s></div>',
+                    $match[1], $match[2]);
+            },
             $text);
-
-        return nl2br($text);
     }
 
     function striptags($var, $decode=true) {
@@ -218,7 +236,7 @@ class Format {
 
         $token = $ost->getLinkToken();
         //Not perfect but it works - please help improve it.
-        $text=preg_replace_callback('/(((f|ht){1}tp(s?):\/\/)[-a-zA-Z0-9@:%_\+.~#?&;\/\/=]+)/',
+        $text=preg_replace_callback('/(?<!")(((f|ht){1}tp(s?):\/\/)[-a-zA-Z0-9@:%_\+.~#?&;\/\/=]+)/',
                 create_function('$matches', # nolint
                     sprintf('return "<a href=\"l.php?url=".urlencode($matches[1])."&auth=%s\" target=\"_blank\">".$matches[1]."</a>";', # nolint
                         $token)),
@@ -247,6 +265,17 @@ class Format {
         return urldecode(ereg_replace("%0D", " ", urlencode($string)));
     }
 
+    function viewableImages($html, $script='image.php') {
+        return preg_replace_callback('/"cid:([\\w.-]{32})"/',
+        function($match) use ($script) {
+            $hash = $match[1];
+            if (!($file = AttachmentFile::lookup($hash)))
+                return $match[0];
+            return sprintf('"%s?h=%s" data-cid="%s"',
+                $script, $file->getDownloadHash(), $match[1]);
+        }, $html);
+    }
+
 
     /**
      * Thanks, http://us2.php.net/manual/en/function.implode.php
diff --git a/include/class.group.php b/include/class.group.php
index 0d8cc44d55b445b29493efd642c739f5dc102480..f8ce1d8213dfee372707a33e835460aa7e25e83e 100644
--- a/include/class.group.php
+++ b/include/class.group.php
@@ -211,8 +211,8 @@ class Group {
             .', can_manage_faq='.db_input($vars['can_manage_faq'])
             .', can_post_ticket_reply='.db_input($vars['can_post_ticket_reply'])
             .', can_view_staff_stats='.db_input($vars['can_view_staff_stats'])
-            .', notes='.db_input($vars['notes']);
-            
+            .', notes='.db_input(Format::sanitize($vars['notes']));
+
         if($id) {
             
             $sql='UPDATE '.GROUP_TABLE.' '.$sql.' WHERE group_id='.db_input($id);
diff --git a/include/class.http.php b/include/class.http.php
index 8d4e7be204c6e5f5942593e043105fe44ce78211..e8d6788cf964c5f257a7a1c2887c6dfa4854d631 100644
--- a/include/class.http.php
+++ b/include/class.http.php
@@ -14,24 +14,26 @@
     vim: expandtab sw=4 ts=4 sts=4:
 **********************************************************************/
 class Http {
-    
+
     function header_code_verbose($code) {
         switch($code):
         case 200: return '200 OK';
         case 201: return '201 Created';
-        case 204: return '204 NoContent';
+        case 204: return '204 No Content';
+        case 205: return '205 Reset Content';
         case 400: return '400 Bad Request';
         case 401: return '401 Unauthorized';
         case 403: return '403 Forbidden';
         case 404: return '404 Not Found';
         case 405: return '405 Method Not Allowed';
         case 416: return '416 Requested Range Not Satisfiable';
+        case 422: return '422 Unprocessable Entity';
         default:  return '500 Internal Server Error';
         endswitch;
     }
-    
+
     function response($code,$content,$contentType='text/html',$charset='UTF-8') {
-		
+
         header('HTTP/1.1 '.Http::header_code_verbose($code));
 		header('Status: '.Http::header_code_verbose($code)."\r\n");
 		header("Connection: Close\r\n");
@@ -40,7 +42,7 @@ class Http {
        	print $content;
         exit;
     }
-	
+
 	function redirect($url,$delay=0,$msg='') {
 
         if(strstr($_SERVER['SERVER_SOFTWARE'], 'IIS')){
diff --git a/include/class.i18n.php b/include/class.i18n.php
index 67f1c42766dae9d9fc441c39e33a8197fdfd2011..984037b67599460edd003cf6de42edd970b4f978 100644
--- a/include/class.i18n.php
+++ b/include/class.i18n.php
@@ -51,6 +51,7 @@ class Internationalization {
             'team.yaml' =>          'Team', # notrans
             // Note that group requires department
             'group.yaml' =>         'Group', # notrans
+            'file.yaml' =>          'AttachmentFile', # notrans
         );
 
         $errors = array();
diff --git a/include/class.knowledgebase.php b/include/class.knowledgebase.php
deleted file mode 100644
index 00a1488bfb378adb9fef2e8e39035305dd2e622b..0000000000000000000000000000000000000000
--- a/include/class.knowledgebase.php
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php
-/*********************************************************************
-    class.knowledgebase.php
-
-    Backend support for knowledgebase creates, edits, deletes, and
-    attachments.
-
-    Copyright (c)  2006-2013 osTicket
-    http://www.osticket.com
-
-    Released under the GNU General Public License WITHOUT ANY WARRANTY.
-    See LICENSE.TXT for details.
-
-    vim: expandtab sw=4 ts=4 sts=4:
-**********************************************************************/
-require_once("class.file.php");
-
-class Knowledgebase {
-
-    function Knowledgebase($id) {
-        $res=db_query(
-            'SELECT title, isenabled, dept_id, created, updated '
-           .'FROM '.CANNED_TABLE.' WHERE canned_id='.db_input($id));
-        if (!$res || !db_num_rows($res)) return false;
-        list(   $this->title,
-                $this->enabled,
-                $this->department,
-                $this->created,
-                $this->updated) = db_fetch_row($res);
-        $this->id = $id;
-        $this->_attachments = new AttachmentList(
-            CANNED_ATTACHMENT_TABLE, 'canned_id='.db_input($id));
-    }
-
-    /* ------------------> Getter methods <--------------------- */
-    function getTitle() { return $this->title; }
-    function isEnabled() { return !!$this->enabled; }
-    function getAnswer() { 
-        if (!isset($this->answer)) {
-            if ($res=db_query('SELECT answer FROM '.CANNED_TABLE
-                    .' WHERE canned_id='.db_input($this->id))) {
-                list($this->answer)=db_fetch_row($res);
-            }
-        }
-        return $this->answer;
-    }
-    function getCreated() { return $this->created; }
-    function lastUpdated() { return $this->updated; }
-    function attachments() { return $this->_attachments; }
-    function getDeptId() { return $this->department; }
-    function getDepartment() { return new Dept($this->department); }
-    function getId() { return $this->id; }
-
-    /* ------------------> Setter methods <--------------------- */
-    function publish() { $this->published = true; }
-    function unpublish() { $this->published = false; }
-    function setPublished($val) { $this->published = !!$val; }
-    function setEnabled($val) { $this->enabled = !!$val; }
-    function setTitle($title) { $this->title = $title; }
-    function setKeywords($words) { $this->keywords = $words; }
-    function setAnswer($text) { $this->answer = $text; }
-    function setDepartment($id) { $this->department = $id; }
-
-    /* -------------> Validation and Clean methods <------------ */
-    function validate(&$errors, $what=null) {
-        if (!$what) $what=$this->getHashtable();
-        else $this->clean($what);
-        # TODO: Validate current values ($this->yada)
-        # Apply hashtable to this -- return error list
-        $validation = array(
-            'title' => array('is_string', 'Title is required')
-        );
-        foreach ($validation as $key=>$details) {
-            list($func, $error) = $details;
-            if (!call_user_func($func, $what[$key])) {
-                $errors[$key] = $error;
-            }
-        }
-        return count($errors) == 0;
-    }
-
-    function clean(&$what) {
-        if (isset($what['topic']))
-            $what['topic']=Format::striptags(trim($what['topic']));
-    }
-
-    function getHashtable() {
-        # TODO: Return hashtable like the one that would be passed into
-        #       $this->save() or self::create()
-        return array('title'=>$this->title, 'department'=>$this->department,
-            'isenabled'=>$this->enabled);
-    }
-
-    /* -------------> Database access methods <----------------- */
-    function update() { 
-        if (!@$this->validate()) return false;
-        db_query(
-            'UPDATE '.CANNED_TABLE.' SET title='.db_input($this->title)
-                .', isenabled='.db_input($this->enabled)
-                .', dept_id='.db_input($this->department)
-                .', updated=NOW()'
-                .((isset($this->answer)) 
-                    ? ', answer='.db_input($this->answer) : '')
-                .' WHERE canned_id='.db_input($this->id));
-        return db_affected_rows() == 1;
-    }
-    function delete() {
-        db_query('DELETE FROM '.CANNED_TABLE.' WHERE canned_id='
-            .db_input($this->id));
-        return db_affected_rows() == 1;
-    }
-    /* For ->attach() and ->detach(), use $this->attachments() */
-    function attach($file) { return $this->_attachments->add($file); }
-    function detach($file) { return $this->_attachments->remove($file); }
-
-    /* ------------------> Static methods <--------------------- */
-    function create($hash, &$errors) {
-        if (!self::validate($hash, $errors)) return false;
-        db_query('INSERT INTO '.CANNED_TABLE
-            .' (title, answer, department, isenabled, created, updated) VALUES ('
-            .db_input($hash['title']).','
-            .db_input($hash['answer']).','
-            .db_input($hash['dept']).','
-            .db_input($hash['isenabled']).',NOW(),NOW()');
-        return db_insert_id();
-    }
-
-    function save($id, $new_stuff, &$errors) {
-        if (!$id) return self::create($new_stuff, $errors);
-        if (!self::validate($errors, $new_stuff)) return false;
-
-        # else
-        if (!($obj = new Knowledgebase($id))) { return false; }
-        $obj->setEnabled($new_stuff['enabled']);
-        $obj->setTitle($new_stuff['title']);
-        $obj->setAnswer($new_stuff['answer']);
-        $obj->setDepartment($new_stuff['dept']);
-
-        return $obj->update();
-    }
-
-    function findByTitle($title) {
-        $res=db_query('SELECT canned_id FROM '.CANNED_TABLE
-            .' WHERE title LIKE '.db_input($title));
-        if (list($id) = db_fetch_row($res)) {
-            return new Knowledgebase($id);
-        }
-        return false;
-    }
-
-    function lookup($id) {
-        return ($id && is_numeric($id) && ($obj= new Knowledgebase($id)) && $obj->getId()==$id)
-            ? $obj : null;
-    }
-}
diff --git a/include/class.mailer.php b/include/class.mailer.php
index adb0fd0d1188a30ed64e09226fd1c919b90c7662..889ecb39fdc60b767633bc3ded23de6a1e3ee203 100644
--- a/include/class.mailer.php
+++ b/include/class.mailer.php
@@ -17,6 +17,7 @@
 **********************************************************************/
 
 include_once(INCLUDE_DIR.'class.email.php');
+require_once(INCLUDE_DIR.'html2text.php');
 
 class Mailer {
 
@@ -94,11 +95,9 @@ class Mailer {
         //do some cleanup
         $to = preg_replace("/(\r\n|\r|\n)/s",'', trim($to));
         $subject = preg_replace("/(\r\n|\r|\n)/s",'', trim($subject));
-        //We're decoding html entities here becasuse we only support plain text for now - html support comming.
-        $body = Format::htmldecode(preg_replace("/(\r\n|\r)/s", "\n", trim($message)));
 
         /* Message ID - generated for each outgoing email */
-        $messageId = sprintf('<%s%d-%s>', Misc::randCode(6), time(),
+        $messageId = sprintf('<%s-%s>', Misc::randCode(16),
                 ($this->getEmail()?$this->getEmail()->getEmail():'@osTicketMailer'));
 
         $headers = array (
@@ -136,12 +135,40 @@ class Mailer {
         }
 
         $mime = new Mail_mime();
-        $mime->setTXTBody($body);
+
+        // Make sure nothing unsafe has creeped into the message
+        $message = Format::safe_html($message);
+        $mime->setTXTBody(convert_html_to_text($message));
+
+        $domain = 'local';
+        if ($ost->getConfig()->isHtmlThreadEnabled()) {
+            // TODO: Lookup helpdesk domain
+            $domain = substr(md5($ost->getConfig()->getURL()), -12);
+            // Format content-ids with the domain, and add the inline images
+            // to the email attachment list
+            $self = $this;
+            $message = preg_replace_callback('/cid:([\w.-]{32})/',
+                function($match) use ($domain, $mime, $self) {
+                    if (!($file = AttachmentFile::lookup($match[1])))
+                        return $match[0];
+                    $mime->addHTMLImage($file->getData(),
+                        $file->getType(), $file->getName(), false,
+                        $file->getHash().'@'.$domain);
+                    // Don't re-attach the image below
+                    unset($self->attachments[$file->getId()]);
+                    return $match[0].'@'.$domain;
+                }, $message);
+            // Add an HTML body
+            $mime->setHTMLBody($message);
+        }
         //XXX: Attachments
         if(($attachments=$this->getAttachments())) {
             foreach($attachments as $attachment) {
-                if($attachment['file_id'] && ($file=AttachmentFile::lookup($attachment['file_id'])))
-                    $mime->addAttachment($file->getData(),$file->getType(), $file->getName(),false);
+                if ($attachment['file_id']
+                        && ($file=AttachmentFile::lookup($attachment['file_id']))) {
+                    $mime->addAttachment($file->getData(),
+                        $file->getType(), $file->getName(),false);
+                }
                 elseif($attachment['file'] &&  file_exists($attachment['file']) && is_readable($attachment['file']))
                     $mime->addAttachment($attachment['file'],$attachment['type'],$attachment['name']);
             }
diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php
index 2e5089a5742e0ac9dc3b097dfbf5ef1780df32df..07a3aa27fc46db8fe6644f7926f29c11822404cf 100644
--- a/include/class.mailfetch.php
+++ b/include/class.mailfetch.php
@@ -19,6 +19,7 @@ require_once(INCLUDE_DIR.'class.ticket.php');
 require_once(INCLUDE_DIR.'class.dept.php');
 require_once(INCLUDE_DIR.'class.email.php');
 require_once(INCLUDE_DIR.'class.filter.php');
+require_once(INCLUDE_DIR.'html2text.php');
 
 class MailFetcher {
 
@@ -377,13 +378,17 @@ class MailFetcher {
                 $filename = $this->findFilename($part->parameters);
             }
 
+            $content_id = ($part->ifid)
+                ? rtrim(ltrim($part->id, '<'), '>') : false;
+
             if($filename) {
                 return array(
                         array(
                             'name'  => $this->mime_decode($filename),
                             'type'  => $this->getMimeType($part),
                             'encoding' => $part->encoding,
-                            'index' => ($index?$index:1)
+                            'index' => ($index?$index:1),
+                            'cid'   => $content_id,
                             )
                         );
             }
@@ -411,19 +416,27 @@ class MailFetcher {
     }
 
     function getBody($mid) {
+        global $cfg;
 
-        $body ='';
-        if ($body = $this->getPart($mid,'TEXT/PLAIN', $this->charset))
-            // The Content-Type was text/plain, so escape anything that
-            // looks like HTML
-            $body=Format::htmlchars($body);
-        elseif ($body = $this->getPart($mid,'TEXT/HTML', $this->charset)) {
+        if ($body = $this->getPart($mid,'TEXT/HTML', $this->charset)) {
             //Convert tags of interest before we striptags
-            $body=str_replace("</DIV><DIV>", "\n", $body);
-            $body=str_replace(array("<br>", "<br />", "<BR>", "<BR />"), "\n", $body);
+            //$body=str_replace("</DIV><DIV>", "\n", $body);
+            //$body=str_replace(array("<br>", "<br />", "<BR>", "<BR />"), "\n", $body);
             $body=Format::safe_html($body); //Balance html tags & neutralize unsafe tags.
+            if (!$cfg->isHtmlThreadEnabled())
+                $body = convert_html_to_text($body);
+        }
+        elseif ($body = $this->getPart($mid,'TEXT/PLAIN', $this->charset)) {
+            // Escape anything that looks like HTML chars since what's in
+            // the database will be considered HTML
+            // TODO: Consider the reverse of the above edits (replace \n
+            //       <br/>
+            $body=Format::htmlchars($body);
+            if ($cfg->isHtmlThreadEnabled()) {
+                $body = wordwrap($body, 90);
+                $body = "<div style=\"white-space:pre\">$body</div>";
+            }
         }
-
         return $body;
     }
 
@@ -464,7 +477,34 @@ class MailFetcher {
         $errors=array();
         $seen = false;
 
-        if (($thread = ThreadEntry::lookupByEmailHeaders($vars, $seen))
+        // Fetch attachments if any.
+        if($ost->getConfig()->allowEmailAttachments()
+                && ($struct = imap_fetchstructure($this->mbox, $mid))
+                && ($attachments=$this->getAttachments($struct))) {
+
+            $vars['attachments'] = array();
+            foreach($attachments as $a ) {
+                $file = array('name' => $a['name'], 'type' => $a['type']);
+
+                //Check the file  type
+                if(!$ost->isFileTypeAllowed($file)) {
+                    $file['error'] = 'Invalid file type (ext) for '.Format::htmlchars($file['name']);
+                }
+                else {
+                    // only fetch the body if necessary
+                    $self = $this;
+                    $file['data'] = function() use ($self, $mid, $a) {
+                        return $self->decode(imap_fetchbody($self->mbox,
+                            $mid, $a['index']), $a['encoding']);
+                    };
+                }
+                // Include the Content-Id if specified (for inline images)
+                $file['cid'] = isset($a['cid']) ? $a['cid'] : false;
+                $vars['attachments'][] = $file;
+            }
+        }
+
+        if (($thread = ThreadEntry::lookupByEmailHeaders($vars))
                 && ($message = $thread->postEmail($vars))) {
             if (!$message instanceof ThreadEntry)
                 // Email has been processed previously
@@ -494,25 +534,6 @@ class MailFetcher {
             return null;
         }
 
-        //Save attachments if any.
-        if($message
-                && $ost->getConfig()->allowEmailAttachments()
-                && ($struct = imap_fetchstructure($this->mbox, $mid))
-                && ($attachments=$this->getAttachments($struct))) {
-
-            foreach($attachments as $a ) {
-                $file = array('name'  => $a['name'], 'type'  => $a['type']);
-
-                //Check the file  type
-                if(!$ost->isFileTypeAllowed($file))
-                    $file['error'] = 'Invalid file type (ext) for '.Format::htmlchars($file['name']);
-                else //only fetch the body if necessary TODO: Make it a callback.
-                    $file['data'] = $this->decode(imap_fetchbody($this->mbox, $mid, $a['index']), $a['encoding']);
-
-                $message->importAttachment($file);
-            }
-        }
-
         return $ticket;
     }
 
@@ -603,9 +624,9 @@ class MailFetcher {
         while(list($emailId, $errors)=db_fetch_row($res)) {
             $fetcher = new MailFetcher($emailId);
             if($fetcher->connect()) {
+                db_query('UPDATE '.EMAIL_TABLE.' SET mail_errors=0, mail_lastfetch=NOW() WHERE email_id='.db_input($emailId));
                 $fetcher->fetchEmails();
                 $fetcher->close();
-                db_query('UPDATE '.EMAIL_TABLE.' SET mail_errors=0, mail_lastfetch=NOW() WHERE email_id='.db_input($emailId));
             } else {
                 db_query('UPDATE '.EMAIL_TABLE.' SET mail_errors=mail_errors+1, mail_lasterror=NOW() WHERE email_id='.db_input($emailId));
                 if(++$errors>=$MAXERRORS) {
diff --git a/include/class.mailparse.php b/include/class.mailparse.php
index 039a48b74be371ed1def64f502cad0db16c8506e..145d10bf7a7d98f33373e9127cee02a5fe885dd3 100644
--- a/include/class.mailparse.php
+++ b/include/class.mailparse.php
@@ -158,14 +158,17 @@ class Mail_Parse {
 
     function getBody(){
 
-        $body='';
-        if($body=$this->getPart($this->struct,'text/plain'))
-            $body = Format::htmlchars($body);
-        elseif($body=$this->getPart($this->struct,'text/html')) {
+        if ($body=$this->getPart($this->struct,'text/html')) {
             //Cleanup the html.
-            $body=str_replace("</DIV><DIV>", "\n", $body);
-            $body=str_replace(array("<br>", "<br />", "<BR>", "<BR />"), "\n", $body);
             $body=Format::safe_html($body); //Balance html tags & neutralize unsafe tags.
+            if (!$cfg->isHtmlThreadEnabled()) {
+                $body = convert_html_to_text($body, 120);
+                $body = "<div style=\"white-space:pre-wrap\">$body</div>";
+            }
+        }
+        elseif ($body=$this->getPart($this->struct,'text/plain')) {
+            $body = Format::htmlchars($body);
+            $body = "<div style=\"white-space:pre-wrap\">$body</div>";
         }
         return $body;
     }
@@ -248,6 +251,10 @@ class Mail_Parse {
             if(!$this->decode_bodies && $part->headers['content-transfer-encoding'])
                 $file['encoding'] = $part->headers['content-transfer-encoding'];
 
+            // Include Content-Id (for inline-images), stripping the <>
+            $file['cid'] = (isset($part->headers['content-id']))
+                ? rtrim(ltrim($part->headers['content-id'], '<'), '>') : false;
+
             return array($file);
         }
 
diff --git a/include/class.misc.php b/include/class.misc.php
index 27e259e330da365c96979017677c4cce695e4d61..41edef9f6bd7515e8264db429d0dea3b4fdc3251 100644
--- a/include/class.misc.php
+++ b/include/class.misc.php
@@ -17,7 +17,7 @@ class Misc {
 
 	function randCode($count=8, $chars=false) {
         $chars = $chars ? $chars
-            : 'abcdefghijklmnopqrstuvwzyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+            : 'abcdefghijklmnopqrstuvwzyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.';
         $data = '';
         $m = strlen($chars) - 1;
         for ($i=0; $i < $count; $i++)
diff --git a/include/class.page.php b/include/class.page.php
index c5b2f83bdf1f9c06028dbed47bd1a83cb12e895d..c6e6329d57fb869f8668291ee9116f1ace4d90c1 100644
--- a/include/class.page.php
+++ b/include/class.page.php
@@ -17,6 +17,7 @@ class Page {
 
     var $id;
     var $ht;
+    var $attachments;
 
     function Page($id) {
         $this->id=0;
@@ -40,6 +41,7 @@ class Page {
 
         $this->ht = db_fetch_array($res);
         $this->id = $this->ht['id'];
+        $this->attachments = new GenericAttachments($this->id, 'P');
 
         return true;
     }
@@ -67,6 +69,9 @@ class Page {
     function getBody() {
         return $this->ht['body'];
     }
+    function getBodyWithImages() {
+        return Format::viewableImages($this->getBody());
+    }
 
     function getNotes() {
         return $this->ht['notes'];
@@ -236,9 +241,9 @@ class Page {
         $sql=' updated=NOW() '
             .', `type`='.db_input($vars['type'])
             .', name='.db_input($vars['name'])
-            .', body='.db_input(Format::safe_html($vars['body']))
+            .', body='.db_input(Format::sanitize($vars['body']))
             .', isactive='.db_input($vars['isactive'] ? 1 : 0)
-            .', notes='.db_input($vars['notes']);
+            .', notes='.db_input(Format::sanitize($vars['notes']));
 
         if($id) {
             $sql='UPDATE '.PAGE_TABLE.' SET '.$sql.' WHERE id='.db_input($id);
diff --git a/include/class.setup.php b/include/class.setup.php
index 4b73c257e4922dffc3ee4c8d60035f9c20d55473..d2c16cb1090fd8bb26e7caa13948c6621d6a0f31 100644
--- a/include/class.setup.php
+++ b/include/class.setup.php
@@ -17,8 +17,8 @@
 Class SetupWizard {
 
     //Mimimum requirements
-    var $prereq = array('php'   => '4.3',
-                        'mysql' => '4.4');
+    var $prereq = array('php'   => '5.3',
+                        'mysql' => '5.0');
 
     //Version info - same as the latest version.
 
@@ -88,7 +88,7 @@ Class SetupWizard {
     }
 
     function check_mysql() {
-        return (extension_loaded('mysql'));
+        return (extension_loaded('mysqli'));
     }
 
     function check_prereq() {
diff --git a/include/class.sla.php b/include/class.sla.php
index 12bb19b5bb4888499e05576951d1fd41bbb30496..1bd84e5d246f4caaf7b864147cc038ad39ced6a5 100644
--- a/include/class.sla.php
+++ b/include/class.sla.php
@@ -179,7 +179,7 @@ class SLA {
              ',grace_period='.db_input($vars['grace_period']).
              ',disable_overdue_alerts='.db_input(isset($vars['disable_overdue_alerts'])?1:0).
              ',enable_priority_escalation='.db_input(isset($vars['enable_priority_escalation'])?1:0).
-             ',notes='.db_input($vars['notes']);
+             ',notes='.db_input(Format::sanitize($vars['notes']));
 
         if($id) {
             $sql='UPDATE '.SLA_TABLE.' SET '.$sql.' WHERE id='.db_input($id);
diff --git a/include/class.staff.php b/include/class.staff.php
index c434d3d1ca7548f65fc66160439da988cbfb17b3..a1fe8e7c821576632df1e2e6062a26e19e123409 100644
--- a/include/class.staff.php
+++ b/include/class.staff.php
@@ -406,7 +406,6 @@ class Staff {
 
         $vars['firstname']=Format::striptags($vars['firstname']);
         $vars['lastname']=Format::striptags($vars['lastname']);
-        $vars['signature']=Format::striptags($vars['signature']);
 
         if($this->getId()!=$vars['id'])
             $errors['err']='Internal Error';
@@ -472,7 +471,7 @@ class Staff {
             .' ,phone="'.db_input(Format::phone($vars['phone']),false).'"'
             .' ,phone_ext='.db_input($vars['phone_ext'])
             .' ,mobile="'.db_input(Format::phone($vars['mobile']),false).'"'
-            .' ,signature='.db_input($vars['signature'])
+            .' ,signature='.db_input(Format::sanitize($vars['signature']))
             .' ,timezone_id='.db_input($vars['timezone_id'])
             .' ,daylight_saving='.db_input(isset($vars['daylight_saving'])?1:0)
             .' ,show_assigned_tickets='.db_input(isset($vars['show_assigned_tickets'])?1:0)
@@ -707,6 +706,7 @@ class Staff {
         $vars = array(
             'url' => $ost->getConfig()->getBaseUrl(),
             'token' => $token,
+            'staff' => $this,
             'reset_link' => sprintf(
                 "%s/scp/pwreset.php?token=%s",
                 $ost->getConfig()->getBaseUrl(),
@@ -732,7 +732,6 @@ class Staff {
         $vars['username']=Format::striptags($vars['username']);
         $vars['firstname']=Format::striptags($vars['firstname']);
         $vars['lastname']=Format::striptags($vars['lastname']);
-        $vars['signature']=Format::striptags($vars['signature']);
 
         if($id && $id!=$vars['id'])
             $errors['err']='Internal Error';
@@ -801,8 +800,8 @@ class Staff {
             .' ,phone="'.db_input(Format::phone($vars['phone']),false).'"'
             .' ,phone_ext='.db_input($vars['phone_ext'])
             .' ,mobile="'.db_input(Format::phone($vars['mobile']),false).'"'
-            .' ,signature='.db_input($vars['signature'])
-            .' ,notes='.db_input($vars['notes']);
+            .' ,signature='.db_input(Format::sanitize($vars['signature']))
+            .' ,notes='.db_input(Format::sanitize($vars['notes']));
 
         if($vars['passwd1']) {
             $sql.=' ,passwd='.db_input(Passwd::hash($vars['passwd1']));
diff --git a/include/class.team.php b/include/class.team.php
index 3babfd3207f03fe0e9e64c6f5bd612e0dc64657b..8d1c22bb06f90b5c9e999593c850891f3f378b61 100644
--- a/include/class.team.php
+++ b/include/class.team.php
@@ -238,7 +238,7 @@ class Team {
         $sql='SET updated=NOW(),isenabled='.db_input($vars['isenabled']).
              ',name='.db_input($vars['name']).
              ',noalerts='.db_input(isset($vars['noalerts'])?$vars['noalerts']:0).
-             ',notes='.db_input($vars['notes']);
+             ',notes='.db_input(Format::sanitize($vars['notes']));
 
         if($id) {
             $sql='UPDATE '.TEAM_TABLE.' '.$sql.',lead_id='.db_input($vars['lead_id']).' WHERE team_id='.db_input($id);
diff --git a/include/class.template.php b/include/class.template.php
index eec65759d67b564b23f4fc3f3633b41bf5dd34ba..36725476b269d63e86d5b0eaa2ddc15da27cf050 100644
--- a/include/class.template.php
+++ b/include/class.template.php
@@ -258,6 +258,10 @@ class EmailTemplateGroup {
         if(db_query($sql) && ($num=db_affected_rows())) {
             //isInuse check is enough - but it doesn't hurt make sure deleted tpl is not in-use.
             db_query('UPDATE '.DEPT_TABLE.' SET tpl_id=0 WHERE tpl_id='.db_input($this->getId()));
+            // Drop attachments (images)
+            db_query('DELETE a.* FROM '.ATTACHMENT_TABLE.' a
+                JOIN '.EMAIL_TEMPLATE_TABLE.' t  ON (a.object_id=t.id AND a.type=\'T\')
+                WHERE t.tpl_id='.db_input($this->getId()));
             db_query('DELETE FROM '.EMAIL_TEMPLATE_TABLE
                 .' WHERE tpl_id='.db_input($this->getId()));
         }
@@ -307,7 +311,7 @@ class EmailTemplateGroup {
         $sql=' updated=NOW() '
             .' ,name='.db_input($vars['name'])
             .' ,isactive='.db_input($vars['isactive'])
-            .' ,notes='.db_input($vars['notes']);
+            .' ,notes='.db_input(Format::sanitize($vars['notes']));
 
         if($id) {
             $sql='UPDATE '.EMAIL_TEMPLATE_GRP_TABLE.' SET '.$sql.' WHERE tpl_id='.db_input($id);
@@ -366,9 +370,9 @@ class EmailTemplate {
         if(!($res=db_query($sql))|| !db_num_rows($res))
             return false;
 
-
         $this->ht=db_fetch_array($res);
         $this->id=$this->ht['id'];
+        $this->attachments = new GenericAttachments($this->id, 'T');
 
         return true;
     }
@@ -397,6 +401,9 @@ class EmailTemplate {
         return $this->ht['body'];
     }
 
+    function getBodyWithImages() {
+        return Format::viewableImages($this->getBody());
+    }
     function getCodeName() {
         return $this->ht['code_name'];
     }
@@ -423,6 +430,14 @@ class EmailTemplate {
 
         $this->reload();
 
+        // Inline images (attached to the draft)
+        if (isset($vars['draft_id']) && $vars['draft_id']) {
+            if ($draft = Draft::lookup($vars['draft_id'])) {
+                $this->attachments->deleteInlines();
+                $this->attachments->upload($draft->getAttachmentIds($this->getBody()), true);
+            }
+        }
+
         return true;
     }
 
@@ -437,12 +452,14 @@ class EmailTemplate {
             if (!$vars['tpl_id'])
                 $errors['tpl_id']='Template group required';
             if (!$vars['code_name'])
-                $errprs['code_name']='Code name required';
+                $errors['code_name']='Code name required';
         }
 
         if ($errors)
             return false;
 
+        $vars['body'] = Format::sanitize($vars['body'], false);
+
         if ($id) {
             $sql='UPDATE '.EMAIL_TEMPLATE_TABLE.' SET updated=NOW() '
                 .', subject='.db_input($vars['subject'])
@@ -467,7 +484,12 @@ class EmailTemplate {
     }
 
     function add($vars, &$errors) {
-        return self::lookup(self::create($vars, $errors));
+        $inst = self::lookup(self::create($vars, $errors));
+
+        // Inline images (attached to the draft)
+        $inst->attachments->upload(Draft::getAttachmentIds($inst->getBody()), true);
+
+        return $inst;
     }
 
     function lookupByName($tpl_id, $name, $group=null) {
diff --git a/include/class.thread.php b/include/class.thread.php
index 29e1b1d574c44e79bc8c1045b3fbf021fc58f3c4..e1840c78728250c7eef98fdf7bfaf07710599ccf 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -15,6 +15,7 @@
     vim: expandtab sw=4 ts=4 sts=4:
 **********************************************************************/
 include_once(INCLUDE_DIR.'class.ticket.php');
+include_once(INCLUDE_DIR.'class.draft.php');
 
 //Ticket thread.
 class Thread {
@@ -146,10 +147,6 @@ class Thread {
         //Add ticket Id.
         $vars['ticketId'] = $this->getTicketId();
 
-        // DELME: When HTML / rich-text is supported
-        $vars['title'] = Format::htmlchars($vars['title']);
-        $vars['body'] = Format::htmlchars($vars['body']);
-
         return Note::create($vars, $errors);
     }
 
@@ -158,10 +155,6 @@ class Thread {
         $vars['ticketId'] = $this->getTicketId();
         $vars['staffId'] = 0;
 
-        // DELME: When HTML / rich-text is supported
-        $vars['title'] = Format::htmlchars($vars['title']);
-        $vars['body'] = Format::htmlchars($vars['body']);
-
         return Message::create($vars, $errors);
     }
 
@@ -169,10 +162,6 @@ class Thread {
 
         $vars['ticketId'] = $this->getTicketId();
 
-        // DELME: When HTML / rich-text is supported
-        $vars['title'] = Format::htmlchars($vars['title']);
-        $vars['body'] = Format::htmlchars($vars['body']);
-
         return Response::create($vars, $errors);
     }
 
@@ -301,6 +290,16 @@ Class ThreadEntry {
         return $this->ht['body'];
     }
 
+    function setBody($body) {
+        global $cfg;
+
+        $sql='UPDATE '.TICKET_THREAD_TABLE.' SET updated=NOW()'
+            .',body='.db_input(Format::sanitize($body,
+                !$cfg->isHtmlThreadEnabled()))
+            .' WHERE id='.db_input($this->getId());
+        return db_query($sql) && db_affected_rows();
+    }
+
     function getCreateDate() {
         return $this->ht['created'];
     }
@@ -467,6 +466,18 @@ Class ThreadEntry {
         return $this->attachments;
     }
 
+    function getAttachmentUrls($script='image.php') {
+        $json = array();
+        foreach ($this->getAttachments() as $att) {
+            $json[$att['file_hash']] = array(
+                'download_url' => sprintf('attachment.php?id=%d&h=%s', $att['attach_id'],
+                    strtolower(md5($att['file_id'].session_id().$att['file_hash']))),
+                'filename' => $att['name'],
+            );
+        }
+        return $json;
+    }
+
     function getAttachmentsLinks($file='attachment.php', $target='', $separator=' ') {
 
         $str='';
@@ -713,11 +724,35 @@ Class ThreadEntry {
         if(!$vars['ticketId'] || !$vars['type'] || !in_array($vars['type'], array('M','R','N')))
             return false;
 
+        if (isset($vars['attachments'])) {
+            foreach ($vars['attachments'] as &$a) {
+                // Change <img src="cid:"> inside the message to point to
+                // a unique hash-code for the attachment. Since the
+                // content-id will be discarded, only the unique hash-code
+                // will be available to retrieve the image later
+                if ($a['cid']) {
+                    $a['hash'] = Misc::randCode(32);
+                    $vars['body'] = str_replace('src="cid:'.$a['cid'].'"',
+                        'src="cid:'.$a['hash'].'"', $vars['body']);
+                }
+            }
+            unset($a);
+        }
+
+        $vars['body'] = Format::sanitize($vars['body'],
+            !$cfg->isHtmlThreadEnabled());
+        if (!$cfg->isHtmlThreadEnabled()) {
+            // Data in the database is assumed to be HTML, change special
+            // plain text XML characters
+            $vars['title'] = Format::htmlchars($vars['title']);
+            $vars['body'] = Format::htmlchars($vars['body']);
+        }
+
         $sql=' INSERT INTO '.TICKET_THREAD_TABLE.' SET created=NOW() '
             .' ,thread_type='.db_input($vars['type'])
             .' ,ticket_id='.db_input($vars['ticketId'])
             .' ,title='.db_input(Format::sanitize($vars['title'], true))
-            .' ,body='.db_input(Format::sanitize($vars['body'], true))
+            .' ,body='.db_input($vars['body'])
             .' ,staff_id='.db_input($vars['staffId'])
             .' ,poster='.db_input($vars['poster'])
             .' ,source='.db_input($vars['source']);
@@ -758,6 +793,9 @@ Class ThreadEntry {
                 substr(md5($cfg->getUrl()), -10));
         $entry->saveEmailInfo($vars);
 
+        // Inline images (attached to the draft)
+        $entry->saveAttachments(Draft::getAttachmentIds($vars['body']));
+
         return $entry;
     }
 
diff --git a/include/class.ticket.php b/include/class.ticket.php
index 294291f65cd079ae43e756bdeca738abc3011662..2ab7ba1e683c0bfe84c8185b6626ad205a9fda99 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -752,8 +752,8 @@ class Ticket {
             if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
                 $msg['body'] ="\n$tag\n\n".$msg['body'];
 
-            $email->sendAutoReply($this->getEmail(), $msg['subj'],
-                $msg['body'], null, $options);
+            $email->sendAutoReply($this->getEmail(), $msg['subj'], $msg['body'],
+                null, $options);
         }
 
         if(!($email=$cfg->getAlertEmail()))
@@ -1004,7 +1004,8 @@ class Ticket {
             foreach( $recipients as $k=>$staff) {
                 if(!is_object($staff) || !$staff->isAvailable() || in_array($staff->getEmail(), $sentlist)) continue;
                 $alert = str_replace("%{recipient}", $staff->getFirstName(), $msg['body']);
-                $email->sendAlert($staff->getEmail(), $msg['subj'], $alert);
+                $email->sendAlert($staff->getEmail(), $msg['subj'], $alert,
+                    null);
                 $sentlist[] = $staff->getEmail();
             }
 
@@ -1327,6 +1328,7 @@ class Ticket {
         //If enabled...send alert to staff (New Message Alert)
         if($cfg->alertONNewMessage() && $tpl && $email && ($msg=$tpl->getNewMessageAlertMsgTemplate())) {
 
+            $attachments = $message->getAttachments();
             $msg = $this->replaceVars($msg->asArray(), array('message' => $message));
 
             //Build list of recipients and fire the alerts.
@@ -1350,7 +1352,7 @@ class Ticket {
                 if(!$staff || !$staff->getEmail() || !$staff->isAvailable() || in_array($staff->getEmail(), $sentlist)) continue;
                 $alert = str_replace('%{recipient}', $staff->getFirstName(), $msg['body']);
                 $email->sendAlert($staff->getEmail(), $msg['subj'], $alert,
-                    null, $options);
+                    $attachments, $options);
                 $sentlist[] = $staff->getEmail();
             }
         }
@@ -1365,7 +1367,7 @@ class Ticket {
             return false;
 
         $files = array();
-        foreach ($canned->getAttachments() as $file)
+        foreach ($canned->attachments->getAll() as $file)
             $files[] = $file['id'];
 
         $info = array('msgId' => $msgId,
@@ -1396,13 +1398,14 @@ class Ticket {
             else
                 $signature='';
 
+            $attachments =($cfg->emailAttachments() && $files)?$response->getAttachments():array();
+
             $msg = $this->replaceVars($msg->asArray(),
                 array('response' => $response, 'signature' => $signature));
 
             if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
                 $msg['body'] ="\n$tag\n\n".$msg['body'];
 
-            $attachments =($cfg->emailAttachments() && $files)?$response->getAttachments():array();
             $options = array('references' => $response->getEmailMessageId());
             $email->sendAutoReply($this->getEmail(), $msg['subj'], $msg['body'], $attachments,
                 $options);
@@ -1452,14 +1455,15 @@ class Ticket {
             else
                 $signature='';
 
+            //Set attachments if emailing.
+            $attachments = $cfg->emailAttachments()?$response->getAttachments():array();
+
             $msg = $this->replaceVars($msg->asArray(),
                     array('response' => $response, 'signature' => $signature, 'staff' => $thisstaff));
 
             if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
                 $msg['body'] ="\n$tag\n\n".$msg['body'];
 
-            //Set attachments if emailing.
-            $attachments = $cfg->emailAttachments()?$response->getAttachments():array();
             $options = array('references' => $response->getEmailMessageId());
             //TODO: setup  5 param (options... e.g mid trackable on replies)
             $email->send($this->getEmail(), $msg['subj'], $msg['body'], $attachments,
@@ -1553,6 +1557,8 @@ class Ticket {
 
         if($tpl && ($msg=$tpl->getNoteAlertMsgTemplate()) && $email) {
 
+            $attachments = $note->getAttachments();
+
             $msg = $this->replaceVars($msg->asArray(),
                 array('note' => $note));
 
@@ -1571,7 +1577,6 @@ class Ticket {
             if($cfg->alertDeptManagerONNewNote() && $dept && $dept->getManagerId())
                 $recipients[]=$dept->getManager();
 
-            $attachments = $note->getAttachments();
             $options = array('references' => $note->getEmailMessageId());
             $sentlist=array();
             foreach( $recipients as $k=>$staff) {
@@ -2144,13 +2149,14 @@ class Ticket {
             else
                 $signature='';
 
+            $attachments =($cfg->emailAttachments() && $response)?$response->getAttachments():array();
+
             $msg = $ticket->replaceVars($msg->asArray(),
                     array('message' => $message, 'signature' => $signature));
 
             if($cfg->stripQuotedReply() && ($tag=trim($cfg->getReplySeparator())))
                 $msg['body'] ="\n$tag\n\n".$msg['body'];
 
-            $attachments =($cfg->emailAttachments() && $response)?$response->getAttachments():array();
             $references = $ticket->getLastMessage()->getEmailMessageId();
             if (isset($response))
                 $references = array($response->getEmailMessageId(), $references);
diff --git a/include/class.topic.php b/include/class.topic.php
index 8b02e5eeab5fe04344a3c81ea987f7577c51235a..801e6e684a0b9cc08f480d7ee80ecf7abaf0b66d 100644
--- a/include/class.topic.php
+++ b/include/class.topic.php
@@ -227,7 +227,7 @@ class Topic {
             .',isactive='.db_input($vars['isactive'])
             .',ispublic='.db_input($vars['ispublic'])
             .',noautoresp='.db_input(isset($vars['noautoresp'])?1:0)
-            .',notes='.db_input($vars['notes']);
+            .',notes='.db_input(Format::sanitize($vars['notes']));
 
         //Auto assign ID is overloaded...
         if($vars['assign'] && $vars['assign'][0]=='s')
diff --git a/include/class.usersession.php b/include/class.usersession.php
index b596934cf0da76c95f681899935672f04aac3f74..c24bb76ab85188829654cd6ba8b86fdd37d36d7d 100644
--- a/include/class.usersession.php
+++ b/include/class.usersession.php
@@ -68,23 +68,23 @@ class UserSession {
 
    function isvalidSession($htoken,$maxidletime=0,$checkip=false){
         global $cfg;
-       
+
         $token = rawurldecode($htoken);
-        
+
         #check if we got what we expected....
         if($token && !strstr($token,":"))
             return FALSE;
-        
+
         #get the goodies
         list($hash,$expire,$ip)=explode(":",$token);
-        
+
         #Make sure the session hash is valid
         if((md5($expire . SESSION_SECRET . $this->userID)!=$hash)){
             return FALSE;
         }
         #is it expired??
-        
-        
+
+
         if($maxidletime && ((time()-$expire)>$maxidletime)){
             return FALSE;
         }
@@ -104,7 +104,7 @@ class UserSession {
 }
 
 class ClientSession extends Client {
-    
+
     var $session;
 
     function ClientSession($email, $id){
@@ -117,7 +117,7 @@ class ClientSession extends Client {
 
         if(!$this->getId() || $this->session->getSessionId()!=session_id())
             return false;
-        
+
         return $this->session->isvalidSession($_SESSION['_client']['token'],$cfg->getClientTimeout(),false)?true:false;
     }
 
@@ -134,17 +134,17 @@ class ClientSession extends Client {
     function getSessionToken() {
         return $this->session->sessionToken();
     }
-    
+
     function getIP(){
         return $this->session->getIP();
-    }    
+    }
 }
 
 
 class StaffSession extends Staff {
-    
+
     var $session;
-    
+
     function StaffSession($var){
         parent::Staff($var);
         $this->session= new UserSession($this->getId());
@@ -155,7 +155,7 @@ class StaffSession extends Staff {
 
         if(!$this->getId() || $this->session->getSessionId()!=session_id())
             return false;
-        
+
         return $this->session->isvalidSession($_SESSION['_staff']['token'],$cfg->getStaffTimeout(),$cfg->enableStaffIPBinding())?true:false;
     }
 
@@ -163,7 +163,7 @@ class StaffSession extends Staff {
         global $_SESSION;
         $_SESSION['_staff']['token']=$this->getSessionToken();
     }
-    
+
     function getSession() {
         return $this->session;
     }
@@ -171,11 +171,11 @@ class StaffSession extends Staff {
     function getSessionToken() {
         return $this->session->sessionToken();
     }
-    
+
     function getIP(){
         return $this->session->getIP();
     }
-    
+
 }
 
 ?>
diff --git a/include/client/faq-category.inc.php b/include/client/faq-category.inc.php
index 50a51782f214b8fc28b78f54afdd005c3f1a71df..4a87159cd3d0057232c659b101f211a801634ce2 100644
--- a/include/client/faq-category.inc.php
+++ b/include/client/faq-category.inc.php
@@ -9,7 +9,8 @@ if(!defined('OSTCLIENTINC') || !$category || !$category->isPublic()) die('Access
 <?php
 $sql='SELECT faq.faq_id, question, count(attach.file_id) as attachments '
     .' FROM '.FAQ_TABLE.' faq '
-    .' LEFT JOIN '.FAQ_ATTACHMENT_TABLE.' attach ON(attach.faq_id=faq.faq_id) '
+    .' LEFT JOIN '.ATTACHMENT_TABLE.' attach
+         ON(attach.object_id=faq.faq_id AND attach.type=\'F\' AND attach.inline = 0) '
     .' WHERE faq.ispublished=1 AND faq.category_id='.db_input($category->getId())
     .' GROUP BY faq.faq_id';
 if(($res=db_query($sql)) && db_num_rows($res)) {
diff --git a/include/client/header.inc.php b/include/client/header.inc.php
index 6636c4ddeb1c18d2b478d695a4226e8a219239e3..2849ccbe3221aafd203cc8dcaf2bf6c28d39fd51 100644
--- a/include/client/header.inc.php
+++ b/include/client/header.inc.php
@@ -13,9 +13,21 @@ header("Content-Type: text/html; charset=UTF-8\r\n");
     <link rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/osticket.css" media="screen">
     <link rel="stylesheet" href="<?php echo ASSETS_PATH; ?>css/theme.css" media="screen">
     <link rel="stylesheet" href="<?php echo ASSETS_PATH; ?>css/print.css" media="print">
-    <script src="<?php echo ROOT_PATH; ?>js/jquery-1.7.2.min.js"></script>
+    <link type="text/css" href="<?php echo ROOT_PATH; ?>css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
+    <link rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/thread.css" media="screen">
+    <link rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/redactor.css" media="screen">
+    <link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/font-awesome.min.css">
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/jquery-1.8.3.min.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/jquery-ui-1.10.3.custom.min.js"></script>
     <script src="<?php echo ROOT_PATH; ?>js/jquery.multifile.js"></script>
     <script src="<?php echo ROOT_PATH; ?>js/osticket.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/redactor.min.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/redactor-osticket.js"></script>
+    <?php
+    if($ost && ($headers=$ost->getExtraHeaders())) {
+        echo "\n\t".implode("\n\t", $headers)."\n";
+    }
+    ?>
 </head>
 <body>
     <div id="container">
diff --git a/include/client/open.inc.php b/include/client/open.inc.php
index 275e856dea07f8726f06b3fa6641392e459bb2e4..a0a97b7a3aa711a7446236f249cff0cb084fec8b 100644
--- a/include/client/open.inc.php
+++ b/include/client/open.inc.php
@@ -33,7 +33,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):$info;
         <th class="required" width="160">Email Address:</th>
         <td>
             <?php
-            if($thisclient && $thisclient->isValid()) { 
+            if($thisclient && $thisclient->isValid()) {
                 echo $thisclient->getEmail();
             } else { ?>
                 <input id="email" type="text" name="email" size="30" value="<?php echo $info['email']; ?>">
@@ -50,7 +50,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):$info;
             <label for="ext" class="inline">Ext.:</label>
             <input id="ext" type="text" name="phone_ext" size="3" value="<?php echo $info['phone_ext']; ?>">
             <font class="error">&nbsp;<?php echo $errors['phone']; ?>&nbsp;&nbsp;<?php echo $errors['phone_ext']; ?></font>
-        </td>   
+        </td>
     </tr>
     <tr><td colspan=2>&nbsp;</td></tr>
     <tr>
@@ -82,8 +82,13 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):$info;
     <tr>
         <td class="required">Message:</td>
         <td>
-            <div><em>Please provide as much detail as possible so we can best assist you.</em> <font class="error">*&nbsp;<?php echo $errors['message']; ?></font></div>
-            <textarea id="message" cols="60" rows="8" name="message"><?php echo $info['message']; ?></textarea>
+            <div style="margin-bottom:0.5em;"><em>Please provide as much detail as possible so we can best assist you.</em> <font class="error">*&nbsp;<?php echo $errors['message']; ?></font>
+                </div>
+            <textarea id="message" cols="60" rows="8" name="message"
+                class="richtext ifhtml draft"
+                data-draft-namespace="ticket.client"
+                data-draft-object-id="<?php echo substr(session_id(), -12); ?>"
+                ><?php echo $info['message']; ?></textarea>
         </td>
     </tr>
 
@@ -111,7 +116,7 @@ $info=($_POST && $errors)?Format::htmlchars($_POST):$info;
                     foreach($priorities as $id =>$name) {
                         echo sprintf('<option value="%d" %s>%s</option>',
                                         $id, ($info['priorityId']==$id)?'selected="selected"':'', $name);
-                        
+
                     }
                 ?>
             </select>
diff --git a/include/client/view.inc.php b/include/client/view.inc.php
index f6bac88409d136cb6495b588f5cfe3c80549dae2..97202f4d0ee962d879c3c3e9b0cb2d8516c6750c 100644
--- a/include/client/view.inc.php
+++ b/include/client/view.inc.php
@@ -73,11 +73,16 @@ if($ticket->getThreadCount() && ($thread=$ticket->getClientThread())) {
         ?>
         <table class="<?php echo $threadType[$entry['thread_type']]; ?>" cellspacing="0" cellpadding="1" width="800" border="0">
             <tr><th><?php echo Format::db_datetime($entry['created']); ?> &nbsp;&nbsp;<span><?php echo $poster; ?></span></th></tr>
-            <tr><td><?php echo Format::display($entry['body']); ?></td></tr>
+            <tr><td class="thread-body"><?php echo Format::display($entry['body']); ?></td></tr>
             <?php
             if($entry['attachments']
                     && ($tentry=$ticket->getThreadEntry($entry['id']))
+                    && ($urls = $tentry->getAttachmentUrls())
                     && ($links=$tentry->getAttachmentsLinks())) { ?>
+                <script type="text/javascript">
+                    $(function() { showImagesInline(<?php echo
+                        JsonDataEncoder::encode($urls); ?>); });
+                </script>
                 <tr><td class="info"><?php echo $links; ?></td></tr>
             <?php
             } ?>
@@ -113,8 +118,12 @@ if($ticket->getThreadCount() && ($thread=$ticket->getClientThread())) {
                     $msg='To best assist you, please be specific and detailed';
                 }
                 ?>
-                <span id="msg"><em><?php echo $msg; ?> </em></span><font class="error">*&nbsp;<?php echo $errors['message']; ?></font><br/>
-                <textarea name="message" id="message" cols="50" rows="9" wrap="soft"><?php echo $info['message']; ?></textarea>
+                <span id="msg"><em><?php echo $msg; ?> </em></span><font class="error">*&nbsp;<?php echo $errors['message']; ?></font>
+                <br/>
+                <textarea name="message" id="message" cols="50" rows="9" wrap="soft"
+                    data-draft-namespace="ticket.client"
+                    data-draft-object-id="<?php echo $ticket->getExtId(); ?>"
+                    class="richtext ifhtml draft"><?php echo $info['message']; ?></textarea>
             </td>
         </tr>
         <?php
diff --git a/include/html2text.php b/include/html2text.php
new file mode 100644
index 0000000000000000000000000000000000000000..fb84a7b3801acd2ef4234be98f4a89c6870077fb
--- /dev/null
+++ b/include/html2text.php
@@ -0,0 +1,814 @@
+<?php
+/******************************************************************************
+ * Copyright (c) 2010 Jevon Wright and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Jevon Wright - initial API and implementation
+ *    Jared Hancock - html table implementation
+ ****************************************************************************/
+
+/**
+ * Tries to convert the given HTML into a plain text format - best suited for
+ * e-mail display, etc.
+ *
+ * <p>In particular, it tries to maintain the following features:
+ * <ul>
+ *   <li>Links are maintained, with the 'href' copied over
+ *   <li>Information in the &lt;head&gt; is lost
+ * </ul>
+ *
+ * @param html the input HTML
+ * @return the HTML converted, as best as possible, to text
+ */
+function convert_html_to_text($html, $width=74) {
+    $html = fix_newlines($html);
+
+    $doc = new DOMDocument('1.0', 'utf-8');
+    if (!@$doc->loadHTML($html))
+        return $html;
+
+    $elements = identify_node($doc);
+
+    // Add the default stylesheet
+    $elements->getRoot()->addStylesheet(
+        HtmlStylesheet::fromArray(array(
+            'p' => array('margin-bottom' => 1),
+            'pre' => array('border-width' => 1, 'white-space' => 'pre'),
+        ))
+    );
+    $options = array();
+    if (is_object($elements))
+        $output = $elements->render($width, $options);
+    else
+        $output = $elements;
+
+    return trim($output);
+}
+
+/**
+ * Unify newlines; in particular, \r\n becomes \n, and
+ * then \r becomes \n. This means that all newlines (Unix, Windows, Mac)
+ * all become \ns.
+ *
+ * @param text text with any number of \r, \r\n and \n combinations
+ * @return the fixed text
+ */
+function fix_newlines($text) {
+    // replace \r\n to \n
+    // remove \rs
+    $text = str_replace("\r\n?", "\n", $text);
+
+    return $text;
+}
+
+function identify_node($node, $parent=null) {
+    if ($node instanceof DOMText)
+        return $node;
+    if ($node instanceof DOMDocument)
+        return identify_node($node->childNodes->item(1), $parent);
+    if ($node instanceof DOMDocumentType
+            || $node instanceof DOMComment)
+        // ignore
+        return "";
+
+    $name = strtolower($node->nodeName);
+
+    // start whitespace
+    switch ($name) {
+        case "hr":
+            return new HtmlHrElement($node, $parent);
+        case "br":
+            return "\n";
+
+        case "style":
+            $parent->getRoot()->addStylesheet(new HtmlStylesheet($node));
+        case "title":
+        case "meta":
+        case "script":
+        case "link":
+            // ignore these tags
+            return "";
+
+        case "head":
+        case "html":
+        case "body":
+        case "div":
+        case "p":
+        case "pre":
+            return new HtmlBlockElement($node, $parent);
+
+        case "blockquote":
+            return new HtmlBlockquoteElement($node, $parent);
+        case "cite":
+            return new HtmlCiteElement($node, $parent);
+
+        case "h1":
+        case "h2":
+        case "h3":
+        case "h4":
+        case "h5":
+        case "h6":
+            return new HtmlHeadlineElement($node, $parent);
+
+        case "a":
+            return new HtmlAElement($node, $parent);
+
+        case "b":
+        case "strong":
+            return new HtmlBElement($node, $parent);
+
+        case "u":
+            return new HtmlUElement($node, $parent);
+
+        case "ol":
+            return new HtmlListElement($node, $parent);
+        case "ul":
+            return new HtmlUnorderedListElement($node, $parent);
+
+        case 'table':
+            return new HtmlTable($node, $parent);
+
+        case "img":
+            return new HtmlImgElement($node, $parent);
+
+        case "code":
+            return new HtmlCodeElement($node, $parent);
+
+        default:
+            // print out contents of unknown tags
+            if ($node->hasChildNodes() && $node->childNodes->length == 1)
+                return identify_node($node->childNodes->item(0), $parent);
+
+            return new HtmlInlineElement($node, $parent);
+    }
+}
+
+class HtmlInlineElement {
+    var $children = array();
+    var $style = false;
+    var $stylesheets = array();
+    var $ws = false;
+
+    function __construct($node, $parent) {
+        $this->parent = $parent;
+        $this->node = $node;
+        $this->traverse($node);
+        if ($node instanceof DomElement
+                && ($style = $this->node->getAttribute('style')))
+            $this->style = new CssStyleRules($style);
+    }
+
+    function traverse($node) {
+        if ($node->hasChildNodes()) {
+            for ($i = 0; $i < $node->childNodes->length; $i++) {
+                $n = $node->childNodes->item($i);
+                $this->children[] = identify_node($n, $this);
+            }
+        }
+    }
+
+    function render($width, $options) {
+        $output = '';
+        $this->ws = $this->getStyle('white-space', 'normal');
+        foreach ($this->children as $c) {
+            if ($c instanceof DOMText) {
+                // Collapse white-space
+                switch ($this->ws) {
+                    case 'pre':
+                    case 'pre-wrap':
+                        $more = $c->wholeText;
+                        break;
+                    case 'nowrap':
+                    case 'pre-line':
+                    case 'normal':
+                    default:
+                        $more = preg_replace('/\s+/m', ' ', $c->wholeText);
+                }
+            }
+            elseif ($c instanceof HtmlInlineElement) {
+                $more = $c->render($width, $options);
+            }
+            else {
+                $more = $c;
+            }
+            if ($more instanceof PreFormattedText)
+                $output = new PreFormattedText($output . $more);
+            elseif (is_string($more))
+                $output .= $more;
+        }
+        return $output;
+    }
+
+    function getWeight() {
+        if (!isset($this->weight)) {
+            $this->weight = 0;
+            foreach ($this->children as $c) {
+                if ($c instanceof HtmlInlineElement)
+                    $this->weight += $c->getWeight();
+                elseif ($c instanceof DomText)
+                    $this->weight += strlen($c->wholeText);
+            }
+        }
+        return $this->weight;
+    }
+
+    function getStyle($property, $default=null, $tag=false, $classes=false) {
+        if ($this->style && $this->style->has($property))
+            return $this->style->get($property);
+
+        if ($tag === false)
+            $tag = $this->node->nodeName;
+        if ($classes === false) {
+            if ($c = $this->node->getAttribute('class'))
+                $classes = explode(' ', $c);
+            else
+                $classes = array();
+        }
+
+        if ($this->stylesheets) {
+            foreach ($this->stylesheets as $sheet)
+                if ($s = $sheet->get($tag, $classes))
+                    return $s->get($property, $default);
+        }
+        elseif ($this->parent) {
+            return $this->getRoot()->getStyle($property, $default, $tag, $classes);
+        }
+        else {
+            return $default;
+        }
+    }
+
+    function getRoot() {
+        if (!$this->parent)
+            return $this;
+        elseif (!isset($this->root))
+            $this->root = $this->parent->getRoot();
+        return $this->root;
+    }
+
+    function addStylesheet(&$s) {
+        $this->stylesheets[] = $s;
+    }
+}
+
+class HtmlBlockElement extends HtmlInlineElement {
+    var $min_width = false;
+
+    function render($width, $options) {
+        // Allow room for the border.
+        // TODO: Consider left-right padding and margin
+        $bw = $this->getStyle('border-width', 0);
+        if ($bw)
+            $width -= 4;
+
+        $output = parent::render($width, $options);
+        if ($output instanceof PreFormattedText)
+            // TODO: Consider CSS rules
+            return new PreFormattedText("\n" . $output);
+
+        $output = trim($output);
+        if (!strlen(trim($output)))
+            return "";
+
+        // Wordwrap the content to the width
+        switch ($this->ws) {
+            case 'nowrap':
+            case 'pre':
+                break;
+            case 'pre-line':
+            case 'pre-wrap':
+            case 'normal':
+            default:
+                $output = wordwrap($output, $width, "\n", true);
+        }
+
+        // Apply stylesheet styles
+        // TODO: Padding
+        // Border
+        if ($bw)
+            $output = self::borderize($output, $width);
+        // Margin
+        $mb = $this->getStyle('margin-bottom', 0);
+        $output .= str_repeat("\n", (int)$mb);
+
+        return "\n" . $output;
+    }
+
+    function borderize($what, $width) {
+        $output = ',-'.str_repeat('-', $width)."-.\n";
+        foreach (explode("\n", $what) as $l)
+            $output .= '| '.str_pad($l, $width)." |\n";
+        $output .= '`-'.str_repeat('-', $width)."-'\n";
+        return $output;
+    }
+
+    function getMinWidth() {
+        if ($this->min_width === false) {
+            foreach ($this->children as $c) {
+                if ($c instanceof HtmlBlockElement)
+                    $this->min_width = max($c->getMinWidth(), $this->min_width);
+                elseif ($c instanceof DomText)
+                    $this->min_width = max(max(array_map('strlen', explode(' ', $c->wholeText))),
+                        $this->min_width);
+            }
+        }
+        return $this->min_width;
+    }
+}
+
+class HtmlUElement extends HtmlInlineElement {
+    function render($width, $options) {
+        $output = parent::render($width, $options);
+        return "_".str_replace(" ", "_", $output)."_";
+    }
+    function getWeight() { return parent::getWeight() + 2; }
+}
+
+class HtmlBElement extends HtmlInlineElement {
+    function render($width, $options) {
+        $output = parent::render($width, $options);
+        return "*".$output."*";
+    }
+    function getWeight() { return parent::getWeight() + 2; }
+}
+
+class HtmlHrElement extends HtmlBlockElement {
+    function render($width, $options) {
+        return "\n".str_repeat('-', $width)."\n";
+    }
+    function getWeight() { return 1; }
+    function getMinWidth() { return 0; }
+}
+
+class HtmlHeadlineElement extends HtmlBlockElement {
+    function render($width, $options) {
+        $headline = parent::render($width, $options) . "\n";
+        $line = false;
+        switch ($this->node->nodeName) {
+            case 'h1':
+            case 'h2':
+                $line = '=';
+                break;
+            case 'h3':
+            case 'h4':
+                $line = '-';
+                break;
+        }
+        if ($line)
+            $headline .= str_repeat($line, strpos($headline, "\n", 1) - 1) . "\n";
+        return $headline;
+    }
+}
+
+class HtmlBlockquoteElement extends HtmlBlockElement {
+    function render($width, $options) {
+        return str_replace("\n", "\n> ",
+            rtrim(parent::render($width-2, $options)))."\n";
+    }
+    function getWeight() { return parent::getWeight()+2; }
+}
+
+class HtmlCiteElement extends HtmlBlockElement {
+    function render($width, $options) {
+        $options['trim'] = false;
+        $lines = explode("\n", ltrim(parent::render($width-3, $options)));
+        $lines[0] = "-- " . $lines[0];
+        // Right justification
+        foreach ($lines as &$l)
+            $l = str_pad($l, $width, " ", STR_PAD_LEFT);
+        unset($l);
+        return implode("\n", $lines);
+    }
+}
+
+class HtmlImgElement extends HtmlInlineElement {
+    function render($width, $options) {
+        // Images are returned as [alt: title]
+        $title = $this->node->getAttribute("title");
+        if ($title)
+            $title = ": $title";
+        $alt = $this->node->getAttribute("alt");
+        return "[$alt$title] ";
+    }
+    function getWeight() { return parent::getWeight() + 4; }
+}
+
+class HtmlAElement extends HtmlInlineElement {
+    function render($width, $options) {
+        // links are returned in [text](link) format
+        $output = parent::render($width, $options);
+        $href = $this->node->getAttribute("href");
+        if ($href == null) {
+            // it doesn't link anywhere
+            if ($this->node->getAttribute("name") != null) {
+                $output = "[$output]";
+            }
+        } else {
+            if ($href != $output) {
+                $output = "[$output]($href)";
+            }
+        }
+        return $output;
+    }
+    function getWeight() { return parent::getWeight() + 4; }
+}
+
+class HtmlListElement extends HtmlBlockElement {
+    var $marker = "  %d. ";
+
+    function render($width, $options) {
+        $options['marker'] = $this->marker;
+        $options['trim'] = false;
+        return parent::render($width, $options);
+    }
+
+    function traverse($node, $number=1) {
+        if ($node instanceof DOMText)
+            return;
+        switch (strtolower($node->nodeName)) {
+            case "li":
+                $this->children[] = new HtmlListItem($node, $this->parent, $number++);
+                return;
+            // Anything else is ignored
+        }
+        for ($i = 0; $i < $node->childNodes->length; $i++)
+            $this->traverse($node->childNodes->item($i), $number);
+    }
+}
+
+class HtmlUnorderedListElement extends HtmlListElement {
+    var $marker = "  * ";
+}
+
+class HtmlListItem extends HtmlBlockElement {
+    function HtmlListItem($node, $parent, $number) {
+        parent::__construct($node, $parent);
+        $this->number = $number;
+    }
+
+    function render($width, $options) {
+        $prefix = sprintf($options['marker'], $this->number);
+        $lines = explode("\n", trim(parent::render($width-strlen($prefix), $options)));
+        $lines[0] = $prefix . $lines[0];
+        return new PreFormattedText(
+            implode("\n".str_repeat(" ", strlen($prefix)), $lines)."\n");
+    }
+}
+
+class HtmlCodeElement extends HtmlInlineElement {
+     function render($width, $options) {
+        return '`'.parent::render($width-2, $options).'`';
+    }
+}
+
+class HtmlTable extends HtmlBlockElement {
+    function __construct($node, $parent) {
+        $this->body = array();
+        $this->foot = array();
+        $this->rows = &$this->body;
+        parent::__construct($node, $parent);
+    }
+
+    function getMinWidth() {
+        if (false === $this->min_width) {
+            foreach ($this->rows as $r)
+                foreach ($r as $cell)
+                    $this->min_width = max($this->min_width, $cell->getMinWidth());
+        }
+        return $this->min_width + 4;
+    }
+
+    function getWeight() {
+        if (!isset($this->weight)) {
+            $this->weight = 0;
+            foreach ($this->rows as $r)
+                foreach ($r as $cell)
+                    $this->weight += $cell->getWeight();
+        }
+        return $this->weight;
+    }
+
+    function traverse($node) {
+        if ($node instanceof DOMText)
+            return;
+
+        $name = strtolower($node->nodeName);
+        switch ($name) {
+            case 'th':
+            case 'td':
+                $this->row[] = new HtmlTableCell($node, $this->parent);
+                // Don't descend into this node. It should be handled by the
+                // HtmlTableCell::traverse
+                return;
+
+            case 'tr':
+                unset($this->row);
+                $this->row = array();
+                $this->rows[] = &$this->row;
+                break;
+
+            case 'caption':
+                $this->caption = new HtmlBlockElement($node, $this->parent);
+                return;
+
+            case 'tbody':
+            case 'thead':
+                unset($this->rows);
+                $this->rows = &$this->body;
+                break;
+
+            case 'tfoot':
+                unset($this->rows);
+                $this->rows = &$this->foot;
+                break;
+        }
+        for ($i = 0; $i < $node->childNodes->length; $i++)
+            $this->traverse($node->childNodes->item($i));
+    }
+
+    /**
+     * Ensure that no column is below its minimum width. Each column that is
+     * below its minimum will borrow from a column that is above its
+     * minimum. The process will continue until all columns are above their
+     * minimums or all columns are below their minimums.
+     */
+    function _fixupWidths(&$widths, $mins) {
+        foreach ($widths as $i=>$w) {
+            if ($w < $mins[$i]) {
+                // Borrow from another column -- the furthest one away from
+                // its minimum width
+                $best = 0; $bestidx = false;
+                foreach ($widths as $j=>$w) {
+                    if ($i == $j)
+                        continue;
+                    if ($w > $mins[$j]) {
+                        if ($w - $mins[$j] > $best) {
+                            $best = $w - $mins[$j];
+                            $bestidx = $j;
+                        }
+                    }
+                }
+                if ($bestidx !== false) {
+                    $widths[$bestidx]--;
+                    $widths[$i]++;
+                    return $this->_fixupWidths($widths, $mins);
+                }
+            }
+        }
+    }
+
+    function render($width, $options) {
+        $cols = 0;
+        $rows = array_merge($this->body, $this->foot);
+
+        # Count the number of columns
+        foreach ($rows as $r)
+            $cols = max($cols, count($r));
+
+        # Find the largest cells in all columns
+        $weights = $mins = array_fill(0, $cols, 0);
+        foreach ($rows as $r) {
+            $i = 0;
+            foreach ($r as $cell) {
+                for ($j=0; $j<$cell->cols; $j++) {
+                    $weights[$i] = max($weights[$i], $cell->getWeight());
+                    $mins[$i] = max($mins[$i], $cell->getMinWidth());
+                }
+                $i += $cell->cols;
+            }
+        }
+
+        # Subtract internal padding and borders from the available width
+        $inner_width = $width - $cols*3 - 1;
+
+        # Optimal case, where the preferred width of all the columns is
+        # doable
+        if (array_sum($weights) <= $inner_width)
+            $widths = $weights;
+        # Worst case, where the minimum size of the columns exceeds the
+        # available width
+        elseif (array_sum($mins) > $inner_width)
+            $widths = $mins;
+        # Most likely case, where the table can be fit into the available
+        # width
+        else {
+            $total = array_sum($weights);
+            $widths = array();
+            foreach ($weights as $c)
+                $widths[] = (int)($inner_width * $c / $total);
+            $this->_fixupWidths($widths, $mins);
+        }
+        $outer_width = array_sum($widths) + $cols*3 + 1;
+
+        $contents = array();
+        $heights = array();
+        foreach ($rows as $y=>$r) {
+            $heights[$y] = 0;
+            for ($x = 0, $i = 0; $x < $cols; $i++) {
+                if (!isset($r[$i])) {
+                    // No cell at the end of this row
+                    $contents[$y][$i][] = "";
+                    break;
+                }
+                $cell = $r[$i];
+                # Compute the effective cell width for spanned columns
+                # Add extra space for the unneeded border padding for
+                # spanned columns
+                $cwidth = ($cell->cols - 1) * 3;
+                for ($j = 0; $j < $cell->cols; $j++)
+                    $cwidth += $widths[$x+$j];
+                # Stash the computed width so it doesn't need to be
+                # recomputed again below
+                $cell->width = $cwidth;
+                unset($data);
+                $data = explode("\n", $cell->render($cwidth, $options));
+                $heights[$y] = max(count($data), $heights[$y]);
+                $contents[$y][$i] = &$data;
+                $x += $cell->cols;
+            }
+        }
+
+        # Build the header
+        $header = "";
+        for ($i = 0; $i < $cols; $i++)
+            $header .= "+-" . str_repeat("-", $widths[$i]) . "-";
+        $header .= "+";
+
+        # Emit the rows
+        $output = "\n";
+        if (isset($this->caption)) {
+            $this->caption = $this->caption->render($outer_width, $options);
+        }
+        foreach ($rows as $y=>$r) {
+            $output .= $header . "\n";
+            for ($x = 0, $k = 0; $k < $heights[$y]; $k++) {
+                $output .= "|";
+                foreach ($r as $x=>$cell) {
+                    $content = (isset($contents[$y][$x][$k]))
+                        ? $contents[$y][$x][$k] : "";
+                    $pad = $cell->width - mb_strlen($content, 'utf8');
+                    $output .= " ".$content;
+                    if ($pad > 0)
+                        $output .= str_repeat(" ", $pad);
+                    $output .= " |";
+                    $x += $cell->cols;
+                }
+                $output .= "\n";
+            }
+        }
+        $output .= $header . "\n";
+        return new PreFormattedText($output);
+    }
+}
+
+class HtmlTableCell extends HtmlBlockElement {
+    function __construct($node, $parent) {
+        parent::__construct($node, $parent);
+        $this->cols = $node->getAttribute('colspan');
+        $this->rows = $node->getAttribute('rowspan');
+
+        if (!$this->cols) $this->cols = 1;
+        if (!$this->rows) $this->rows = 1;
+    }
+
+    function render($width, $options) {
+        return ltrim(parent::render($width, $options));
+    }
+
+    function getWeight() {
+        return parent::getWeight() / ($this->cols * $this->rows);
+    }
+
+    function getMinWidth() {
+        return parent::getMinWidth() / $this->cols;
+    }
+}
+
+class HtmlStylesheet {
+    function __construct($node=null) {
+        if (!$node) return;
+
+        // We really only care about tags and classes
+        $rules = array();
+        preg_match_all('/([^{]+)\{((\s*[\w-]+:\s*[^;}]+;?)+)\s*\}/m',
+            $node->textContent, $rules, PREG_SET_ORDER);
+
+        $this->rules = array();
+        $m = array();
+        foreach ($rules as $r) {
+            list(,$selector,$props) = $r;
+            $props = new CssStyleRules($props);
+            foreach (explode(',', $selector) as $s) {
+                // Only allow tag and class selectors
+                if (preg_match('/^([\w-]+)?(\.[\w_-]+)?$/m', trim($s), $m))
+                    // XXX: Technically, a selector could be listed more
+                    // than once, and the rules should be aggregated.
+                    $this->rules[$m[0]] = &$props;
+            }
+            unset($props);
+        }
+    }
+
+    function get($tag, $classes=array()) {
+        // Honor CSS specificity
+        foreach ($this->rules as $selector=>$rules)
+            foreach ($classes as $c)
+                if ($selector == "$tag.$c" || $selector == ".$c")
+                    return $rules;
+        foreach ($this->rules as $selector=>$rules)
+            if ($selector == $tag)
+                return $rules;
+    }
+
+    static function fromArray($selectors) {
+        $self = new HtmlStylesheet();
+        foreach ($selectors as $s=>$rules)
+            $self->rules[$s] = CssStyleRules::fromArray($rules);
+        return $self;
+    }
+}
+
+class CssStyleRules {
+    var $rules = array();
+
+    function __construct($rules) {
+        foreach (explode(';', $rules) as $r) {
+            if (strpos($r, ':') === false)
+                continue;
+            list($prop, $val) = explode(':', $r);
+            $this->rules[trim($prop)] = trim($val);
+            // TODO: Explode compact rules, like 'border', 'margin', etc.
+        }
+    }
+
+    function has($prop) {
+        return isset($this->rules[$prop]);
+    }
+
+    function get($prop, $default=0.0) {
+        if (!isset($this->rules[$prop]))
+            return $default;
+        else
+            $val = $this->rules[$prop];
+
+        if (is_string($val)) {
+            switch (true) {
+                case is_float($default):
+                    $simple = floatval($val);
+                    $units = substr($val, -2);
+                    // Cache the conversion
+                    $val = $this->rules[$prop] = self::convert($simple, $units);
+            }
+        }
+        return $val;
+    }
+
+    static function convert($value, $units) {
+        if ($value === null)
+            return $value;
+
+        // Converts common CSS units to units of characters
+        switch ($units) {
+            case 'px':
+                return $value / 20.0;
+            case 'pt':
+                return $value / 12.0;
+            case 'em':
+            default:
+                return $value;
+        }
+    }
+
+    static function fromArray($rules) {
+        $self = new CssStyleRules('');
+        $self->rules = &$rules;
+        return $self;
+    }
+}
+
+class PreFormattedText {
+    function __construct($text) {
+        $this->text = $text;
+    }
+    function __toString() {
+        return $this->text;
+    }
+}
+
+// Enable use of html2text from command line
+// The syntax is the following: php html2text.php file.html
+
+do {
+  if (PHP_SAPI != 'cli') break;
+  if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break;
+  if (empty ($_SERVER['PHP_SELF']) || FALSE === strpos ($_SERVER['PHP_SELF'], 'html2text.php') ) break;
+  $file = $argv[1];
+  $width = 74;
+  if (isset($argv[2]))
+      $width = (int) $argv[2];
+  echo convert_html_to_text (file_get_contents ($file), $width);
+} while (0);
diff --git a/include/i18n/en_US/file.yaml b/include/i18n/en_US/file.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..19f2e35a5a04618e8b08a015961581f82634937c
--- /dev/null
+++ b/include/i18n/en_US/file.yaml
@@ -0,0 +1,233 @@
+#
+# files.yaml
+#
+# Files initially inserted into the system. Canned responses have their own
+# method for attachments; however, this file will make it easier to add
+# thinkgs like inline images.
+#
+# NOTE: If the files aren't attached to something by the installer, they
+# bill be cleaned up shortly after installation (by the autocron).
+#
+---
+- hash: b56944cb4722cc5cda9d1e23a3ea7fbc
+  name: powered-by-osticket.png
+  type: image/png
+  encoding: base64
+  data: |
+      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
+
+- hash: 6fe1efdea357534d238b86e7860a7c5a
+  name: kangaroo.png
+  type: image/png
+  encoding: base64
+  data: |
+      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
diff --git a/include/i18n/en_US/help_topic.yaml b/include/i18n/en_US/help_topic.yaml
index 39b77320aaaa04b3effb577763b2be97d8aa45c7..11d7e819ccdaf3b5469e622bc4a974536130192d 100644
--- a/include/i18n/en_US/help_topic.yaml
+++ b/include/i18n/en_US/help_topic.yaml
@@ -8,8 +8,9 @@
 # ispublic - (bool:0|1) true or false if end users should be able to see the
 #       help topic. In other words, true or false if the help topic is _not_
 #       for internal use only
-# noautoresp - (bool:0|1) true or false if the autoresponder should be
-#       disabled for tickets assigned to this help topic
+# noautoresp - (bool:1) true to disable the auto-responder for tickets
+#       assigned to this help topic. NOTE that this field must be completely
+#       omitted to ENABLE the auto-response by default
 # dept_id - (int) id number of the department with which this help topic is
 #       associated
 # sla_id - (int:optional) id number of the sla with which this help topic is
@@ -19,7 +20,6 @@
 ---
 - isactive: 1
   ispublic: 1
-  noautoresp: 0
   dept_id: 1
   sla_id: 1
   priority_id: 2
@@ -29,7 +29,6 @@
 
 - isactive: 1
   ispublic: 1
-  noautoresp: 0
   dept_id: 1
   sla_id: 0
   priority_id: 2
diff --git a/include/i18n/en_US/templates/email/assigned.alert.yaml b/include/i18n/en_US/templates/email/assigned.alert.yaml
index b2e9ffbd6ede5f86f803c86606927cf5570a2526..7c4a1e5a445d8e664993f7e750412568a31efa33 100644
--- a/include/i18n/en_US/templates/email/assigned.alert.yaml
+++ b/include/i18n/en_US/templates/email/assigned.alert.yaml
@@ -15,18 +15,45 @@ notes: |
 subject: |
     Ticket #%{ticket.number} Assigned to you
 body: |
-    %{assignee},
-
-    Ticket #%{ticket.number} has been assigned to you by %{assigner}
-
-    ----------------------
-
-    %{comments}
-
-    ----------------------
-
-    To view complete details, simply login to the support system.
-
-    %{ticket.staff_link}
-
-    - Your friendly Support Ticket System - powered by osTicket.
+    <h3><strong>Hi %{assignee},</strong></h3>
+    <p>
+        Ticket <a href="%{ticket.staff_link}">#%{ticket.number}</a> has been
+        assigned to you by %{assigner}
+    </p>
+    <table>
+    <tbody>
+    <tr>
+        <td>
+             <strong>From</strong>:
+        </td>
+        <td>
+             %{ticket.name} &lt;%{ticket.email}&gt;
+        </td>
+    </tr>
+    <tr>
+        <td>
+             <strong>Subject</strong>:
+        </td>
+        <td>
+             %{ticket.subject}
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p>
+         %{comments}
+    </p>
+    <hr>
+    <p>
+         <span style="color: rgb(127, 127, 127); font-size: small; ">To
+         view/respond to the ticket, please <a
+         href="%{ticket.staff_link}"><span style="color: rgb(84, 141, 212);"
+         >login</span></a> to the support ticket system</span>
+    </p>
+    <p>
+         <em>Your friendly Customer Support System</em>
+    </p>
+    <p>
+         <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"
+         alt="Powered by osTicket" width="146" height="22" style="width: 146px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/message.alert.yaml b/include/i18n/en_US/templates/email/message.alert.yaml
index b5d505d9f7c085cc6037a6f7ea52f0771f2540b5..2e519fe197b6635233c53d470b86b78442d7e39d 100644
--- a/include/i18n/en_US/templates/email/message.alert.yaml
+++ b/include/i18n/en_US/templates/email/message.alert.yaml
@@ -15,20 +15,45 @@ notes: |
 subject: |
     New Message Alert
 body: |
-    %{recipient},
-
-    New message appended to ticket #%{ticket.number}
-
-    ----------------------
-    Name: %{ticket.name}
-    Email: %{ticket.email}
-    Dept: %{ticket.dept.name}
-
-    %{message}
-    ----------------------
-
-    To view/respond to the ticket, please login to the support ticket system.
-
-    %{ticket.staff_link}
-
-    - Your friendly Customer Support System - powered by osTicket.
+    <h3><strong>Hi %{recipient},</strong></h3>
+    <p>
+        New message appended to ticket <a
+        href="%{ticket.staff_link}">#%{ticket.number}</a>
+    </p>
+    <table>
+    <tbody>
+    <tr>
+        <td>
+             <strong>From</strong>:
+        </td>
+        <td>
+             %{ticket.name} &lt;%{ticket.email}&gt;
+        </td>
+    </tr>
+    <tr>
+        <td>
+             <strong>Department</strong>:
+        </td>
+        <td>
+             %{ticket.dept.name}
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p>
+         %{message}
+    </p>
+    <hr>
+    <p>
+        <span style="color: rgb(127, 127, 127); font-size: small">To
+        view/respond to the ticket, please <a
+        href="%{ticket.staff_link}"><span style="color: rgb(84, 141, 212);"
+        >login</span></a> to the support ticket system</span>
+    </p>
+    <p>
+         <em>Your friendly Customer Support System</em>
+    </p>
+    <p>
+         <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"
+         alt="Powered by osTicket" width="126" height="19" style="width: 126px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/message.autoresp.yaml b/include/i18n/en_US/templates/email/message.autoresp.yaml
index 52e16e4f6cb6cf0fd37b25585dc2175a9afba55e..8e86947b4a6d9006ebc70d739ce6d6790790fdfa 100644
--- a/include/i18n/en_US/templates/email/message.autoresp.yaml
+++ b/include/i18n/en_US/templates/email/message.autoresp.yaml
@@ -9,16 +9,27 @@
 ---
 notes: |
     Sent to a user when the user posts a new message to a ticket. This can
-    happen if the users responds to an email from the system or visits the
+    happen if the user responds to an email from the system or visits the
     customer web portal and posts a new message there.
 
 subject: |
-    [#%{ticket.number}] Message Added
+    [#%{ticket.number}] Message Received
 body: |
-    %{ticket.name},
-
-    Your reply to support request #%{ticket.number} has been noted.
-
-    You can view this support request progress online here: %{ticket.client_link}.
-
-    %{signature}
+    <h3><strong>Dear %{ticket.name},</strong></h3>
+    <p>
+        Your reply to support request <a
+        href="%{ticket.client_link}">#%{ticket.number}</a> has been noted
+    </p>
+    <p>
+        %{signature}
+    </p>
+    <hr>
+    <p>
+        <span style="color: rgb(127, 127, 127); font-size: small">You can
+        view this support request's progress <a
+        href="%{ticket.client_link}">online here</a></span>
+    </p>
+    <p>
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"
+        alt="Powered by osTicket" width="126" height="19" style="width: 126px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/note.alert.yaml b/include/i18n/en_US/templates/email/note.alert.yaml
index 0a77d56229d5765d9c202c1954821fcee752829f..00e10b0c5619d4fc4f94908bf3d93470d08c08c4 100644
--- a/include/i18n/en_US/templates/email/note.alert.yaml
+++ b/include/i18n/en_US/templates/email/note.alert.yaml
@@ -13,19 +13,43 @@ notes: |
 subject: |
     New Internal Note Alert
 body: |
-    %{recipient},
-
-    Internal note appended to ticket #%{ticket.number}
-
-    ----------------------
-    * %{note.title} *
-
-    %{note.message}
-    ----------------------
-
-    To view/respond to the ticket, please login to the support ticket
-    system.
-
-    %{ticket.staff_link}
-
-    - Your friendly Customer Support System - powered by osTicket.
+    <h3><strong>Hi %{recipient},</strong></h3>
+    <p>
+        An internal note has been appended to ticket <a
+        href="%{ticket.staff_link}">#%{ticket.number}</a>
+    </p>
+    <table>
+    <tbody>
+    <tr>
+        <td>
+            <strong>From</strong>:
+        </td>
+        <td>
+            %{note.poster}
+        </td>
+    </tr>
+    <tr>
+        <td>
+            <strong>Title</strong>:
+        </td>
+        <td>
+            %{note.title}
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p>
+        %{note.message}
+    </p>
+    <hr>
+    <p>
+        To view/respond to the ticket, please <a
+        href="%{ticket.staff_link}">login</a> to the support ticket system
+    </p>
+    <p>
+        <em>Your friendly Customer Support System</em>
+    </p>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"
+        alt="Powered by osTicket" width="126" height="19" style="width: 126px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/staff.pwreset.yaml b/include/i18n/en_US/templates/email/staff.pwreset.yaml
index 39b96083ab59b1134b16e823c43e41e02beb9c06..343142aee0440367645adde698567047f45eb32a 100644
--- a/include/i18n/en_US/templates/email/staff.pwreset.yaml
+++ b/include/i18n/en_US/templates/email/staff.pwreset.yaml
@@ -12,14 +12,25 @@ notes: |
 subject: |
     osTicket Staff Password Reset
 body: |
-    You or perhaps somebody you know has submitted a password reset request on
-    your behalf for the helpdesk at %{url}.
-
-    If you feel that this has been done in error. Delete and disregard this
-    email.  Your account is still secure and no one has been given access to it.
-    It is not locked and your password has not been reset. Someone could have
-    mistakenly entered your email address.
-
-    Follow the link below to login to the help desk and change your password.
-
-    %{reset_link}
+    <h3><strong>Hi %{staff.name},</strong></h3>
+    <p>
+        You or perhaps somebody you know has submitted a password reset
+        request on your behalf for the helpdesk at %{url}.
+    </p>
+    <p>
+        If you feel that this has been done in error. Delete and disregard
+        this email. Your account is still secure and no one has been given
+        access to it. It is not locked and your password has not been
+        reset. Someone could have mistakenly entered your email address.
+    </p>
+    <p>
+        Follow the link below to login to the help desk and change your
+        password.
+    </p>
+    <p>
+        %{reset_link}
+    </p>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" alt="Powered by osTicket"
+        width="126" height="19" style="width: 126px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.alert.yaml b/include/i18n/en_US/templates/email/ticket.alert.yaml
index 167b77f315dcc46ecd3c73e3aa7a8368425fa62f..70283804456896704e14a39d552ecf8a938f7466 100644
--- a/include/i18n/en_US/templates/email/ticket.alert.yaml
+++ b/include/i18n/en_US/templates/email/ticket.alert.yaml
@@ -13,20 +13,41 @@ notes: |
 subject: |
     New Ticket Alert
 body: |
-    %{recipient},
-
-    New ticket #%{ticket.number} created.
-
-    -----------------------
-    Name: %{ticket.name}
-    Email: %{ticket.email}
-    Dept: %{ticket.dept.name}
-
-    %{message}
-
-    -----------------------
-    To view/respond to the ticket, please login to the support ticket system.
-
-    %{ticket.staff_link}
-
-    - Your friendly Customer Support System - powered by osTicket.
+    <h2>Hi %{recipient},</h2>
+    <p>
+        New ticket #%{ticket.number} created
+    </p>
+    <table>
+    <tbody>
+    <tr>
+        <td>
+            <strong>From</strong>:
+        </td>
+        <td>
+            %{ticket.name} &lt;%{ticket.email}&gt;
+        </td>
+    </tr>
+    <tr>
+        <td>
+            <strong>Department</strong>:
+        </td>
+        <td>
+            %{ticket.dept.name}
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p>
+        %{message}
+    </p>
+    <hr>
+    <p>
+        To view/respond to the ticket, please <a href="%{ticket.staff_link}">login</a>
+        to the support ticket system
+    </p>
+    <p>
+        <em>Your friendly Customer Support System
+        <br/>
+        <a href="http://osticket.com/"><img width="126" height="23"
+            alt="Powered By osTicket" src="cid:QURBOEMxRUY4QjcyRTFFMyIvPiA8L3Jk"/></a>
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.autoreply.yaml b/include/i18n/en_US/templates/email/ticket.autoreply.yaml
index 19328f50250e17d707fc519f7f6975a7b4988325..20a74ca7e1c3c5c5ced218ca83482cdc3d5ad468 100644
--- a/include/i18n/en_US/templates/email/ticket.autoreply.yaml
+++ b/include/i18n/en_US/templates/email/ticket.autoreply.yaml
@@ -15,16 +15,75 @@ notes: |
 subject: |
     Support Ticket Opened [#%{ticket.number}]
 body: |
-    %{ticket.name},
-
-    A request for support has been created and assigned ticket
-    #%{ticket.number} with the following auto-reply:
-
-    %{response}
-
-
-    We hope this response has sufficiently answered your questions. If not,
-    please do not open another ticket. If need be, representative will
-    follow-up with you as soon as possible.
-
-    You can view this ticket's progress online here: %{ticket.client_link}.
+    <table cellspacing="0">
+    <tbody>
+    <tr>
+        <td style="vertical-align: middle; border-bottom: 1px solid #ddd;
+            height: 48pt"> <span style="color: rgb(127, 127, 127); font-family:
+            Georgia; font-size: 28pt; font-weight: normal;">We Hear You</span>
+        </td>
+        <td style="border-bottom: 1px solid #ddd;">
+             <img src="cid:6fe1efdea357534d238b86e7860a7c5a" width="94"
+             alt="osTicket Logo (kangaroo)" style="width: 94px; float:
+             right; vertical-align: bottom;" height="53">
+        </td>
+    </tr>
+    <tr>
+        <td style="width:67%; padding-top: 12pt; padding-right: 12pt">
+            <p>
+                Dear %{ticket.name},
+            </p>
+            <p>
+                A request for support has been created and assigned ticket
+                <a href="%{ticket.client_link}">#%{ticket.number}</a> with
+                the following automatic reply
+            </p>
+            <p>
+                Topic: <strong>%{ticket.topic.name}</strong>
+            </p>
+            <p>
+                Subject: <strong>%{ticket.subject}</strong>
+            </p>
+            <p>
+                Submitted: <strong>%{ticket.create_date}</strong>
+            </p>
+            <p>
+                %{response}
+            </p>
+            <p>
+                If need be, a representative will follow-up with you as soon
+                as possible. You can <a href="%{ticket.client_link}">view
+                this ticket's progress online</a>.
+            </p>
+            <p>
+                Your Company Name Team,<br>
+                %{signature}
+            </p>
+        </td>
+        <td style="vertical-align: top; padding-top: 12pt;">
+            <p>
+                 <span style="color: rgb(127, 127, 127);">Company Name<br>
+                 %{signature}</span>
+            </p>
+            <p>
+                 <span style="color: rgb(127, 127, 127);">We hope this
+                 response has sufficiently answered your questions. If not,
+                 please do not send another email. Instead, reply to this
+                 email or <a href="%{ticket.client_link}"><span
+                 style="color: rgb(84, 141, 212);">login to your
+                 account</span></a> for a complete archive of all your
+                 support requests and responses.</span>
+            </p>
+            <p>
+                 <span style="color: rgb(127, 127, 127);">Visit our</span>
+                 <a href="%{url}/kb"><span style="color: rgb(84, 141,
+                 212);">knowledgebase</span></a>
+            </p>
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" width="126"
+        alt="Powered by osTicket" height="19" style="width: 126px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.autoresp.yaml b/include/i18n/en_US/templates/email/ticket.autoresp.yaml
index b958b3bd3a6a356bc48bdc54602e7e0ac0513838..48d1c22941b94564c7a5847b3e45280290d3849d 100644
--- a/include/i18n/en_US/templates/email/ticket.autoresp.yaml
+++ b/include/i18n/en_US/templates/email/ticket.autoresp.yaml
@@ -10,16 +10,69 @@ notes: |
 subject: |
     Support Ticket Opened [#%{ticket.number}]
 body: |
-    %{ticket.name},
-
-    A request for support has been created and assigned ticket
-    #%{ticket.number}. A representative will follow-up with you as soon as
-    possible.
-
-    You can view this ticket's progress online here: %{ticket.client_link}.
-
-    If you wish to send additional comments or information regarding this
-    issue, please don't open a new ticket.  Simply login using the link
-    above and update the ticket.
-
-    %{signature}
+    <table cellspacing="0">
+    <tbody>
+    <tr>
+        <td style="vertical-align: middle; border-bottom: 1px solid #ddd; height: 48pt">
+            <span style="color: rgb(127, 127, 127); font-family: Georgia;
+            font-size: 28pt; font-weight: normal; ">We Hear You</span>
+        </td>
+        <td style="border-bottom: 1px solid #ddd;">
+            <img src="cid:6fe1efdea357534d238b86e7860a7c5a" width="94"
+            alt="osTicket Logo (kangaroo)" style="width: 94px; float: right;
+            vertical-align: bottom; " height="53">
+        </td>
+    </tr>
+    <tr>
+        <td style="width:67%; padding-top: 12pt; padding-right: 12pt">
+        <p>
+            Dear %{ticket.name},
+        </p>
+        <p>
+            We received your request and assigned ticket #%{ticket.number}
+        </p>
+        <p>
+            Topic: <strong>%{ticket.topic.name}</strong>
+        </p>
+        <p>
+            Subject: <strong>%{ticket.subject}</strong>
+        </p>
+        <p>
+            Submitted: <strong>%{ticket.create_date}</strong>
+        </p>
+        <p>
+            A representative will follow-up with you as soon as possible. You
+            can <a href="%{ticket.client_link}">view this ticket's progress
+            online</a>.
+        </p>
+        <p>
+            Your Company Name Team,<br>
+            %{signature}
+        </p>
+        </td>
+        <td style="vertical-align: top; padding-top: 12pt;">
+        <p>
+            <span style="color: rgb(127, 127, 127); ">Company Name<br/>
+            %{signature}</span>
+        </p>
+        <p>
+            <span style="color: rgb(127, 127, 127); ">
+            If you wish to send additional comments or information regarding
+            this issue, please don't open a new ticket. Simply</span> <a
+            href="%{ticket.client_link}"><span style="color: rgb(84, 141, 212); "
+            >login</span></a> <span
+            style="color: rgb(127, 127, 127); ">and update the ticket.</span>
+        </p>
+        <p>
+            <span style="color: rgb(127, 127, 127); ">Visit our</span> <a
+            href="%{url}/kb"><span style="color: rgb(84, 141, 212);
+            ">knowledgebase</span></a>
+        </p>
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" width="126"
+        height="19" style="width: 126px; " alt="Powered by osTicket">
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.notice.yaml b/include/i18n/en_US/templates/email/ticket.notice.yaml
index c843efb438eec0934776acc9dfcb8aa7fd63fbae..b1a8a788db78ea896fe08a286e873c856074129b 100644
--- a/include/i18n/en_US/templates/email/ticket.notice.yaml
+++ b/include/i18n/en_US/templates/email/ticket.notice.yaml
@@ -11,17 +11,78 @@ notes: |
     This is most commonly performed when user's call in on the phone.
 
 subject: |
-    [#%{ticket.number}] %{ticket.subject}
+    %{ticket.subject}
 body: |
-    %{ticket.name},
-
-    Our customer care team has created a ticket, #%{ticket.number} on your
-    behalf, with the following message.
-
-    %{message}
-
-    If you wish to provide additional comments or information regarding this
-    issue, please don't open a new ticket. You can update or view this
-    ticket's progress online here: %{ticket.client_link}.
-
-    %{signature}
+    <table cellspacing="0">
+    <tbody>
+    <tr>
+        <td style="vertical-align: middle; border-bottom: 1px solid #ddd;
+        height: 48pt">
+            <span style="color: rgb(127, 127, 127); font-family: Georgia;
+            font-size: 28pt; font-weight: normal;">We Hear You</span>
+        </td>
+        <td style="border-bottom: 1px solid #ddd;">
+            <img src="cid:6fe1efdea357534d238b86e7860a7c5a" width="94"
+            alt="osTicket Logo (kangaroo)" style="width: 94px; float: right;
+            vertical-align: bottom;" height="53">
+        </td>
+    </tr>
+    <tr>
+        <td style="width:67%; padding-top: 12pt; padding-right: 12pt">
+            <p>
+                 Dear %{ticket.name},
+            </p>
+            <p>
+                 Our customer care team has created a ticket, <a
+                 href="%{ticket.client_link}">#%{ticket.number}</a> on your
+                 behalf, with the following details and summary.
+            </p>
+            <p>
+                 Topic: <strong>%{ticket.topic.name}</strong>
+            </p>
+            <p>
+                 Subject: <strong>%{ticket.subject}</strong>
+            </p>
+            <p>
+                 Submitted: <strong>%{ticket.create_date}</strong>
+            </p>
+            <p>
+                 %{message}
+            </p>
+            <p>
+                 If need be, representative will follow-up with you as soon
+                 as possible. You can <a href="%{ticket.client_link}">view
+                 this ticket's progress online</a>.
+            </p>
+            <p>
+                  Your Company Name Team,<br>
+                  %{signature}
+            </p>
+        </td>
+        <td style="vertical-align: top; padding-top: 12pt;">
+            <p>
+                <span style="color: rgb(127, 127, 127);">Company Name<br>
+                %{signature}</span>
+            </p>
+            <p>
+                <span style="color: rgb(127, 127, 127);">If you wish to
+                provide additional comments or information regarding the
+                issue, please do not send another email. Instead, reply to
+                this email or <a href="%{ticket.client_link}"><span
+                style="color: rgb(84, 141, 212);">login to your
+                account</span></a> for a complete archive of all your
+                support requests and responses.</span>
+            </p>
+            <p>
+                <span style="color: rgb(127, 127, 127);">Visit our</span> <a
+                href="%{url}/kb"><span style="color: rgb(84, 141,
+                212);">knowledgebase</span></a>
+            </p>
+        </td>
+    </tr>
+    </tbody>
+    </table>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" width="126" height="19"
+        style="width: 126px;" alt="Powered by osTicket">
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.overdue.yaml b/include/i18n/en_US/templates/email/ticket.overdue.yaml
index 874304904d99e76ec2d68a5ae5d3ea11106cc2e5..7a1b07a5e934b4170735b1e4a59ab37975c452b2 100644
--- a/include/i18n/en_US/templates/email/ticket.overdue.yaml
+++ b/include/i18n/en_US/templates/email/ticket.overdue.yaml
@@ -15,15 +15,33 @@ notes: |
 subject: |
     Stale Ticket Alert
 body: |
-    %{recipient},
-
-    A ticket, #%{ticket.number} assigned to you or in your department is
-    seriously overdue.
-
-    %{ticket.staff_link}
-
-    We should all work hard to guarantee that all tickets are being
-    addressed in a timely manner.
-
-    - Your friendly (although with limited patience) Support Ticket System -
-    powered by osTicket.
+    <h3><strong>Hi %{recipient}</strong>,</h3>
+    <p>
+        A ticket, <a href="%{ticket.staff_link}">#%{ticket.number}</a> is
+        seriously overdue.
+    </p>
+    <p>
+        We should all work hard to guarantee that all tickets are being
+        addressed in a timely manner.
+    </p>
+    <p>
+        Signed, %{ticket.dept.manager.name}
+    </p>
+    <p>
+        <em>Your friendly
+        <span style="font-size: small">(although with limited patience)</span><br>
+        </em><em>Support Ticket System</em>
+    </p>
+    <hr>
+    <p>
+        <span style="color: rgb(127, 127, 127); font-size: small;">To
+        view/respond to the ticket, please <a
+        href="%{ticket.staff_link}"><span style="color: rgb(84, 141, 212);"
+        >login</span></a> to the support ticket system. You're receiving
+        this notice because the ticket is assigned to you either directly or
+        to a team or department of which you're a member.</span>
+    </p>
+    <p>
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"
+        alt="Powered by osTicket" width="146" height="0" style="width: 146px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.overlimit.yaml b/include/i18n/en_US/templates/email/ticket.overlimit.yaml
index 51ca4e161a64f22bbc6c6e9f69561ca346084b47..07b19182e89303cc155b91ab43be557bef4b5c29 100644
--- a/include/i18n/en_US/templates/email/ticket.overlimit.yaml
+++ b/include/i18n/en_US/templates/email/ticket.overlimit.yaml
@@ -15,16 +15,27 @@ notes: |
 subject: |
      Open Tickets Limit Reached
 body: |
-    %{ticket.name},
-
-    You have reached the maximum number of open tickets allowed.
-
-    To be able to open another ticket, one of your pending tickets must be
-    closed. To update or add comments to an open ticket simply login using
-    the link below.
-
-    %{url}/tickets.php?e=%{ticket.email}
-
-    Thank you.
-
-    Support Ticket System
+    <p>
+        <span style="font-family: Georgia; color: rgb(127, 127, 127); font-size: 30pt;">
+        We Hear You</span>
+        <img src="cid:6fe1efdea357534d238b86e7860a7c5a" alt="osTicket Logo (kangaroo)"
+        width="99" height="56" style="float: right; width: 99px; margin: 0px 0px 10px 10px;">
+    </p>
+    <p>
+        <strong>Dear %{ticket.name},</strong>
+    </p>
+    <p>
+        You have reached the maximum number of open tickets allowed. To be
+        able to open another ticket, one of your pending tickets must be
+        closed. To update or add comments to an open ticket simply <a
+        href="%{url}/tickets.php?e=%{ticket.email}">login to our
+        helpdesk</a>.
+    </p>
+    <p>
+        Thank you<br/>
+        Support Ticket System
+    </p>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc"
+        alt="Powered by osTicket" width="126" height="19" style="width: 126px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/ticket.reply.yaml b/include/i18n/en_US/templates/email/ticket.reply.yaml
index 3a37ce49e0e09300c32cb20e36dccfb5285839e7..ad343e6882a79b033641759ada8700ca6da70970 100644
--- a/include/i18n/en_US/templates/email/ticket.reply.yaml
+++ b/include/i18n/en_US/templates/email/ticket.reply.yaml
@@ -11,20 +11,31 @@ notes: |
     Replies are only generated by staff members.
 
 subject: |
-    [#%{ticket.number}] %{ticket.subject}
+    Re\: %{ticket.subject}
 body: |
-    %{ticket.name},
-
-    A customer support staff member has replied to your support request,
-    #%{ticket.number} with the following response:
-
-    %{response}
-
-    We hope this response has sufficiently answered your questions. If not,
-    please do not send another email. Instead, reply to this email or login
-    to your account for a complete archive of all your support requests and
-    responses.
-
-    %{ticket.client_link}
-
-    %{signature}
+    <img src="cid:6fe1efdea357534d238b86e7860a7c5a" alt="osTicket Logo (kangaroo)"
+    width="113" height="64" style="float: right; width: 113px; margin: 0px 0px 10px 10px;">
+    <h3><span style="color: rgb(127, 127, 127); font-weight: normal;
+    font-family: Georgia; font-size: 30pt">Title text here</span></h3>
+    <p>
+        <strong>Dear %{ticket.name},</strong>
+    </p>
+    <p>
+        %{response}
+    </p>
+    <p>
+        %{signature}
+    </p>
+    <hr>
+    <p>
+        <span style="color: rgb(127, 127, 127); font-size: small;">
+        We hope this response has sufficiently answered your questions. If
+        not, please do not send another email. Instead, reply to this email
+        or <a href="%{ticket.client_link}" style="color: rgb(84, 141,
+        212);">login to your account</a> for a complete archive of all your
+        support requests and responses.</span>
+    </p>
+    <p style="text-align: center;">
+        <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" alt="Powered by osTicket"
+        width="133" height="20" style="width: 133px;">
+    </p>
diff --git a/include/i18n/en_US/templates/email/transfer.alert.yaml b/include/i18n/en_US/templates/email/transfer.alert.yaml
index 2f0a5a565ff2946c558617802f5194990fca3045..aa9b68d21b6e802ecb7dac3c65d08e74407ce29b 100644
--- a/include/i18n/en_US/templates/email/transfer.alert.yaml
+++ b/include/i18n/en_US/templates/email/transfer.alert.yaml
@@ -10,22 +10,25 @@
 notes: |
 
 subject: |
-    Ticket Transfer #%{ticket.number} - %{ticket.dept.name}
+    Ticket #%{ticket.number} transfer - %{ticket.dept.name}
 body: |
-    %{recipient},
-
-    Ticket #%{ticket.number} has been transferred to the %{ticket.dept.name}
-    department by %{staff.name}
-
-    ----------------------
-
-    %{comments}
-
-    ----------------------
-
-    To view/respond to the ticket, please login to the support ticket
-    system.
-
-    %{ticket.staff_link}
-
-    - Your friendly Customer Support System - powered by osTicket.
+    <h3>Hi %{recipient},</h3>
+    <p>
+        Ticket <a href="%{ticket.staff_link}">#%{ticket.number}</a> has
+        been transferred to the %{ticket.dept.name} department by
+        <strong>%{staff.name}</strong>
+    </p>
+    <blockquote>
+        %{comments}
+    </blockquote>
+    <hr>
+    <p style="font-size:small">
+        To view/respond to the ticket, please <a
+        href="%{ticket.staff_link}">login</a> to the support ticket system.
+    </p>
+    <p>
+        <em>Your friendly Customer Support System
+        <br/>
+        <a href="http://osticket.com/"><img width="126" height="23"
+            alt="Powered By osTicket" src="cid:QURBOEMxRUY4QjcyRTFFMyIvPiA8L3Jk"/></a>
+    </p>
diff --git a/include/staff/apikey.inc.php b/include/staff/apikey.inc.php
index 507753aae6c3852d3c93a638901470b83cd8c295..b559678c222787695b5f62287863d7fc5d1c8892 100644
--- a/include/staff/apikey.inc.php
+++ b/include/staff/apikey.inc.php
@@ -97,7 +97,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/banrule.inc.php b/include/staff/banrule.inc.php
index 1f1314736f6943a6563f6ac1b9761fa2fbd98fea..98771d7372517ef6f5385720ddfd7426e6179428 100644
--- a/include/staff/banrule.inc.php
+++ b/include/staff/banrule.inc.php
@@ -67,7 +67,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/cannedresponse.inc.php b/include/staff/cannedresponse.inc.php
index cc495d534c919e4954e35a4e3db325746f7d2b4e..f540c3f7dfb1fd1d6d800328a60ea28dcf160ca7 100644
--- a/include/staff/cannedresponse.inc.php
+++ b/include/staff/cannedresponse.inc.php
@@ -9,6 +9,8 @@ if($canned && $_REQUEST['a']!='add'){
     $info=$canned->getInfo();
     $info['id']=$canned->getId();
     $qstr.='&id='.$canned->getId();
+    // Replace cid: scheme with downloadable URL for inline images
+    $info['response'] = $canned->getResponseWithImages();
 }else {
     $title='Add New Canned Response';
     $action='create';
@@ -70,12 +72,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
             <td colspan=2>
                 <div><b>Title</b><span class="error">*&nbsp;<?php echo $errors['title']; ?></span></div>
                 <input type="text" size="70" name="title" value="<?php echo $info['title']; ?>">
-                <br><br><div><b>Canned Response</b> <font class="error">*&nbsp;<?php echo $errors['response']; ?></font>
-                    &nbsp;&nbsp;&nbsp;(<a class="tip" href="ticket_variables">Supported Variables</a>)</div>
-                <textarea name="response" cols="21" rows="12" style="width: 80%;"><?php echo $info['response']; ?></textarea>
+                <br><br><div style="margin-bottom:0.5em"><b>Canned Response</b> <font class="error">*&nbsp;<?php echo $errors['response']; ?></font>
+                    &nbsp;&nbsp;&nbsp;(<a class="tip" href="ticket_variables">Supported Variables</a>)
+                    </div>
+                <textarea name="response ifhtml draft draft-delete" cols="21" rows="12"
+                    data-draft-namespace="canned"
+                    data-draft-object-id="<?php if (isset($canned)) echo $canned->getId(); ?>"
+                    style="width:98%;" class="richtext draft"><?php
+                        echo $info['response']; ?></textarea>
                 <br><br><div><b>Canned Attachments</b> (optional) <font class="error">&nbsp;<?php echo $errors['files']; ?></font></div>
                 <?php
-                if($canned && ($files=$canned->getAttachments())) {
+                if($canned && ($files=$canned->attachments->getSeparates())) {
                     echo '<div id="canned_attachments"><span class="faded">Uncheck to delete the attachment on submit</span><br>';
                     foreach($files as $file) {
                         $hash=$file['hash'].md5($file['id'].session_id().$file['hash']);
@@ -84,7 +91,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
                                       $file['id'], $file['id'], $hash, $file['name']);
                     }
                     echo '</div><br>';
-            
+
                 }
                 //Hardcoded limit... TODO: add a setting on admin panel - what happens on tickets page??
                 if(count($files)<10) {
@@ -92,7 +99,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
                 <div>
                     <input type="file" name="attachments[]" value=""/>
                 </div>
-                <?php 
+                <?php
                 }?>
                 <div class="faded">You can upload up to 10 attachments per canned response.</div>
             </td>
@@ -104,7 +111,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
@@ -116,7 +124,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
  <?php } ?>
 <p style="padding-left:225px;">
     <input type="submit" name="submit" value="<?php echo $submit_text; ?>">
-    <input type="reset"  name="reset"  value="Reset">
+    <input type="reset"  name="reset"  value="Reset" onclick="javascript:
+        $(this.form).find('textarea.richtext')
+            .redactor('deleteDraft');
+        location.reload();" />
     <input type="button" name="cancel" value="Cancel" onclick='window.location.href="canned.php"'>
 </p>
 </form>
diff --git a/include/staff/cannedresponses.inc.php b/include/staff/cannedresponses.inc.php
index ef58ffda4dbe51a7c206dcbf0c0c6392430fd3f0..ffa2bb87d01b9e4e1173e67b164528c9b4db6a66 100644
--- a/include/staff/cannedresponses.inc.php
+++ b/include/staff/cannedresponses.inc.php
@@ -5,7 +5,8 @@ $qstr='';
 $sql='SELECT canned.*, count(attach.file_id) as files, dept.dept_name as department '.
      ' FROM '.CANNED_TABLE.' canned '.
      ' LEFT JOIN '.DEPT_TABLE.' dept ON (dept.dept_id=canned.dept_id) '.
-     ' LEFT JOIN '.CANNED_ATTACHMENT_TABLE.' attach ON (attach.canned_id=canned.canned_id) ';
+     ' LEFT JOIN '.ATTACHMENT_TABLE.' attach
+            ON (attach.object_id=canned.canned_id AND attach.`type`=\'C\' AND NOT attach.inline)';
 $sql.=' WHERE 1';
 
 $sortOptions=array('title'=>'canned.title','status'=>'canned.isenabled','dept'=>'department','updated'=>'canned.updated');
diff --git a/include/staff/department.inc.php b/include/staff/department.inc.php
index b43806b0b99bd65ec8be77b68b2db7e803ab410b..1031b3d97050223abc5b7f07e75b24c834d8c96b 100644
--- a/include/staff/department.inc.php
+++ b/include/staff/department.inc.php
@@ -235,7 +235,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="signature" cols="21" rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
+                <textarea class="richtext no-bar" name="signature" cols="21"
+                    rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
                 <br><em>Signature is made available as a choice, for public departments, on ticket reply.</em>
             </td>
         </tr>
diff --git a/include/staff/email.inc.php b/include/staff/email.inc.php
index 58ecb35a8cd6b1cad83377fdfbf68a6f8541fbc9..8c0c45d92c51b07bbe9b6ab5160ee35932342ac8 100644
--- a/include/staff/email.inc.php
+++ b/include/staff/email.inc.php
@@ -251,7 +251,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="5" style="width: 60%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="5" style="width: 60%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/faq-categories.inc.php b/include/staff/faq-categories.inc.php
index 8422d1a437e8a6e0193fbaf1d5dd0ae0f1baa80d..da41c80f2a3bf08f51add08bbc67d84b7deeaf1b 100644
--- a/include/staff/faq-categories.inc.php
+++ b/include/staff/faq-categories.inc.php
@@ -57,7 +57,8 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
     $sql='SELECT faq.faq_id, question, ispublished, count(attach.file_id) as attachments, count(ft.topic_id) as topics '
         .' FROM '.FAQ_TABLE.' faq '
         .' LEFT JOIN '.FAQ_TOPIC_TABLE.' ft ON(ft.faq_id=faq.faq_id) '
-        .' LEFT JOIN '.FAQ_ATTACHMENT_TABLE.' attach ON(attach.faq_id=faq.faq_id) '
+        .' LEFT JOIN '.ATTACHMENT_TABLE.' attach
+             ON(attach.object_id=faq.faq_id AND attach.type=\'F\' AND attach.inline = 0) '
         .' WHERE 1 ';
 
     if($_REQUEST['cid'])
@@ -67,8 +68,8 @@ if($_REQUEST['q'] || $_REQUEST['cid'] || $_REQUEST['topicId']) { //Search.
         $sql.=' AND ft.topic_id='.db_input($_REQUEST['topicId']);
 
     if($_REQUEST['q']) {
-        $sql.=" AND question LIKE ('%".db_input($_REQUEST['q'],false)."%') 
-                 OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%') 
+        $sql.=" AND question LIKE ('%".db_input($_REQUEST['q'],false)."%')
+                 OR answer LIKE ('%".db_input($_REQUEST['q'],false)."%')
                  OR keywords LIKE ('%".db_input($_REQUEST['q'],false)."%') ";
     }
 
diff --git a/include/staff/faq-category.inc.php b/include/staff/faq-category.inc.php
index f12ed8ae8f3d4c90b0245235525ce4160b6cd836..8bf9e7a9db544667312bec87b02ad86e4cc2f0e5 100644
--- a/include/staff/faq-category.inc.php
+++ b/include/staff/faq-category.inc.php
@@ -31,7 +31,8 @@ if($thisstaff->canManageFAQ()) {
 
 $sql='SELECT faq.faq_id, question, ispublished, count(attach.file_id) as attachments '
     .' FROM '.FAQ_TABLE.' faq '
-    .' LEFT JOIN '.FAQ_ATTACHMENT_TABLE.' attach ON(attach.faq_id=faq.faq_id) '
+    .' LEFT JOIN '.ATTACHMENT_TABLE.' attach
+         ON(attach.object_id=faq.faq_id AND attach.type=\'F\' AND attach.inline = 0) '
     .' WHERE faq.category_id='.db_input($category->getId())
     .' GROUP BY faq.faq_id';
 if(($res=db_query($sql)) && db_num_rows($res)) {
diff --git a/include/staff/faq-view.inc.php b/include/staff/faq-view.inc.php
index 0882197ecac5e223803a0284d08a6c9d5ab0bd55..514eca3f074a6215db50f8cda4fe786a8a836e82 100644
--- a/include/staff/faq-view.inc.php
+++ b/include/staff/faq-view.inc.php
@@ -6,7 +6,7 @@ $category=$faq->getCategory();
 ?>
 <h2>Frequently Asked Questions</h2>
 <div id="breadcrumbs">
-    <a href="kb.php">All Categories</a> 
+    <a href="kb.php">All Categories</a>
     &raquo; <a href="kb.php?cid=<?php echo $category->getId(); ?>"><?php echo $category->getName(); ?></a>
     <span class="faded">(<?php echo $category->isPublic()?'Public':'Internal'; ?>)</span>
 </div>
@@ -23,12 +23,13 @@ if($thisstaff->canManageFAQ()) {
 &nbsp;
 </div>
 <div class="clear"></div>
-<p>
-<?php echo Format::safe_html($faq->getAnswer()); ?>
-</p>
+<div class="thread-body">
+<?php echo $faq->getAnswer(); ?>
+</div>
+<div class="clear"></div>
 <p>
  <div><span class="faded"><b>Attachments:</b></span> <?php echo $faq->getAttachmentsLinks(); ?></div>
- <div><span class="faded"><b>Help Topics:</b></span> 
+ <div><span class="faded"><b>Help Topics:</b></span>
     <?php echo ($topics=$faq->getHelpTopics())?implode(', ',$topics):' '; ?>
     </div>
 </p>
@@ -63,5 +64,5 @@ if($thisstaff->canManageFAQ()) {
     </form>
    </div>
 <?php
-} 
+}
 ?>
diff --git a/include/staff/faq.inc.php b/include/staff/faq.inc.php
index 99f4017616245395d905514d3ed2e56b59e6d7a3..b24ca665a255413d59264a12f94b1379e3395dee 100644
--- a/include/staff/faq.inc.php
+++ b/include/staff/faq.inc.php
@@ -9,6 +9,7 @@ if($faq){
     $info=$faq->getHashtable();
     $info['id']=$faq->getId();
     $info['topics']=$faq->getHelpTopicsIds();
+    $info['answer']=$faq->getAnswer();
     $qstr='id='.$faq->getId();
 }else {
     $title='Add New FAQ';
@@ -81,16 +82,21 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <div>
-                    <b>Answer</b>&nbsp;<font class="error">*&nbsp;<?php echo $errors['answer']; ?></font></div>
-                    <textarea name="answer" cols="21" rows="12" style="width:98%;" class="richtext"><?php echo $info['answer']; ?></textarea>
+                <div style="margin-bottom:0.5em;margin-top:0.5em">
+                    <b>Answer</b>&nbsp;<font class="error">*&nbsp;<?php echo $errors['answer']; ?></font>
+                </div>
+                <textarea name="answer" cols="21" rows="12"
+                    style="width:98%;" class="richtext draft"
+                    data-draft-namespace="faq"
+                    data-draft-object-id="<?php if (isset($faq)) echo $faq->getId(); ?>"
+                    ><?php echo $info['answer']; ?></textarea>
             </td>
         </tr>
         <tr>
             <td colspan=2>
                 <div><b>Attachments</b> (optional) <font class="error">&nbsp;<?php echo $errors['files']; ?></font></div>
                 <?php
-                if($faq && ($files=$faq->getAttachments())) {
+                if($faq && ($files=$faq->attachments->getSeparates())) {
                     echo '<div class="faq_attachments"><span class="faded">Uncheck to delete the attachment on submit</span><br>';
                     foreach($files as $file) {
                         $hash=$file['hash'].md5($file['id'].session_id().$file['hash']);
@@ -145,7 +151,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
 </table>
 <p style="padding-left:225px;">
     <input type="submit" name="submit" value="<?php echo $submit_text; ?>">
-    <input type="reset"  name="reset"  value="Reset">
+    <input type="reset"  name="reset"  value="Reset" onclick="javascript:
+        $(this.form).find('textarea.richtext')
+            .redactor('deleteDraft');
+        location.reload();" />
     <input type="button" name="cancel" value="Cancel" onclick='window.location.href="faq.php?<?php echo $qstr; ?>"'>
 </p>
 </form>
diff --git a/include/staff/filter.inc.php b/include/staff/filter.inc.php
index d82c1ca85d2e2fd0998be5154a9de778dc996eeb..b029fbb682a8ebfdebf386027d561c772aba2382 100644
--- a/include/staff/filter.inc.php
+++ b/include/staff/filter.inc.php
@@ -323,7 +323,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/group.inc.php b/include/staff/group.inc.php
index bfcc2a596a54850211a71ff72ea95cb698ecdb57..5b590866c6a901f45c5450a78df9d0ae02164d51 100644
--- a/include/staff/group.inc.php
+++ b/include/staff/group.inc.php
@@ -169,7 +169,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/header.inc.php b/include/staff/header.inc.php
index a3bc2f0a7cf4e660297545a09f37ca2df5e24821..e5b04bff53e4fec7dd0880423aee27b43704e41f 100644
--- a/include/staff/header.inc.php
+++ b/include/staff/header.inc.php
@@ -10,16 +10,20 @@
         .tip_shadow { display:block !important; }
     </style>
     <![endif]-->
-    <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
-    <script type="text/javascript" src="../js/jquery-ui-1.8.18.custom.min.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/jquery-1.8.3.min.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/jquery-ui-1.10.3.custom.min.js"></script>
     <script type="text/javascript" src="../js/jquery.multifile.js"></script>
     <script type="text/javascript" src="./js/tips.js"></script>
-    <script type="text/javascript" src="./js/nicEdit.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/redactor.min.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/redactor-osticket.js"></script>
+    <script type="text/javascript" src="<?php echo ROOT_PATH; ?>js/redactor-fonts.js"></script>
     <script type="text/javascript" src="./js/bootstrap-typeahead.js"></script>
     <script type="text/javascript" src="./js/scp.js"></script>
+    <link rel="stylesheet" href="<?php echo ROOT_PATH ?>css/thread.css" media="screen">
     <link rel="stylesheet" href="./css/scp.css" media="screen">
+    <link rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/redactor.css" media="screen">
     <link rel="stylesheet" href="./css/typeahead.css" media="screen">
-    <link type="text/css" href="../css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
+    <link type="text/css" href="<?php echo ROOT_PATH; ?>css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
     <link type="text/css" rel="stylesheet" href="../css/font-awesome.min.css">
     <link type="text/css" rel="stylesheet" href="./css/dropdown.css">
     <script type="text/javascript" src="./js/jquery.dropdown.js"></script>
diff --git a/include/staff/helptopic.inc.php b/include/staff/helptopic.inc.php
index 5dafc452d1d05ac9531383ecc7e7a43d6939d65d..fdf82a404c187cf9d8f0ba6421b635f70a7e3f4a 100644
--- a/include/staff/helptopic.inc.php
+++ b/include/staff/helptopic.inc.php
@@ -225,7 +225,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/page.inc.php b/include/staff/page.inc.php
index ea9d2c639f848c0e83fa161782c48a4f5928b96c..067c1fd518c8133ffedbade39ac665992fc43205 100644
--- a/include/staff/page.inc.php
+++ b/include/staff/page.inc.php
@@ -13,6 +13,7 @@ if($page && $_REQUEST['a']!='add'){
     $action='update';
     $submit_text='Save Changes';
     $info=$page->getHashtable();
+    $info['body'] = $page->getBodyWithImages();
     $slug = Format::slugify($info['name']);
     $qstr.='&id='.$page->getId();
 }else {
@@ -93,7 +94,9 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
          <tr>
             <td colspan=2 style="padding-left:3px;">
-                <textarea name="body" cols="21" rows="12" style="width:98%;" class="richtext"><?php echo $info['body']; ?></textarea>
+                <textarea name="body" cols="21" rows="12" style="width:98%;" class="richtext draft"
+                    data-draft-namespace="page" data-draft-object-id="<?php echo $info['id']; ?>"
+                    ><?php echo $info['body']; ?></textarea>
             </td>
         </tr>
         <tr>
@@ -103,7 +106,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/profile.inc.php b/include/staff/profile.inc.php
index 2543c80d1cfa68444199a894f117c1521774afb4..8ceaca328452056ad3829a00ae69f64c85dae52e 100644
--- a/include/staff/profile.inc.php
+++ b/include/staff/profile.inc.php
@@ -2,6 +2,7 @@
 if(!defined('OSTSTAFFINC') || !$staff || !$thisstaff) die('Access Denied');
 
 $info=$staff->getInfo();
+$info['signature'] = Format::viewableImages($info['signature']);
 $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
 $info['id']=$staff->getId();
 ?>
@@ -227,7 +228,8 @@ $info['id']=$staff->getId();
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="signature" cols="21" rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
+                <textarea class="richtext no-bar" name="signature" cols="21"
+                    rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
                 <br><em>Signature is made available as a choice, on ticket reply.</em>
             </td>
         </tr>
diff --git a/include/staff/settings-tickets.inc.php b/include/staff/settings-tickets.inc.php
index 0c29ca73a1c6bbc4d478e3e71433031ed2754c22..d360b4d29bf1c9364ade32ce3f5955f043e15f26 100644
--- a/include/staff/settings-tickets.inc.php
+++ b/include/staff/settings-tickets.inc.php
@@ -152,6 +152,14 @@ if(!($maxfileuploads=ini_get('max_file_uploads')))
                 Hide staff's name on responses.
             </td>
         </tr>
+        <tr>
+            <td>Enable HTML Ticket Thread:</td>
+            <td>
+                <input type="checkbox" name="enable_html_thread" <?php
+                echo $config['enable_html_thread']?'checked="checked"':''; ?>>
+                Enable rich text in ticket thread and autoresponse emails
+            </td>
+        </tr>
         <tr>
             <th colspan="2">
                 <em><b>Attachments</b>:  Size and max. uploads setting mainly apply to web tickets.</em>
diff --git a/include/staff/slaplan.inc.php b/include/staff/slaplan.inc.php
index 94f1fb1c61a9bf805758339f36d5885f003fa1ee..0f0e7b5425cfa3b9712095d51eedffc579e9e159 100644
--- a/include/staff/slaplan.inc.php
+++ b/include/staff/slaplan.inc.php
@@ -101,7 +101,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/staff.inc.php b/include/staff/staff.inc.php
index 5e13d943c576b53286297ca0c36865ffefceb14f..4567624842d7aaee268dfe7e034e4173b82c2afd 100644
--- a/include/staff/staff.inc.php
+++ b/include/staff/staff.inc.php
@@ -140,7 +140,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="signature" cols="21" rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
+                <textarea class="richtext no-bar" name="signature" cols="21"
+                    rows="5" style="width: 60%;"><?php echo $info['signature']; ?></textarea>
                 <br><em>Signature is made available as a choice, on ticket reply.</em>
             </td>
         </tr>
@@ -288,7 +289,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="28" rows="7" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="28"
+                    rows="7" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/team.inc.php b/include/staff/team.inc.php
index 4ca688ac5ae3702b80f2478e67c407330b809bf7..6c36c1ac202fdcb542976c30098f41667634c501 100644
--- a/include/staff/team.inc.php
+++ b/include/staff/team.inc.php
@@ -108,7 +108,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/template.inc.php b/include/staff/template.inc.php
index e4c52705acc893f63c623695517ee9077932bc4d..8fee6a2ce6a8bae63c9273b99eafa178c48d0214 100644
--- a/include/staff/template.inc.php
+++ b/include/staff/template.inc.php
@@ -129,7 +129,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="notes" cols="21" rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
+                <textarea class="richtext no-bar" name="notes" cols="21"
+                    rows="8" style="width: 80%;"><?php echo $info['notes']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/ticket-edit.inc.php b/include/staff/ticket-edit.inc.php
index 93fc68bad4f957eb3044b503eb5dc0c6df8ae4d9..4a641d782b41005e0e17b4197b1bff668523d8d7 100644
--- a/include/staff/ticket-edit.inc.php
+++ b/include/staff/ticket-edit.inc.php
@@ -159,8 +159,10 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$ticket->getUpdateInfo());
             </th>
         </tr>
         <tr>
-            <td colspan=2>
-                <textarea name="note" cols="21" rows="6" style="width:80%;"><?php echo $info['note']; ?></textarea>
+            <td colspan="2">
+                <textarea class="richtext no-bar" name="note" cols="21"
+                    rows="6" style="width:80%;"><?php echo $info['note'];
+                    ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php
index ed29b87391f632efbdddc886db8809edfefb51ee..cf9c49dfbec5be1211cb9b74696ba9595e223b79 100644
--- a/include/staff/ticket-open.inc.php
+++ b/include/staff/ticket-open.inc.php
@@ -215,8 +215,15 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
                     <em><strong>Subject</strong>: Issue summary </em> &nbsp;<font class="error">*&nbsp;<?php echo $errors['subject']; ?></font><br>
                     <input type="text" name="subject" size="60" value="<?php echo $info['subject']; ?>">
                 </div>
-                <div><em><strong>Issue</strong>: Details on the reason(s) for opening the ticket.</em> <font class="error">*&nbsp;<?php echo $errors['issue']; ?></font></div>
-                <textarea name="issue" cols="21" rows="8" style="width:80%;"><?php echo $info['issue']; ?></textarea>
+                <div style="margin-top:0.5em; margin-bottom:0.5em">
+                    <em><strong>Issue</strong></em>
+                    <font class="error">*&nbsp;<?php echo $errors['issue']; ?></font>
+                </div>
+                <textarea class="richtext ifhtml draft draft-delete"
+                    placeholder="Details on the reason(s) for opening the ticket."
+                    data-draft-namespace="ticket.staff" name="issue"
+                    cols="21" rows="8" style="width:80%;"
+                    ><?php echo $info['issue']; ?></textarea>
             </td>
         </tr>
         <?php
@@ -233,7 +240,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
             <?php
             if(($cannedResponses=Canned::getCannedResponses())) {
                 ?>
-                <div>
+                <div style="margin-top:0.3em;margin-bottom:0.5em">
                     Canned Response:&nbsp;
                     <select id="cannedResp" name="cannedResp">
                         <option value="0" selected="selected">&mdash; Select a canned response &mdash;</option>
@@ -248,7 +255,11 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
                 </div>
             <?php
             } ?>
-                <textarea name="response" id="response" cols="21" rows="8" style="width:80%;"><?php echo $info['response']; ?></textarea>
+                <textarea class="richtext ifhtml draft draft-delete"
+                    data-draft-namespace="ticket.staff.response"
+                    placeholder="Intial response for the ticket"
+                    name="response" id="response" cols="21" rows="8"
+                    style="width:80%;"><?php echo $info['response']; ?></textarea>
                 <table border="0" cellspacing="0" cellpadding="2" width="100%">
                 <?php
                 if($cfg->allowAttachments()) { ?>
@@ -260,8 +271,8 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
                                 foreach($info['cannedattachments'] as $k=>$id) {
                                     if(!($file=AttachmentFile::lookup($id))) continue;
                                     $hash=$file->getHash().md5($file->getId().session_id().$file->getHash());
-                                    echo sprintf('<label><input type="checkbox" name="cannedattachments[]" 
-                                            id="f%d" value="%d" checked="checked" 
+                                    echo sprintf('<label><input type="checkbox" name="cannedattachments[]"
+                                            id="f%d" value="%d" checked="checked"
                                             <a href="file.php?h=%s">%s</a>&nbsp;&nbsp;</label>&nbsp;',
                                             $file->getId(), $file->getId() , $hash, $file->getName());
                                 }
@@ -313,12 +324,17 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
         ?>
         <tr>
             <th colspan="2">
-                <em><strong>Internal Note</strong>: Optional internal note (recommended on assignment) <font class="error">&nbsp;<?php echo $errors['note']; ?></font></em>
+                <em><strong>Internal Note</strong>
+                <font class="error">&nbsp;<?php echo $errors['note']; ?></font></em>
             </th>
         </tr>
         <tr>
             <td colspan=2>
-                <textarea name="note" cols="21" rows="6" style="width:80%;"><?php echo $info['note']; ?></textarea>
+                <textarea class="richtext ifhtml draft draft-delete"
+                    placeholder="Optional internal note (recommended on assignment)"
+                    data-draft-namespace="ticket.staff.note" name="note"
+                    cols="21" rows="6" style="width:80%;"
+                    ><?php echo $info['note']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php
index 3d119fb8ce5376675e570acf45799900eb683911..c8dcde436704a486d0c42ee112adb1b88b1e6483 100644
--- a/include/staff/ticket-view.inc.php
+++ b/include/staff/ticket-view.inc.php
@@ -335,19 +335,27 @@ if(!$cfg->showNotesInline()) { ?>
            if ($entry['body'] == '-')
                $entry['body'] = '(EMPTY)';
            ?>
-        <table class="<?php echo $threadTypes[$entry['thread_type']]; ?>" cellspacing="0" cellpadding="1" width="940" border="0">
+        <table class="thread-entry <?php echo $threadTypes[$entry['thread_type']]; ?>" cellspacing="0" cellpadding="1" width="940" border="0">
             <tr>
-                <th width="200"><?php echo Format::db_datetime($entry['created']);?></th>
+                <th width="auto"><?php echo Format::db_datetime($entry['created']);?></th>
                 <th width="440"><span><?php echo $entry['title']; ?></span></th>
-                <th width="300" class="tmeta"><?php echo Format::htmlchars($entry['poster']); ?></th>
+                <th width="auto" class="textra" style="text-align:right"></th>
+                <th width="auto" class="tmeta"><?php echo Format::htmlchars($entry['poster']); ?></th>
             </tr>
-            <tr><td colspan=3><?php echo Format::display($entry['body']); ?></td></tr>
+            <tr><td colspan="4" class="thread-body" id="thread-id-<?php
+                echo $entry['id']; ?>"><?php
+                echo Format::viewableImages(Format::display($entry['body'])); ?></td></tr>
             <?php
             if($entry['attachments']
                     && ($tentry=$ticket->getThreadEntry($entry['id']))
+                    && ($urls = $tentry->getAttachmentUrls())
                     && ($links=$tentry->getAttachmentsLinks())) {?>
             <tr>
-                <td class="info" colspan=3><?php echo $links; ?></td>
+                <td class="info" colspan="4"><?php echo $links; ?></td>
+                <script type="text/javascript">
+                    $(function() { showImagesInline(<?php echo
+                        JsonDataEncoder::encode($urls); ?>); });
+                </script>
             </tr>
             <?php
             }?>
@@ -370,7 +378,7 @@ if(!$cfg->showNotesInline()) { ?>
 <?php } ?>
 
 <div id="response_options">
-    <ul>
+    <ul class="tabs">
         <?php
         if($thisstaff->canPostReply()) { ?>
         <li><a id="reply_tab" href="#reply">Post Reply</a></li>
@@ -438,7 +446,13 @@ if(!$cfg->showNotesInline()) { ?>
                         <br>
                     <?php
                     }?>
-                    <textarea name="response" id="response" cols="50" rows="9" wrap="soft"><?php echo $info['response']; ?></textarea>
+                    <input type="hidden" name="draft_id" value=""/>
+                    <textarea name="response" id="response" cols="50"
+                        data-draft-namespace="ticket.response"
+                        data-draft-object-id="<?php echo $ticket->getId(); ?>"
+                        rows="9" wrap="soft"
+                        class="richtext ifhtml draft"><?php
+                        echo $info['response']; ?></textarea>
                 </td>
             </tr>
             <?php
@@ -534,8 +548,13 @@ if(!$cfg->showNotesInline()) { ?>
                 </td>
                 <td width="765">
                     <div><span class="faded">Note details</span>&nbsp;
-                        <span class="error">*&nbsp;<?php echo $errors['note']; ?></span></div>
-                    <textarea name="note" id="internal_note" cols="80" rows="9" wrap="soft"><?php echo $info['note']; ?></textarea><br>
+                        <span class="error">*&nbsp;<?php echo $errors['note']; ?></span>
+                    </div>
+                    <textarea name="note" id="internal_note" cols="80"
+                        rows="9" wrap="soft" data-draft-namespace="ticket.note"
+                        data-draft-object-id="<?php echo $ticket->getId(); ?>"
+                        class="richtext ifhtml draft"><?php echo $info['note'];
+                        ?></textarea><br>
                     <div>
                         <span class="faded">Note title - summary of the note (optional)</span>&nbsp;
                         <span class="error"&nbsp;<?php echo $errors['title']; ?></span>
@@ -665,7 +684,8 @@ if(!$cfg->showNotesInline()) { ?>
                     <span class="faded">Enter reasons for the transfer.</span>
                     <span class="error">*&nbsp;<?php echo $errors['transfer_comments']; ?></span><br>
                     <textarea name="transfer_comments" id="transfer_comments"
-                        cols="80" rows="7" wrap="soft"><?php echo $info['transfer_comments']; ?></textarea>
+                        class="richtext ifhtml no-bar" cols="80" rows="7" wrap="soft"><?php
+                        echo $info['transfer_comments']; ?></textarea>
                 </td>
             </tr>
         </table>
@@ -752,7 +772,8 @@ if(!$cfg->showNotesInline()) { ?>
                 <td width="765">
                     <span class="faded">Enter reasons for the assignment or instructions for assignee.</span>
                     <span class="error">*&nbsp;<?php echo $errors['assign_comments']; ?></span><br>
-                    <textarea name="assign_comments" id="assign_comments" cols="80" rows="7" wrap="soft"><?php echo $info['assign_comments']; ?></textarea>
+                    <textarea name="assign_comments" id="assign_comments" cols="80" rows="7" wrap="soft"
+                        class="richtext ifhtml no-bar"><?php echo $info['assign_comments']; ?></textarea>
                 </td>
             </tr>
         </table>
@@ -814,8 +835,12 @@ if(!$cfg->showNotesInline()) { ?>
         <input type="hidden" name="a" value="process">
         <input type="hidden" name="do" value="<?php echo $ticket->isClosed()?'reopen':'close'; ?>">
         <fieldset>
-            <em>Reasons for status change (internal note). Optional but highly recommended.</em><br>
-            <textarea name="ticket_status_notes" id="ticket_status_notes" cols="50" rows="5" wrap="soft"><?php echo $info['ticket_status_notes']; ?></textarea>
+            <div style="margin-bottom:0.5em">
+            <em>Reasons for status change (internal note). Optional but highly recommended.</em>
+            </div>
+            <textarea name="ticket_status_notes" id="ticket_status_notes" cols="50" rows="5" wrap="soft"
+                style="width:100%"
+                class="richtext ifhtml no-bar"><?php echo $info['ticket_status_notes']; ?></textarea>
         </fieldset>
         <hr style="margin-top:1em"/>
         <p class="full-width">
diff --git a/include/staff/tpl.inc.php b/include/staff/tpl.inc.php
index cfc84132a748a85a6d3c1af32e26d1b15e17ae17..9527b5a3469ea382b0000cad6d30607ab616ba3d 100644
--- a/include/staff/tpl.inc.php
+++ b/include/staff/tpl.inc.php
@@ -27,7 +27,7 @@ if (is_a($template, EmailTemplateGroup)) {
     $action = 'updatetpl';
     $extras = array();
     $msgtemplates=$template->getGroup()->all_names;
-    $info=array_merge(array('subject'=>$template->getSubject(), 'body'=>$template->getBody()),$info);
+    $info=array_merge(array('subject'=>$template->getSubject(), 'body'=>$template->getBodyWithImages()),$info);
 }
 $tpl=$msgtemplates[$selected];
 
@@ -58,7 +58,7 @@ $tpl=$msgtemplates[$selected];
     &nbsp;&nbsp;&nbsp;<font color="red"><?php echo $errors['tpl']; ?></font>
     </form>
 </div>
-<form action="templates.php?id=<?php echo $id; ?>" method="post" id="save">
+<form action="templates.php?id=<?php echo $id; ?>&amp;a=manage" method="post" id="save">
 <?php csrf_token(); ?>
 <?php foreach ($extras as $k=>$v) { ?>
     <input type="hidden" name="<?php echo $k; ?>" value="<?php echo $v; ?>" />
@@ -85,15 +85,21 @@ $tpl=$msgtemplates[$selected];
         </tr>
         <tr>
             <td colspan="2">
-                <strong>Message Body:</strong> <em>Email message body.</em> <font class="error">*&nbsp;<?php echo $errors['body']; ?></font><br>
-                <textarea name="body" cols="21" rows="16" style="width:98%;" wrap="soft" ><?php echo $info['body']; ?></textarea>
+                <div style="margin-bottom:0.5em;margin-top:0.5em">
+                <strong>Message Body:</strong> <em>Email message body.</em> <font class="error">*&nbsp;<?php echo $errors['body']; ?></font>
+                </div>
+                <input type="hidden" name="draft_id" value=""/>
+                <textarea name="body" cols="21" rows="16" style="width:98%;" wrap="soft"
+                    class="richtext draft" data-draft-namespace="tpl.<?php echo $selected; ?>"
+                    data-draft-object-id="<?php echo $tpl_id; ?>"><?php echo $info['body']; ?></textarea>
             </td>
         </tr>
     </tbody>
 </table>
 <p style="padding-left:210px;">
     <input class="button" type="submit" name="submit" value="Save Changes">
-    <input class="button" type="reset" name="reset" value="Reset Changes">
+    <input class="button" type="reset" name="reset" value="Reset Changes" onclick="javascript:
+        setTimeout('location.reload()', 25);" />
     <input class="button" type="button" name="cancel" value="Cancel Changes"
         onclick='window.location.href="templates.php?tpl_id=<?php echo $tpl_id; ?>"'>
 </p>
diff --git a/include/upgrader/streams/core.sig b/include/upgrader/streams/core.sig
index e6b76f0e8ea5ac1f0ef9fcef6fd39a00acc75bb2..ecec52efd887fe2457ad1103917e23f88d59f9ef 100644
--- a/include/upgrader/streams/core.sig
+++ b/include/upgrader/streams/core.sig
@@ -1 +1 @@
-d51f303a2c9ee04f9906fc1b6047459f
+ec19794f1fc8d6a54ac217d6e8006a85
diff --git a/include/upgrader/streams/core/16fcef4a-ec19794f.patch.sql b/include/upgrader/streams/core/16fcef4a-ec19794f.patch.sql
new file mode 100644
index 0000000000000000000000000000000000000000..bae4ac7150cd595ba97f41e836a3798db3442fcd
--- /dev/null
+++ b/include/upgrader/streams/core/16fcef4a-ec19794f.patch.sql
@@ -0,0 +1,127 @@
+/**
+ * @signature ec19794f1fc8d6a54ac217d6e8006a85
+ * @version 1.8.0
+ *
+ * Migrate to a single attachment table to allow for inline image support
+ * with an almost countless number of attachment tables to support what is
+ * attached to what
+ */
+
+DROP TABLE IF EXISTS `%TABLE_PREFIX%attachment`;
+CREATE TABLE `%TABLE_PREFIX%attachment` (
+  `object_id` int(11) unsigned NOT NULL,
+  `type` char(1) NOT NULL,
+  `file_id` int(11) unsigned NOT NULL,
+  `inline` tinyint(1) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`object_id`,`file_id`,`type`)
+) DEFAULT CHARSET=utf8;
+
+-- Migrate canned attachments
+INSERT INTO `%TABLE_PREFIX%attachment`
+  (`object_id`, `type`, `file_id`, `inline`)
+  SELECT `canned_id`, 'C', `file_id`, 0
+  FROM `%TABLE_PREFIX%canned_attachment`;
+
+DROP TABLE `%TABLE_PREFIX%canned_attachment`;
+
+-- Migrate faq attachments
+INSERT INTO `%TABLE_PREFIX%attachment`
+  (`object_id`, `type`, `file_id`, `inline`)
+  SELECT `faq_id`, 'F', `file_id`, 0
+  FROM `%TABLE_PREFIX%faq_attachment`;
+
+DROP TABLE `%TABLE_PREFIX%faq_attachment`;
+
+-- Migrate email templates to HTML
+UPDATE `%TABLE_PREFIX%email_template`
+    SET `body` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `body`))));
+
+-- Migrate notes to HTML
+UPDATE `%TABLE_PREFIX%api_key`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%email`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%email_template_group`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%faq`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%faq_category`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%filter`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%groups`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%help_topic`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%page`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%sla`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%staff`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+UPDATE `%TABLE_PREFIX%team`
+    SET `notes` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `notes`))));
+
+-- Migrate canned responses to HTML
+UPDATE `%TABLE_PREFIX%canned_response`
+    SET `body` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `body`)))),
+    `response` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;',
+                REPLACE('&', '&amp;', `response`))));
+
+-- Migrate ticket-thread to HTML
+-- XXX: Migrate & -> &amp; ? -- the problem is that there's a fix in 1.7.1
+-- that properly encodes these characters, so encoding & would mean possible
+-- double encoding.
+UPDATE `%TABLE_PREFIX%ticket_thread`
+    SET `body` = REPLACE('\n', '<br/>',
+        REPLACE('<', '&lt;',
+            REPLACE('>', '&gt;', `body`)));
+
+-- Finished with patch
+UPDATE `%TABLE_PREFIX%config`
+    SET `value` = 'ec19794f1fc8d6a54ac217d6e8006a85'
+    WHERE `key` = 'schema_signature' AND `namespace` = 'core';
diff --git a/js/jquery-1.7.2.min.js b/js/jquery-1.7.2.min.js
deleted file mode 100644
index 16ad06c5acaad09ee4d6e9d7c428506db028aeeb..0000000000000000000000000000000000000000
--- a/js/jquery-1.7.2.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.7.2 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
-a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
-.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
\ No newline at end of file
diff --git a/js/jquery-1.8.3.min.js b/js/jquery-1.8.3.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..38837795279c5eb281e98ce6017998b993026518
--- /dev/null
+++ b/js/jquery-1.8.3.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v1.8.3 jquery.com | jquery.org/license */
+(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")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(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.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%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.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,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement 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 e.which==null&&(e.which=t.charCode!=null?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,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.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]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.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,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.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){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(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 lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.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=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=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):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
\ No newline at end of file
diff --git a/js/jquery-ui-1.10.3.custom.min.js b/js/jquery-ui-1.10.3.custom.min.js
new file mode 100755
index 0000000000000000000000000000000000000000..8d62da712ce1181ff7030358326918325a3dc5db
--- /dev/null
+++ b/js/jquery-ui-1.10.3.custom.min.js
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.10.3 - 2013-08-24
+* http://jqueryui.com
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.datepicker.js
+* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
+
+(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",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:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?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):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(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),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,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,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(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),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(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),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,"disabled"===e&&(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(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,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,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",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(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),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(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):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)},_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(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",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,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?: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 i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.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 i=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.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,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,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!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){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(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(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){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,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=t.pageX,l=t.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_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,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),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(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(document).scrollTop()<s.scrollSensitivity?n=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(n=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(document).scrollLeft()<s.scrollSensitivity?n=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(n=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),s=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(t,i){var s,n,a,o,r,h,l,u,c,d,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,b=i.offset.top,y=b+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,r-m>v||g>h+m||l-m>y||b>u+m||!e.contains(p.snapElements[c].item.ownerDocument,p.snapElements[c].item)?(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t,e){function i(){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},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.3"}});var a,r="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){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:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t("<span class='"+this._appendClass+"'>"+r+"</span>"),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(a?t("<img/>").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,x=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=x(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},w=function(i,n,a){var r=-1,o=t.map(x(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||x("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":w("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=w("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":x("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},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:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,x,k,w,D,T,C,M,S,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),Q=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==Q[0]||1!==Q[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-Q[0]*Q[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=K?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.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(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;Q[0]>k;k++){for(w="",this.maxRows=4,D=0;Q[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",M="",q){if(M+="<div class='ui-datepicker-group",Q[1]>1)switch(D){case 0:M+=" ui-datepicker-group-first",C=" ui-corner-"+(Y?"right":"left");break;case Q[1]-1:M+=" ui-datepicker-group-last",C=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",C=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",S=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+c)%7,S+="<th"+((x+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[N]+"'>"+p[N]+"</span></th>";for(M+=S+"</tr></thead><tbody>",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(M+="<tr>",F=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",x=0;7>x;x++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="<td class='"+((x+c+6)%7>=5?" ui-datepicker-week-end":"")+(W?" ui-datepicker-other-month":"")+(H.getTime()===T.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(j?" "+this._unselectableClass+" ui-state-disabled":"")+(W&&!v?"":" "+O[1]+(H.getTime()===X.getTime()?" "+this._currentClass:"")+(H.getTime()===L.getTime()?" ui-datepicker-today":""))+"'"+(W&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(j?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(W&&!v?"&#xa0;":j?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===L.getTime()?" ui-state-highlight":"")+(H.getTime()===X.getTime()?" ui-state-active":"")+(W?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=F+"</tr>"}Z++,Z>11&&(Z=0,te++),M+="</tbody></table>"+(q?"</div>"+(Q[0]>0&&D===Q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=M}y+=w}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+r[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+o[c]+"</option>");y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);
+return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.3"})(jQuery);
\ No newline at end of file
diff --git a/js/jquery-ui-1.8.18.custom.min.js b/js/jquery-ui-1.8.18.custom.min.js
deleted file mode 100755
index 81486fc8e6f8a32d847668911188813b107536de..0000000000000000000000000000000000000000
--- a/js/jquery-ui-1.8.18.custom.min.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*!
- * jQuery UI 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI
- */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*
- * jQuery UI Datepicker 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- *	jquery.ui.core.js
- */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}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>'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});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(a){extendRemove(this._defaults,a||{});return 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(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),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(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},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(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),
-a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);
\ No newline at end of file
diff --git a/js/osticket.js b/js/osticket.js
index 7ee8d00a66ebe05ece0efa30b2c8d19f1bad96c2..653af24ba892de0603eaf2341b8e94a69904a6e1 100644
--- a/js/osticket.js
+++ b/js/osticket.js
@@ -51,10 +51,37 @@ $(document).ready(function(){
 
     jQuery.fn.exists = function() { return this.length>0; };
 
-    var getConfig = (function() {
+    //Add CSRF token to the ajax requests.
+    // Many thanks to https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ + jared.
+    $(document).ajaxSend(function(event, xhr, settings) {
+
+        function sameOrigin(url) {
+            // url could be relative or scheme relative or absolute
+            var host = document.location.host; // host + port
+            var protocol = document.location.protocol;
+            var sr_origin = '//' + host;
+            var origin = protocol + sr_origin;
+            // Allow absolute or scheme relative URLs to same origin
+            return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
+                (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
+                // or any other URL that isn't scheme relative or absolute i.e
+                // relative.
+                !(/^(\/\/|http:|https:).*/.test(url));
+        }
+
+        function safeMethod(method) {
+            return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
+        }
+        if (!safeMethod(settings.type) && sameOrigin(settings.url)) {
+            xhr.setRequestHeader("X-CSRFToken", $("meta[name=csrf_token]").attr("content"));
+        }
+
+    });
+
+    getConfig = (function() {
         var dfd = $.Deferred();
         return function() {
-            if (!dfd.isResolved())
+            if (dfd.state() != 'resolved')
                 $.ajax({
                     url: "ajax.php/config/client",
                     dataType: 'json',
@@ -80,3 +107,28 @@ $(document).ready(function(){
         });
     }
 });
+
+showImagesInline = function(urls, thread_id) {
+    var selector = (thread_id == undefined)
+        ? '.thread-body img[src^=cid]'
+        : '.thread-body#thread-id-'+thread_id+' img[src^=cid]';
+    $(selector).each(function(i, el) {
+        var hash = $(el).attr('src').slice(4),
+            info = urls[hash],
+            e = $(el);
+        if (info && e.attr('src') == 'cid:' + hash) {
+            e.attr('src', info.url);
+            // Add a hover effect with the filename
+            var caption = $('<div class="image-hover">')
+                .hover(
+                    function() { $(this).find('.caption').slideDown(250); },
+                    function() { $(this).find('.caption').slideUp(250); }
+                ).append($('<div class="caption">')
+                    .append('<span class="filename">'+info.filename+'</span>')
+                    .append('<a href="'+info.download_url+'" class="action-button"><i class="icon-download-alt"></i> Download</a>')
+                )
+            caption.appendTo(e.parent())
+            e.appendTo(caption);
+        }
+    });
+}
diff --git a/js/redactor-fonts.js b/js/redactor-fonts.js
new file mode 100644
index 0000000000000000000000000000000000000000..3e0304f6fc5195bec9e74f0352691554c5a7b5b1
--- /dev/null
+++ b/js/redactor-fonts.js
@@ -0,0 +1,129 @@
+if (!RedactorPlugins) var RedactorPlugins = {};
+
+RedactorPlugins.fontfamily = {
+	init: function ()
+	{
+		var fonts = [ 'Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Monospace' ];
+		var that = this;
+		var dropdown = {};
+
+		$.each(fonts, function(i, s)
+		{
+			dropdown['s' + i] = {
+                title: '<span style="font-family:'+s+';">'+s+'</style>' ,
+                callback: function() { that.setFontfamily(s); }};
+		});
+
+		dropdown['remove'] = { title: 'Remove font', callback: function() { that.resetFontfamily(); }};
+
+		this.buttonAddBefore('bold', 'fontfamily', 'Change font family', false, dropdown);
+	},
+	setFontfamily: function (value)
+	{
+		this.inlineSetStyle('font-family', value);
+	},
+	resetFontfamily: function()
+	{
+		this.inlineRemoveStyle('font-family');
+	}
+};
+
+RedactorPlugins.fontcolor = {
+	init: function()
+	{
+		var colors = ['#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00', '#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca', '#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694', '#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314', '#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100', '#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'];
+		var buttons = ['fontcolor', 'backcolor'];
+
+		for (var i = 1; i >= 0 ; i--)
+		{
+			var name = buttons[i];
+
+			var $dropdown = $('<div class="redactor_dropdown redactor_dropdown_box_' + name + '" style="display: none; width: 210px;">');
+
+			this.pickerBuild($dropdown, name, colors);
+			$(this.$toolbar).append($dropdown);
+
+			this.buttonAddAfter('deleted', name, this.opts.curLang[name], $.proxy(function(btnName, $button, btnObject, e)
+			{
+				this.dropdownShow(e, btnName);
+
+			}, this));
+		}
+		this.buttonAddSeparatorBefore(buttons[0]);
+
+	},
+	pickerBuild: function($dropdown, name, colors)
+	{
+		var rule = 'color';
+		if (name === 'backcolor') rule = 'background-color';
+
+		var _self = this;
+		var onSwatch = function(e)
+		{
+			e.preventDefault();
+
+			var $this = $(this);
+			_self.pickerSet($this.data('rule'), $this.attr('rel'));
+
+		}
+
+		var len = colors.length;
+		for (var z = 0; z < len; z++)
+		{
+			var color = colors[z];
+
+			var $swatch = $('<a rel="' + color + '" data-rule="' + rule +'" href="#" style="float: left; font-size: 0; border: 2px solid #fff; padding: 0; margin: 0; width: 15px; height: 15px;"></a>');
+			$swatch.css('background-color', color);
+			$dropdown.append($swatch);
+			$swatch.on('click', onSwatch);
+		}
+
+		var $elNone = $('<a href="#" style="display: block; clear: both; padding: 4px 0; font-size: 11px; line-height: 1;"></a>')
+		.html(this.opts.curLang.none)
+		.on('click', function(e)
+		{
+			e.preventDefault();
+			_self.pickerSet(rule, false);
+		});
+
+		$dropdown.append($elNone);
+	},
+	pickerSet: function(rule, type)
+	{
+		this.bufferSet();
+
+		this.$editor.focus();
+		this.inlineRemoveStyle(rule);
+		if (type !== false) this.inlineSetStyle(rule, type);
+		if (this.opts.air) this.$air.fadeOut(100);
+		this.sync();
+	}
+};
+
+RedactorPlugins.fontsize = {
+	init: function()
+	{
+		var fonts = [10, 14, 22, 32];
+		var that = this;
+		var dropdown = {};
+
+		$.each(fonts, function(i, s)
+		{
+			dropdown['s' + i] = {
+                title: '<span style="font-size:'+s+'px">'+s+'px</span>',
+                callback: function() { that.setFontsize(s); } };
+		});
+
+		dropdown['remove'] = { title: 'Remove font size', callback: function() { that.resetFontsize(); } };
+
+		this.buttonAddAfter('formatting', 'fontsize', 'Change font size', false, dropdown);
+	},
+	setFontsize: function(size)
+	{
+		this.inlineSetStyle('font-size', size + 'px');
+	},
+	resetFontsize: function()
+	{
+		this.inlineRemoveStyle('font-size');
+	}
+};
diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js
new file mode 100644
index 0000000000000000000000000000000000000000..a9c68e0b54902a7697913aae24fc2b48eec1b103
--- /dev/null
+++ b/js/redactor-osticket.js
@@ -0,0 +1,184 @@
+if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
+
+/* Generic draft support for osTicket. The plugins supports draft retrieval
+ * automatically, along with draft autosave, and image uploading.
+ *
+ * Configuration:
+ * draft_namespace: namespace for the draft retrieval
+ * draft_object_id: extension to the namespace for draft retrieval
+ *
+ * Caveats:
+ * Login (staff only currently) is required server-side for drafts and image
+ * uploads. Furthermore, the id of the staff is considered for the drafts,
+ * so one user will not retrieve drafts for another user.
+ */
+RedactorPlugins.draft = {
+    init: function() {
+        if (!this.opts.draft_namespace)
+            return;
+
+        this.opts.changeCallback = this.hideDraftSaved;
+        var autosave_url = 'ajax.php/draft/' + this.opts.draft_namespace;
+        if (this.opts.draft_object_id)
+            autosave_url += '.' + this.opts.draft_object_id;
+        this.opts.autosave = autosave_url;
+        this.opts.autosaveInterval = 4;
+        this.opts.autosaveCallback = this.setupDraftUpdate;
+        this.opts.initCallback = this.recoverDraft;
+    },
+    recoverDraft: function() {
+        var self = this;
+        $.ajax(this.opts.autosave, {
+            dataType: 'json',
+            statusCode: {
+                200: function(json) {
+                    self.draft_id = json.draft_id;
+                    // Relace the current content with the draft, sync, and make
+                    // images editable
+                    self.setupDraftUpdate(json);
+                    if (!json.body) return;
+                    self.set(json.body, false);
+                    self.observeStart();
+                },
+                205: function() {
+                    // Save empty draft immediately;
+                    var ai = self.opts.autosaveInterval;
+
+                    // Save immediately -- capture the created autosave
+                    // interval and clear it as soon as possible. Note that
+                    // autosave()ing doesn't happen immediately. It happens
+                    // async after the autosaveInterval expires.
+                    self.opts.autosaveInterval = 0;
+                    self.autosave();
+                    var interval = self.autosaveInterval;
+                    setTimeout(function() {
+                        clearInterval(interval);
+                    }, 1);
+
+                    // Reinstate previous autosave interval timing
+                    self.opts.autosaveInterval = ai;
+                }
+            }
+        });
+    },
+    setupDraftUpdate: function(data) {
+        this.$box.parent().find('.draft-saved').show();
+
+        if (typeof data != 'object')
+            data = $.parseJSON(data);
+
+        if (!data || !data.draft_id)
+            return;
+
+        $('input[name=draft_id]', this.$box.closest('form'))
+            .val(data.draft_id);
+        this.draft_id = data.draft_id;
+
+        this.opts.clipboardUploadUrl =
+        this.opts.imageUpload =
+            'ajax.php/draft/'+data.draft_id+'/attach';
+        this.opts.imageUploadErrorCallback = this.displayError;
+        this.opts.autosave = 'ajax.php/draft/'+data.draft_id;
+    },
+
+    displayError: function(json) {
+        alert(json.error);
+    },
+
+    hideDraftSaved: function() {
+        this.$box.parent().find('.draft-saved').hide();
+    },
+
+    deleteDraft: function() {
+        var self = this;
+        $.ajax('ajax.php/draft/'+this.draft_id, {
+            type: 'delete',
+            success: function() {
+                self.opts.autosave = '';
+                self.opts.imageUpload = '';
+                self.draft_id = undefined;
+                clearInterval(self.autosaveInterval);
+                self.hideDraftSaved();
+                self.set('');
+            }
+        });
+    },
+
+};
+
+/* Redactor richtext init */
+$(function() {
+    var captureImageSizes = function(html) {
+        $('img', this.$box).each(function(i, img) {
+            // TODO: Rewrite the entire <img> tag. Otherwise the @width
+            // and @height attributes will begin to accumulate
+            before = img.outerHTML;
+            $(img).attr('width', img.clientWidth)
+                  .attr('height',img.clientHeight);
+            html = html.replace(before, img.outerHTML);
+        });
+        return html;
+    },
+    redact = function(el) {
+        var el = $(el),
+            options = {
+                'air': el.hasClass('no-bar'),
+                'airButtons': ['formatting', '|', 'bold', 'italic', 'deleted', '|', 'unorderedlist', 'orderedlist', 'outdent', 'indent', '|', 'image'],
+                'autoresize': !el.hasClass('no-bar'),
+                'minHeight': 150,
+                'focus': false,
+                'plugins': ['fontcolor','fontfamily'],
+                'imageGetJson': 'ajax.php/draft/images/browse',
+                'syncBeforeCallback': captureImageSizes
+            };
+        if (el.hasClass('draft')) {
+            var reset = $('input[type=reset]', el.closest('form')),
+                draft_saved = $('<span>')
+                .addClass("pull-right draft-saved faded")
+                .css({'position':'relative','top':'-1.8em','right':'1em'})
+                .hide()
+                .append($('<span>')
+                    .css({'position':'relative', 'top':'0.17em'})
+                    .text('Draft Saved'));
+            el.closest('form').append($('<input type="hidden" name="draft_id"/>'));
+            if (reset) {
+                reset.click(function() {
+                    if (el.hasClass('draft'))
+                        el.redactor('deleteDraft');
+                    else
+                        el.redactor('set', '');
+                });
+            }
+            if (el.hasClass('draft-delete')) {
+                draft_saved.append($('<span>')
+                    .addClass('action-button')
+                    .click(function() {
+                        el.redactor('deleteDraft');
+                        return false;
+                    })
+                    .append($('<i>')
+                        .addClass('icon-trash')
+                    )
+                );
+            }
+            draft_saved.insertBefore(el);
+            options['plugins'].push('draft');
+            if (el.data('draftNamespace'))
+                options['draft_namespace'] = el.data('draftNamespace');
+            if (el.data('draftObjectId'))
+                options['draft_object_id'] = el.data('draftObjectId');
+        }
+        el.redactor(options);
+    }
+    $('.richtext').each(function(i,el) {
+        if ($(el).hasClass('ifhtml'))
+            // Check if html_thread is enabled first
+            getConfig().then(function(c) {
+                if (c.html_thread)
+                    redact(el);
+            });
+        else
+            // Make a rich text editor immediately
+            redact(el);
+    });
+});
diff --git a/js/redactor.min.js b/js/redactor.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..7a93685e420c853d44d216e29e9021c726a7461a
--- /dev/null
+++ b/js/redactor.min.js
@@ -0,0 +1,12 @@
+/*
+	Redactor v9.1.1
+	Updated: Aug 12, 2013
+
+	http://imperavi.com/redactor/
+
+	Copyright (c) 2009-2013, Imperavi LLC.
+	License: http://imperavi.com/redactor/license/
+
+	Usage: $('#content').redactor();
+*/
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(B(d){y b=0;y a=E;"iO iS";y e=B(f){7[0]=f.iR;7[1]=f.dR;7.4C=f;F 7};e.3X.bx=B(){F 7[0]===7[1]};d.fn.M=B(g){y h=[];y f=jh.3X.j9.3t(jb,1);if(1r g==="jc"){7.18(B(){y j=d.1g(7,"M");if(1r j!=="1l"&&d.5J(j[g])){y i=j[g].e1(j,f);if(i!==1l&&i!==j){h.21(i)}}G{F d.33(\'jg jf 5m "\'+g+\'" 2K 4a\')}})}G{7.18(B(){if(!d.1g(7,"M")){d.1g(7,"M",c(7,g))}})}if(h.11===0){F 7}G{if(h.11===1){F h[0]}G{F h}}};B c(g,f){F 1R c.3X.5n(g,f)}d.4a=c;d.4a.iI="9.1.1";d.4a.C={2J:E,1n:E,2Y:E,T:E,by:"en",4m:"i8",3P:E,d4:E,cE:L,c3:L,cz:L,f1:E,db:L,8O:E,3Y:L,1s:E,5G:E,4f:L,5H:E,5I:L,5b:E,6R:60,af:E,7Q:E,7X:E,5Q:"8x://",cy:E,5V:E,3b:E,5R:E,7L:L,8T:E,d2:L,a7:["1b/cI","1b/cN","1b/cF"],6g:E,36:E,3r:L,9K:L,c9:L,2b:E,ct:["4L","|","3i","3d","47","|","4s","4p","55","4M"],19:L,3V:E,8y:Q,bW:0,7g:E,8n:E,cq:L,5y:\'<1D X="i5"></1D>\',cp:{},cm:[],3g:["U","|","4L","|","3i","3d","47","|","4s","4p","55","4M","|","1b","2N","2U","1j","2z","|","6z","|","5E"],6q:["47","3d","3i","5u","4s","4p","6l","6u","6o","5i","1j"],9p:{b:"3i",3E:"3i",i:"3d",em:"3d",7p:"47",7I:"47",25:"4s",2v:"4p",u:"5u",2L:"1j",1A:"1j",1j:"1j"},6p:E,cn:["p","2s","2d","h1","h2","h3","h4","h5","h6"],1z:E,4w:L,9o:L,aK:L,6N:E,aL:E,cA:E,61:E,5s:E,5Z:["U","7P","2z","1O","8R","2l","15","i9"],8X:"3E",8E:"em",6E:20,42:[],68:[],4o:E,4i:"<p>&#7r;</p>",1Y:"&#7r;",9I:/^(P|H[1-6]|2G|6I|6H|7m|6F|6t|6m)$/i,4g:["P","bh","bg","bf","bj","bo","bn","bl","b2","b6","7i","bQ","4x","bb","av","6I","6H","7m","6F","6t","6m"],9P:["aT","1O","7P","hr","i?2f","2z","8R","ic","15","2l","1j","4G","2M","8f"],9X:["1D","dt","dt","h[1-6]","3j","2l"],bw:["2s","N","dl","aU","1y","i4","aV","2v","p","2d","4U","1A","8N","2L","25"],8j:["P","bh","bg","bf","bj","bo","bn","bl","b2","b6","7i","2G","4x","bb","av","4F","6I","6H","7m","6F","6t","6m"],bA:{en:{U:"fx",2N:"4n b1",1b:"4n bJ",1j:"9C",2z:"bL",9n:"4n 2z",d6:"bs 2z",5w:"kE",4L:"kC",bN:"kc 1d",aR:"jM",5j:"bD",b0:"5D 1",aY:"5D 2",aZ:"5D 3",aX:"5D 4",aW:"5D 5",3i:"jD",3d:"k5",at:"k8 ba",al:"ka ba",4s:"k2 b9",4p:"k1 b9",55:"jV",4M:"jU",4X:"jT",63:"4n",9Y:"jS",dU:"5B",9O:"4n 9C",9N:"5C 9D jW",9x:"5C 9D jX",9F:"5C 9M bF",ag:"5C 9M bI",ao:"5B 9M",ap:"5B 9D",a4:"5B 9C",fD:"gE",fC:"fX",ak:"5C bp",an:"5B bp",R:"fZ",dF:"g5",28:"g4",1t:"bF",3D:"bI",dJ:"bJ gh bL",1d:"gn",6h:"aB",gu:"9z",fu:"b1 fQ bD",2U:"4n hs",4I:"ev",hy:"gU",a6:"gF",e7:"gM a6",es:"hh 2U hH",ae:"bC 1d bv bu 1t",aJ:"hE 1d",aA:"bC 1d bv bu 3D",9H:"gA 1d",5E:"4n gy gw",47:"gx",aH:"jv",aD:"fV 2z in 1R g1",5u:"gd",6z:"gk",a2:"g9 (ga)",eU:"bs"}}};c.fn=d.4a.3X={2n:{6T:8,ai:46,9t:40,6S:13,9T:27,bV:9,gz:17,gr:91,g7:37,bZ:91},5n:B(g,f){7.$4h=7.$1h=d(g);7.8w=b++;7.C=d.3S({},d.4a.C,7.$4h.1g(),f);7.4P=L;7.fN=[];7.9W=7.$1h.T("1C");7.fK=7.$1h.T("2r");if(7.C.2Y){7.C.1n=L}if(7.C.1z){7.C.4w=E}if(7.C.4w){7.C.1z=E}if(7.C.7g){7.C.3V=L}7.Q=Q;7.2Z=2Z;7.4c=E;7.bG=1R 2F("^<(/?"+7.C.9P.5q("|/?")+"|"+7.C.9X.5q("|")+")[ >]");7.bq=1R 2F("^<(br|/?"+7.C.9P.5q("|/?")+"|/"+7.C.9X.5q("|/")+")[ >]");7.84=1R 2F("^</?("+7.C.bw.5q("|")+")[ >]");7.8Z=1R 2F("^("+7.C.8j.5q("|")+")$","i");if(7.C.1z===E){if(7.C.5s!==E&&d.3G("p",7.C.5s)==="-1"){7.C.5s.21("p")}if(7.C.5Z!==E){y h=d.3G("p",7.C.5Z);if(h!=="-1"){7.C.5Z.7H(h,h)}}}if(7.1J("3a")||7.1J("7y")){7.C.3g=7.aS(7.C.3g,"5E")}7.C.1a=7.C.bA[7.C.by];7.cB()},d8:B(f){F{U:{R:f.U,1c:"8i"},4L:{R:f.4L,1c:"1K",2P:{p:{R:f.bN,1c:"3I"},2s:{R:f.aR,1c:"bc",3e:"hq"},2d:{R:f.5j,1c:"3I",3e:"hk"},h1:{R:f.b0,1c:"3I",3e:"hi"},h2:{R:f.aY,1c:"3I",3e:"hz"},h3:{R:f.aZ,1c:"3I",3e:"hN"},h4:{R:f.aX,1c:"3I",3e:"hJ"},h5:{R:f.aW,1c:"3I",3e:"hD"}}},3i:{R:f.3i,1M:"3i"},3d:{R:f.3d,1M:"3d"},47:{R:f.47,1M:"hB"},5u:{R:f.5u,1M:"5u"},4s:{R:"&hF; "+f.4s,1M:"6b"},4p:{R:"1. "+f.4p,1M:"6v"},55:{R:"< "+f.55,1c:"8A"},4M:{R:"> "+f.4M,1c:"8F"},1b:{R:f.1b,1c:"et"},2N:{R:f.2N,1c:"eL"},2U:{R:f.2U,1c:"e8"},1j:{R:f.1j,1c:"1K",2P:{9O:{R:f.9O,1c:"eH"},gO:{2m:"7f"},9N:{R:f.9N,1c:"eC"},9x:{R:f.9x,1c:"eJ"},9F:{R:f.9F,1c:"eK"},ag:{R:f.ag,1c:"eR"},gQ:{2m:"7f"},ak:{R:f.ak,1c:"eA"},an:{R:f.an,1c:"9c"},gK:{2m:"7f"},ao:{R:f.ao,1c:"ez"},ap:{R:f.ap,1c:"eD"},a4:{R:f.a4,1c:"eE"}}},2z:{R:f.2z,1c:"1K",2P:{2z:{R:f.9n,1c:"eO"},5w:{R:f.5w,1M:"5w"}}},at:{R:f.at,1c:"1K"},al:{R:f.al,1c:"1K"},6z:{R:f.6z,1c:"1K",2P:{6l:{R:f.ae,1c:"85"},6u:{R:f.aJ,1c:"7R"},6o:{R:f.aA,1c:"7V"},5i:{R:f.9H,1c:"7Y"}}},6l:{R:f.ae,1c:"85"},6u:{R:f.aJ,1c:"7R"},6o:{R:f.aA,1c:"7V"},5i:{R:f.9H,1c:"7Y"},5E:{1M:"cw",R:f.5E}}},1f:B(f,g,h){y i=7.C[f+"hb"];if(d.5J(i)){if(g===E){F i.3t(7,h)}G{F i.3t(7,g,h)}}G{F h}},ha:B(){ch(7.6R);d(2Z).2H(".M");7.$4h.2H(".M").hc("M");y g=7.1S();if(7.C.4o){7.$1E.22(7.$1h);7.$1E.1m();7.$1h.1e(g).1K()}G{y f=7.$J;if(7.C.1n){f=7.$4h}7.$1E.22(f);7.$1E.1m();f.2e("31").2e("d9").24("2X").U(g).1K()}if(7.C.2b){d(".87").1m()}},hd:B(){F d.3S({},7)},gX:B(){F 7.$J},gZ:B(){F 7.$1E},h7:B(){F(7.C.1n)?7.$2f:E},h0:B(){F 7.$19},1S:B(){F 7.$1h.1e()},cG:B(){7.$J.24("2X").24("4v");y f=7.5h(7.$2f.1G().6M());7.$J.16({2X:L,4v:7.C.4m});F f},6Q:B(f,g,h){f=f.2W();if(7.C.2Y){7.cO(f)}G{7.cP(f,g)}if(h!==E){7.cc()}},cP:B(f,g){if(g!==E){f=7.8I(f);f=7.5M(f);f=7.8W(f);f=7.7u(f);if(7.C.1z===E){f=7.8V(f)}G{f=f.I(/<p(.*?)>([\\w\\W]*?)<\\/p>/gi,"$2<br>")}}f=7.8U(f);7.$J.U(f);7.12()},cO:B(f){y g=7.8J();7.$2f[0].2q="gY:gV";f=7.8W(f);f=7.7u(f);f=7.62(f);g.7E();g.ci(f);g.cx();if(7.C.2Y){7.$J=7.$2f.1G().V("1O").16({2X:L,4v:7.C.4m})}7.12()},8k:B(f){f=7.8I(f,L);f=7.8V(f);f=7.8U(f);7.$J.U(f);7.12()},12:B(){y f="";7.bB();if(7.C.2Y){f=7.cG()}G{f=7.$J.U()}f=7.95(f);f=7.62(f);f=7.8a(f);f=f.I(/<\\/1D><(25|2v)>([\\w\\W]*?)<\\/(25|2v)>/gi,"<$1>$2</$1></1D>");if(d.2o(f)==="<br>"){f=""}if(f!==""&&7.C.cz){f=7.bM(f)}f=7.1f("h8",E,f);7.$1h.1e(f);7.1f("h9",E,f);if(7.4P===E){7.1f("6n",E,f)}},95:B(f){if(!7.C.2Y){f=7.5M(f)}f=d.2o(f);f=7.cd(f);f=f.I(/&#7r;/gi,"");f=f.I(/&#ca;/gi,"");f=f.I(/&2i;/gi," ");if(7.C.cy){f=f.I(/<a(.*?)2V="bO"(.*?)>/gi,"<a$1$2>");f=f.I(/<a(.*?)>/gi,\'<a$1 2V="bO">\')}f=f.I("<!--?3u","<?3u");f=f.I("?-->","?>");f=f.I(/ 1g-6a=""/gi,"");f=f.I(/<br\\s?\\/?>\\n?<\\/(P|H[1-6]|2G|6I|6H|7m|6F|6t|6m)>/gi,"</$1>");f=f.I(/<O(.*?)id="M-1b-1E"(.*?)>([\\w\\W]*?)<1p(.*?)><\\/O>/i,"$3<1p$4>");f=f.I(/<O(.*?)id="M-1b-9J"(.*?)>(.*?)<\\/O>/i,"");f=f.I(/<O(.*?)id="M-1b-aF"(.*?)>(.*?)<\\/O>/i,"");f=f.I(/<O\\s*?>([\\w\\W]*?)<\\/O>/gi,"$1");f=f.I(/<O(.*?)1g-M="2Q"(.*?)>([\\w\\W]*?)<\\/O>/gi,"<O$1$2>$3</O>");f=f.I(/<O(.*?)1g-M-4B=""(.*?)>([\\w\\W]*?)<\\/O>/gi,"<O$1$2>$3</O>");f=f.I(/<O\\s*?>([\\w\\W]*?)<\\/O>/gi,"$1");f=f.I(/<O\\s*?id="2c-1u(.*?)"(.*?)>([\\w\\W]*?)<\\/O>/gi,"");f=f.I(/<O\\s*?>([\\w\\W]*?)<\\/O>/gi,"$1");f=f.I(/<O>([\\w\\W]*?)<\\/O>/gi,"$1");f=7.cL(f);F f},cB:B(){7.3N="";7.$1E=d(\'<N X="gG" />\');if(7.$1h[0].Y==="gD"){7.C.4o=L}if(7.C.cE===E&&7.4b()){7.cD()}G{7.cC();if(7.C.1n){7.C.4f=E;7.cf()}G{if(7.C.4o){7.cQ()}G{7.cR()}}if(!7.C.1n){7.7S();7.89()}}},cD:B(){if(!7.C.4o){7.$J=7.$1h;7.$J.1T();7.$1h=7.6Y(7.$J);7.$1h.1e(7.3N)}7.$1E.6W(7.$1h).Z(7.$1h)},cC:B(){if(7.C.4o){7.3N=d.2o(7.$1h.1e())}G{7.3N=d.2o(7.$1h.U())}},cQ:B(){7.$J=d("<N />");7.$1E.6W(7.$1h).Z(7.$J).Z(7.$1h);7.d5(7.$J);7.az()},cR:B(){7.$J=7.$1h;7.$1h=7.6Y(7.$J);7.$1E.6W(7.$J).Z(7.$J).Z(7.$1h);7.az()},6Y:B(f){F d("<5t />").16("2m",f.16("id")).T("1C",7.9W)},d5:B(f){d.18(7.$1h.1S(0).3e.3k(/\\s+/),B(g,h){f.23("gL"+h)})},az:B(){7.$J.23("31").16({2X:L,4v:7.C.4m});7.$1h.16("4v",7.C.4m).1T();7.6Q(7.3N,L,E)},7S:B(){y f=7.$J;if(7.C.1n){f=7.$2f}if(7.C.5G){f.16("5G",7.C.5G)}if(7.C.5H){f.T("gR-1C",7.C.5H+"2y")}if(7.C.d4){7.$J.23("d9")}if(!7.C.4f){f.T("1C",7.9W)}},89:B(){7.4P=E;if(7.C.19){7.C.19=7.d8(7.C.1a);7.cs()}7.dj();7.ce();7.8d();if(7.C.5b){7.5b()}2k(d.K(7.5a,7),4);if(7.1J("3Q")){9k{7.Q.1H("gN",E,E);7.Q.1H("hG",E,E)}9j(f){}}if(7.C.1s){2k(d.K(7.1s,7),2x)}if(!7.C.3Y){2k(d.K(B(){7.C.3Y=L;7.8i(E)},7),3Z)}7.1f("5n")},8d:B(){if(7.C.d2){7.$J.1i("5r.M",d.K(7.cX,7))}7.$J.1i("7J.M",d.K(7.cu,7));7.$J.1i("4q.M",d.K(7.c6,7));7.$J.1i("3B.M",d.K(7.cr,7));if(d.5J(7.C.cV)){7.$J.1i("1s.M",d.K(7.C.cV,7))}7.$J.1i("cU.M",d.K(B(){7.4O=E},7));if(d.5J(7.C.cT)){7.$J.1i("cU.M",d.K(7.C.cT,7))}},cX:B(l){l=l.c0||l;if(2Z.7c===1l){F L}y j=l.80.79.11;if(j==0){F L}l.2a();y i=l.80.79[0];if(7.C.a7!==E&&7.C.a7.3x(i.1o)==-1){F L}7.1x();y h=d("<1p>");y f=d(\'<N id="M-1X-a8" X="M-1X M-1X-a5"><N id="M-1X-4S" X="M-1X-4S" 15="2r: 2x%;"></N></N>\');d(Q.1O).Z(f);y g=1R 7c();g.Z("2U",i);d.8z({2S:7.C.3b,dA:"U",1g:g,dg:E,6s:E,df:E,1o:"6k",2O:d.K(B(n){f.4Q("hO",B(){d(7).1m()});y m=d.6i(n);h.16("2q",m.4N).16("id","a8-1b-1u");7.fs(l,h[0]);y o=d(7.$J.V("1p#a8-1b-1u"));if(o.11){o.24("id")}G{o=E}7.12();7.3r();if(o){7.1f("3b",o,m)}},7),33:d.K(B(m){7.1f("8l",m)},7)})},cu:B(g){y h=E;if(7.1J("3K")&&96.98.3x("hM")===-1){y f=7.1J("7N").3k(".");if(f[0]<hK){h=L}}if(h){F L}if(7.1J("7y")){F L}if(7.C.7L&&7.c2(g)){F L}if(7.C.c3){a=L;7.1B();if(!7.4O){if(7.C.4f===L){7.$J.1C(7.$J.1C());7.7t=7.Q.1O.3H}G{7.7t=7.$J.3H()}}y i=7.8e();2k(d.K(B(){y j=7.8e();7.$J.Z(i);7.1k();y l=7.b4(j);7.f3(l);if(7.C.4f===L){7.$J.T("1C","3L")}},7),1)}},c2:B(i){y h=i.c0||i;7.c7=E;if(h.c4.c8){y g=h.c4.c8[0].hn();if(g!==26){7.1x();7.c7=L;y f=1R hm();f.fo=d.K(7.ft,7);f.gC(g);F L}}F E},c6:B(l){if(a){F E}y p=l.6U;y f=l.aE||l.bR;y o=7.3F();y m=7.2D();y i=7.1V();y h=E;7.1f("4q",l);7.5k(E);if((o&&d(o).1S(0).Y==="4F")||(m&&d(m).1S(0).Y==="4F")){h=L;if(p===7.2n.9t){7.7F(i)}}if(p===7.2n.9t){if(o&&d(o).1S(0).Y==="4x"){7.7F(o)}if(m&&d(m).1S(0).Y==="4x"){7.7F(m)}}if(f&&!l.3U){7.5I(l,p)}if(f&&p===90&&!l.3U&&!l.8o){l.2a();if(7.C.42.11){7.fB()}G{7.Q.1H("hp",E,E)}F}G{if(f&&p===90&&l.3U&&!l.8o){l.2a();if(7.C.68.11!=0){7.fw()}G{7.Q.1H("hv",E,E)}F}}if(f&&p===65){7.4O=L}G{if(p!=7.2n.bZ&&!f){7.4O=E}}if(p==7.2n.6S&&!l.3U&&!l.aE&&!l.bR){if(o.3s==1&&(o.Y=="bQ"||o.Y=="gb")){l.2a();7.1x();7.32(Q.3O("br"));7.1f("5F",l);F E}if(h===L){l.2a();7.1x();y j=d(m).1P().1d();7.32(Q.ax("\\n"));if(j.3W(/\\s$/)==-1){7.32(Q.ax("\\n"))}7.12();7.1f("5F",l);F E}G{if(!7.C.1z){if(i&&7.C.9I.3p(i.Y)){7.1x();2k(d.K(B(){y r=7.1V();if(r.Y==="7i"&&!d(r).3c("31")){y q=d("<p>"+7.C.1Y+"</p>");d(r).1U(q);7.3m(q)}},7),1)}G{if(i===E){7.1x();y g=d("<p>"+7.C.1Y+"</p>");7.32(g[0]);7.3m(g);7.1f("5F",l);F E}}}if(7.C.1z){if(i&&7.C.9I.3p(i.Y)){7.1x();2k(d.K(B(){y q=7.1V();if((q.Y==="7i"||q.Y==="P")&&!d(q).3c("31")){7.f2(q)}},7),1)}G{F 7.aN(l)}}if(i.Y=="4x"||i.Y=="av"){F 7.aN(l)}}7.1f("5F",l)}G{if(p===7.2n.6S&&(l.aE||l.3U)){7.1x();l.2a();7.7T()}}if(p===7.2n.bV&&7.C.5I){if(!7.C.c9){F L}if(7.8Y(7.1S())){F L}l.2a();if(h===L&&!l.3U){7.1x();7.32(Q.ax("\\t"));7.12();F E}G{if(!l.3U){7.8F()}G{7.8A()}}F E}if(p===7.2n.6T){if(1r m.Y!=="1l"&&/^(H[1-6])$/i.3p(m.Y)){y g;if(7.C.1z===E){g=d("<p>"+7.C.1Y+"</p>")}G{g=d("<br>"+7.C.1Y)}d(m).1U(g);7.3m(g)}if(1r m.6f!=="1l"&&m.6f!==26){y n=d.2o(m.6f.I(/[^\\eW-~]/g,""));if(m.1m&&m.3s===3&&m.6f.g3(0)==ca&&n==""){m.1m()}}}},aN:B(f){7.1x();f.2a();7.7T();7.1f("5F",f);F},cr:B(l){if(a){F E}y f=l.6U;y h=7.3F();y j=7.2D();if(!7.C.1z&&j.3s==3&&(h==E||h.Y=="fv")){y i=d("<p>").Z(d(j).4K());d(j).1U(i);y g=d(i).5N();if(1r(g[0])!=="1l"&&g[0].Y=="bd"){g.1m()}7.67(i)}if((7.C.aK||7.C.6N||7.C.aL)&&f===7.2n.6S){7.a3(7.C.5Q,7.C.aK,7.C.6N,7.C.aL);if(7.C.6N){7.3r()}}if(7.C.1z===E&&(f===7.2n.ai||f===7.2n.6T)){F 7.b3(l)}7.1f("3B",l);7.12()},ce:B(){if(!7.C.af){F}d.18(7.C.af,d.K(B(f,g){if(as[g]){d.3S(7,as[g]);if(d.5J(as[g].5n)){7.5n()}}},7))},cf:B(){7.cg();if(7.C.4o){7.aq(7.$1h)}G{7.$au=7.$1h.1T();7.$1h=7.6Y(7.$au);7.aq(7.$au)}},aq:B(f){7.$1h.16("4v",7.C.4m).1T();7.$1E.6W(f).Z(7.$2f).Z(7.$1h)},cg:B(){7.$2f=d(\'<1n 15="2r: 2x%;" co="0" />\').7e("ds",d.K(B(){if(7.C.2Y){7.8J();if(7.3N===""){7.3N=7.C.1Y}7.$2f.1G()[0].ci(7.3N);7.$2f.1G()[0].cx();y f=cl(d.K(B(){if(7.$2f.1G().V("1O").U()){ch(f);7.82()}},7),0)}G{7.82()}},7))},8Q:B(){F 7.$2f[0].ac.Q},8J:B(){y f=7.8Q();if(f.cj){f.gg(f.cj)}F f},7U:B(f){f=f||7.C.T;if(7.f6(f)){7.$2f.1G().V("7P").Z(\'<2z 2V="gl" 1N="\'+f+\'" />\')}if(d.gf(f)){d.18(f,d.K(B(h,g){7.7U(g)},7))}},82:B(){7.$J=7.$2f.1G().V("1O").16({2X:L,4v:7.C.4m});if(7.$J[0]){7.Q=7.$J[0].fP;7.2Z=7.Q.fL||2Z}7.7U();if(7.C.2Y){7.8k(7.$J.U())}G{7.6Q(7.3N,L,E)}7.7S();7.89()},cM:B(f){if(7.8Y(f)){if(7.$4h.16("3P")){7.C.3P=7.$4h.16("3P")}if(7.C.3P===""){7.C.3P=E}if(7.C.3P!==E){7.C.1s=E;7.$J.7e("1s.4l",d.K(7.cb,7));F d(\'<O X="4l" 1g-M="2Q">\').16("2X",E).1d(7.C.3P)}}F E},cb:B(){7.$J.V("O.4l").1m();y f="";if(7.C.1z===E){f=7.C.4i}7.$J.2H("1s.4l");7.$J.U(f);if(7.C.1z===E){7.3m(7.$J.6M()[0])}7.12()},cc:B(){7.C.3P=E;7.$J.V("O.4l").1m();7.$J.2H("1s.4l")},cd:B(f){F f.I(/<O X="4l"(.*?)>(.*?)<\\/O>/i,"")},5I:B(g,f){if(!7.C.5I){F}if(!g.8o){if(f===77){7.3R(g,"fT")}G{if(f===66){7.3R(g,"3i")}G{if(f===73){7.3R(g,"3d")}G{if(f===74){7.3R(g,"6b")}G{if(f===75){7.3R(g,"6v")}G{if(f===72){7.3R(g,"jY")}G{if(f===76){7.3R(g,"jZ")}}}}}}}}G{if(f===48){7.3T(g,"p")}G{if(f===49){7.3T(g,"h1")}G{if(f===50){7.3T(g,"h2")}G{if(f===51){7.3T(g,"h3")}G{if(f===52){7.3T(g,"h4")}G{if(f===53){7.3T(g,"h5")}G{if(f===54){7.3T(g,"h6")}}}}}}}}},3R:B(g,f){g.2a();7.1H(f,E)},3T:B(g,f){g.2a();7.3I(f)},1s:B(){if(!7.1J("7y")){7.2Z.2k(d.K(7.9s,7,L),1)}G{7.$J.1s()}},fH:B(){7.9s()},9s:B(h){7.$J.1s();y f=7.2C();f.6x(7.$J[0]);f.6K(h||E);y g=7.1F();g.4E();g.4Z(f)},8i:B(h){y g;if(7.C.3Y){if(h!==E){7.1B()}y f=26;if(7.C.1n){f=7.$2f.1C();if(7.C.2Y){7.$J.24("2X")}7.$2f.1T()}G{f=7.$J.k3();7.$J.1T()}g=7.$1h.1e();7.5z=g;7.$1h.1C(f).1K().1s();7.$1h.1i("4q.M-5t",B(j){if(j.2n===9){y i=d(7);y l=i.1S(0).3m;i.1e(i.1e().ck(0,l)+"\\t"+i.1e().ck(i.1S(0).67));i.1S(0).3m=i.1S(0).67=l+1;F E}});7.cS();7.41("U");7.C.3Y=E}G{g=7.$1h.1T().1e();if(1r 7.5z!=="1l"){7.5z=7.62(7.5z,E)!==7.62(g,E)}if(7.5z){if(7.C.2Y&&g===""){7.8k(g)}G{7.6Q(g);if(7.C.2Y){7.8d()}}}if(7.C.1n){7.$2f.1K()}G{7.$J.1K()}if(7.C.2Y){7.$J.16("2X",L)}7.$1h.2H("4q.M-5t");7.$J.1s();7.1k();7.5a();7.cW();7.9d("U");7.C.3Y=L}},5b:B(){y f=E;7.6R=cl(d.K(B(){y g=7.1S();if(f!==g){d.8z({2S:7.C.5b,1o:"4R",1g:7.$1h.16("2m")+"="+jB(jC(g)),2O:d.K(B(h){7.1f("5b",E,h);f=g},7)})}},7),7.C.6R*jA)},cs:B(){if(7.C.2b){7.C.3g=7.C.ct}G{if(!7.C.cq){y g=7.C.3g.3x("U"),h=7.C.3g[g+1];7.C.3g.7H(g,1);if(h==="|"){7.C.3g.7H(g,1)}}}d.3S(7.C.19,7.C.cp);d.18(7.C.cm,d.K(B(j,l){7.C.3g.21(l)},7));if(7.C.19){d.18(7.C.19.4L.2P,d.K(B(j,l){if(d.3G(j,7.C.cn)=="-1"){aj 7.C.19.4L.2P[j]}},7))}if(7.C.3g.11===0){F E}7.bT();7.$19=d("<25>").23("jx").16("id","jy"+7.8w);if(7.C.2b){7.$2b=d(\'<N X="87">\').16("id","jF"+7.8w).1T();7.$2b.Z(7.$19);d("1O").Z(7.$2b)}G{if(7.C.8n){d(7.C.8n).U(7.$19)}G{7.$1E.4W(7.$19)}}d.18(7.C.3g,d.K(B(l,m){if(m==="|"){7.$19.Z(d(7.C.5y))}G{if(7.C.19[m]){y j=7.C.19[m];if(7.C.5R===E&&m==="2U"){F L}7.$19.Z(d("<1D>").Z(7.5o(m,j)))}}},7));7.$19.V("a").16("5G","-1");if(7.C.3V){7.8q();d(7.C.8y).1i("jO.M",d.K(7.8q,7))}if(7.C.6q){y f=d.K(7.5O,7);7.$J.1i("6Z.M 3B.M",f)}},8q:B(){y j=d(7.C.8y).3H();y h=7.$1E.38().1W;y i=0;y f=h+7.$1E.1C()+40;if(j>h){y g="2x%";if(7.C.7g){i=7.$1E.38().1t;g=7.$1E.bS();7.$19.23("bU")}7.3V=L;7.$19.T({2u:"7C",2r:g,9w:jL,1W:7.C.bW+"2y",1t:i});if(j<f){7.$19.T("bX","dr")}G{7.$19.T("bX","7k")}}G{7.3V=E;7.$19.T({2u:"ed",2r:"3L",1W:0,1t:i});if(7.C.7g){7.$19.2e("bU")}}},bT:B(){if(!7.C.2b){F}7.$J.1i("6Z.M 3B.M",7,d.K(B(g){y i=7.dC();if(g.1o==="6Z"&&i!=""){7.7Z(g)}if(g.1o==="3B"&&g.3U&&i!=""){y f=d(7.5W(7.1F().kd)),h=f.38();h.1C=f.1C();7.7Z(h,L)}},7))},7Z:B(j,f){if(!7.C.2b){F}y i,h;d(".87").1T();if(f){i=j.1t;h=j.1W+j.1C+14;if(7.C.1n){h+=7.$1E.2u().1W-d(7.Q).3H();i+=7.$1E.2u().1t}}G{y g=7.$2b.bS();i=j.fr;if(d(7.Q).2r()<(i+g)){i-=g}h=j.fl+14;if(7.C.1n){h+=7.$1E.2u().1W;i+=7.$1E.2u().1t}G{h+=d(7.Q).3H()}}7.$2b.T({1t:i+"2y",1W:h+"2y"}).1K();7.bY()},bY:B(){if(!7.C.2b){F}y f=d.K(B(g){d(g).1i("ar.M",d.K(B(h){if(d(h.1I).2A(7.$19).11===0){7.$2b.4Q(2x);7.dK();d(g).2H(h)}},7)).1i("4q.M",d.K(B(h){if(h.6U===7.2n.9T){7.1F().kI()}7.$2b.4Q(2x);d(g).2H(h)},7))},7);f(Q);if(7.C.1n){f(7.Q)}},7a:B(){if(!7.C.2b){F}y f=d.K(B(g){d(g).1i("e5.M",d.K(B(h){if(d(h.1I).2A(7.$19).11===0){7.$2b.4Q(2x);d(g).2H(h)}},7))},7);f(Q);if(7.C.1n){f(7.Q)}},d0:B(g,f){d.18(f,d.K(B(j,i){if(!i.3e){i.3e=""}y h;if(i.2m==="7f"){h=d(\'<a X="kK">\')}G{h=d(\'<a 1N="#" X="\'+i.3e+" kG"+j+\'">\'+i.R+"</a>");h.1i("1L",d.K(B(l){if(l.2a){l.2a()}if(7.1J("3a")){l.c1=E}if(i.1f){i.1f.3t(7,j,h,i,l)}if(i.1M){7.1H(i.1M,j)}if(i.1c){7[i.1c](j)}7.5O();if(7.C.2b){7.$2b.4Q(2x)}},7))}g.Z(h)},7))},cv:B(n,i){if(!7.C.3Y){n.2a();F E}y m=7.$19.V(".cZ"+i);y j=7.2t(i);if(j.3c("5c")){7.78()}G{7.78();7.41(i);j.23("5c");y h=j.2u();if(7.3V){h=j.38()}y l=h.1t+"2y";y f=29;if(7.C.2b){m.T({2u:"6j",1t:l,1W:f+"2y"}).1K()}G{if(7.C.3V&&7.3V){m.T({2u:"7C",1t:l,1W:f+"2y"}).1K()}G{m.T({2u:"6j",1t:l,1W:h.1W+f+"2y"}).1K()}}}y g=d.K(B(o){7.c5(o,m)},7);d(Q).7e("1L",g);7.$J.7e("1L",g);n.kM()},78:B(){7.$19.V("a.5c").2e("59").2e("5c");d(".cY").1T()},c5:B(g,f){if(!d(g.1I).3c("5c")){f.2e("5c");7.78()}},5o:B(i,f){y g=d(\'<a 1N="6C:;" R="\'+f.R+\'" X="92 6G\'+i+\'"></a>\');g.1i("1L",d.K(B(j){if(j.2a){j.2a()}if(7.1J("3a")){j.c1=E}if(g.3c("94")){F E}if(7.7z()===E&&!f.1M){7.$J.1s()}if(f.1M){7.$J.1s();7.1H(f.1M,i);7.7a()}G{if(f.1c&&f.1c!=="1K"){7[f.1c](i);7.7a()}G{if(f.1f){f.1f.3t(7,i,g,f,j);7.7a()}G{if(f.2P){7.cv(j,i)}}}}7.5O(E,i)},7));if(f.2P){y h=d(\'<N X="cY cZ\'+i+\'" 15="2p: 28;">\');h.71(7.$19);7.d0(h,f.2P)}F g},2t:B(f){if(!7.C.19){F E}F d(7.$19.V("a.6G"+f))},d7:B(g){y f=7.2t(g);if(f.3c("59")){f.2e("59")}G{f.23("59")}},41:B(f){7.2t(f).23("59")},9d:B(f){7.2t(f).2e("59")},da:B(f){d.18(7.C.19,d.K(B(g){if(g!=f){7.9d(g)}},7))},cW:B(){7.$19.V("a.92").58("a.d1").2e("94")},cS:B(){7.$19.V("a.92").58("a.d1").23("94")},kQ:B(f,g){7.2t(f).23("6G"+g)},kR:B(f,g){7.2t(f).2e("6G"+g)},kN:B(){7.$19.Z(d(7.C.5y))},kL:B(f){7.2t(f).1P().22(d(7.C.5y))},kA:B(f){7.2t(f).1P().34(d(7.C.5y))},kB:B(f){7.2t(f).1P().5N().1m()},km:B(f){7.2t(f).1P().7d().1m()},kn:B(f){if(!7.C.19){F}7.2t(f).1P().23("9f")},kj:B(f){if(!7.C.19){F}7.2t(f).1P().2e("9f")},ki:B(g,h,j,i){if(!7.C.19){F}y f=7.5o(g,{R:h,1f:j,2P:i});7.$19.Z(d("<1D>").Z(f))},ke:B(g,h,j,i){if(!7.C.19){F}y f=7.5o(g,{R:h,1f:j,2P:i});7.$19.4W(d("<1D>").Z(f))},kf:B(m,g,i,l,j){if(!7.C.19){F}y f=7.5o(g,{R:i,1f:l,2P:j});y h=7.2t(m);if(h.2h()!==0){h.1P().22(d("<1D>").Z(f))}G{7.$19.Z(d("<1D>").Z(f))}},kg:B(j,g,i,m,l){if(!7.C.19){F}y f=7.5o(g,{R:i,1f:m,2P:l});y h=7.2t(j);if(h.2h()!==0){h.1P().34(d("<1D>").Z(f))}G{7.$19.Z(d("<1D>").Z(f))}},kp:B(f,h){y g=7.2t(f);if(h){g.1P().5N().1m()}g.1P().2e("9f");g.1m()},5O:B(h,j){y f=7.3F();7.da(j);if(h===E&&j!=="U"){if(d.3G(j,7.C.6q)!=-1){7.d7(j)}F}if(f&&f.Y==="A"){7.$19.V("a.d3").1d(7.C.1a.d6)}G{7.$19.V("a.d3").1d(7.C.1a.9n)}if(7.C.6p){d.18(7.C.6p,d.K(B(l,m){7.C.6q.21(m)},7));d.3S(7.C.9p,7.C.6p)}d.18(7.C.9p,d.K(B(l,m){if(d(f).2A(l,7.$J.1S()[0]).11!=0){7.41(m)}},7));y g=d(f).2A(7.C.4g.2W().30(),7.$J[0]);if(g.11){y i=g.T("1d-7v");kz(i){9g"3D":7.41("6o");6c;9g"b8":7.41("6u");6c;9g"5i":7.41("5i");6c;ku:7.41("6l");6c}}},1M:B(g,h,f){if(g==="b5"&&7.1J("3a")){h="<"+h+">"}if(g==="3z"&&7.1J("3a")){7.$J.1s();7.Q.2c.4Y().8h(h)}G{7.Q.1H(g,E,h)}if(f!==E){7.12()}7.1f("1H",g,h)},1H:B(i,h,q){if(!7.C.3Y){7.$1h.1s();F E}if(i==="3z"){7.7M(h,q);7.1f("1H",i,h);F}if(7.6d("4F")&&!7.C.cA){F E}if(i==="6b"||i==="6v"){7.1x();y r=7.3F();y m=d(r).2A("2v, 25");y l=E;if(m.11){l=L;y o=m[0].Y;if((i==="6b"&&o==="kt")||(i==="6v"&&o==="jJ")){l=E}}7.1B();if(l){y g=7.57();y f=7.2B(g);if(1r g[0]!="1l"&&g.11>1&&g[0].3s==3){f.di(7.1V())}y j="",s="";d.18(f,d.K(B(v,w){if(w.Y=="2G"){y u=d(w);y t=u.4K();t.V("25","2v").1m();if(7.C.1z===E){j+=7.5h(d("<p>").Z(t.1G()))}G{j+=t.U()+"<br>"}if(v==0){u.23("M-ju").7n();s=7.5h(u)}G{u.1m()}}},7));U=7.$J.U().I(s,"</"+o+">"+j+"<"+o+">");7.$J.U(U);7.$J.V(o+":7n").1m()}G{7.Q.1H(i);y r=7.3F();y m=d(r).2A("2v, 25");if(m.11){if((7.1J("3a")||7.1J("3Q"))&&r.Y!=="2G"){d(r).1U(d(r).U())}y n=m.1P();if(7.7o(n)&&7.6L(n[0])){n.1U(n.1G())}}if(7.1J("3Q")){7.$J.1s()}}7.1k();7.12();7.1f("1H",i,h);F}if(i==="5w"){7.1x();y p=7.6d("A");if(p){d(p).1U(d(p).1d());7.12();7.1f("1H",i,h);F}}7.1M(i,h,q);if(i==="cw"){7.$J.V("hr").24("id")}},8F:B(){7.8C("4M")},8A:B(){7.8C("55")},8C:B(i){7.1x();if(i==="4M"){y j=7.1V();7.1B();if(j&&j.Y=="2G"){y o=7.3F();y l=d(o).2A("2v, 25");y n=l[0].Y;y g=7.2B();d.18(g,B(t,u){if(u.Y=="2G"){y r=d(u).7d();if(r.2h()!=0&&r[0].Y=="2G"){y q=r.6M("25, 2v");if(q.2h()==0){r.Z(d("<"+n+">").Z(u))}G{q.Z(u)}}}})}G{if(j===E&&7.C.1z===L){7.1M("5e","2s");y p=7.1V();y j=d(\'<N 1g-6a="">\').U(d(p).U());d(p).1U(j);y h=7.7K(d(j).T("1Z-1t"))+7.C.6E;d(j).T("1Z-1t",h+"2y")}G{y f=7.2B();d.18(f,d.K(B(r,s){y q=E;if(d.3G(s.Y,7.C.4g)!==-1){q=d(s)}G{q=d(s).2A(7.C.4g.2W().30(),7.$J[0])}y t=7.7K(q.T("1Z-1t"))+7.C.6E;q.T("1Z-1t",t+"2y")},7))}}7.1k()}G{7.1B();y j=7.1V();if(j&&j.Y=="2G"){y g=7.2B();y m=0;7.8L(j,m,g)}G{y f=7.2B();d.18(f,d.K(B(r,s){y q=E;if(d.3G(s.Y,7.C.4g)!==-1){q=d(s)}G{q=d(s).2A(7.C.4g.2W().30(),7.$J[0])}y t=7.7K(q.T("1Z-1t"))-7.C.6E;if(t<=0){if(7.C.1z===L&&1r(q.1g("6a"))!=="1l"){q.1U(q.U())}G{q.T("1Z-1t","");7.3C(q,"15")}}G{q.T("1Z-1t",t+"2y")}},7))}7.1k()}},8L:B(f,h,g){if(f&&f.Y=="2G"){y i=d(f).1P().1P();if(i.2h()!=0&&i[0].Y=="2G"){i.22(f)}G{if(1r g[h]!="1l"){f=g[h];h++;7.8L(f,h,g)}G{7.1H("6b")}}}},8U:B(f){y g=7.cM(f);if(g!==E){F g}if(7.C.1z===E){if(f===""){f=7.C.4i}G{if(f.3W(/^<hr\\s?\\/?>$/gi)!==-1){f="<hr>"+7.C.4i}}}F f},8V:B(f){if(7.C.9o){f=f.I(/<N(.*?)>([\\w\\W]*?)<\\/N>/gi,"<p$1>$2</p>")}if(7.C.4w){f=7.7w(f)}F f},8W:B(f){if(7.C.8O){f=f.I(/\\{\\{(.*?)\\}\\}/gi,"<!-- 6A cH $1 -->");f=f.I(/\\{(.*?)\\}/gi,"<!-- 6A $1 -->")}f=f.I(/<2l(.*?)>([\\w\\W]*?)<\\/2l>/gi,\'<R 1o="1d/6C" 15="2p: 28;" X="M-2l-3A"$1>$2</R>\');f=f.I(/<15(.*?)>([\\w\\W]*?)<\\/15>/gi,\'<1w$1 15="2p: 28;" 2V="M-15-3A">$2</1w>\');f=f.I(/<1y(.*?)>([\\w\\W]*?)<\\/1y>/gi,\'<1w$1 2V="M-1y-3A">$2</1w>\');if(7.C.61){f=f.I(/<\\?3u([\\w\\W]*?)\\?>/gi,\'<1w 15="2p: 28;" 2V="M-3u-3A">$1</1w>\')}G{f=f.I(/<\\?3u([\\w\\W]*?)\\?>/gi,"")}F f},cL:B(f){if(7.C.8O){f=f.I(/<!-- 6A cH (.*?) -->/gi,"{{$1}}");f=f.I(/<!-- 6A (.*?) -->/gi,"{$1}")}f=f.I(/<R 1o="1d\\/6C" 15="2p: 28;" X="M-2l-3A"(.*?)>([\\w\\W]*?)<\\/R>/gi,\'<2l$1 1o="1d/6C">$2<\\/2l>\');f=f.I(/<1w(.*?) 15="2p: 28;" 2V="M-15-3A">([\\w\\W]*?)<\\/1w>/gi,"<15$1>$2</15>");f=f.I(/<1w(.*?)2V="M-1y-3A"(.*?)>([\\w\\W]*?)<\\/1w>/gi,"<1y$1$2>$3</1y>");if(7.C.61){f=f.I(/<1w 15="2p: 28;" 2V="M-3u-3A">([\\w\\W]*?)<\\/1w>/gi,"<?3u\\r\\n$1\\r\\n?>")}F f},62:B(g,f){if(f!==E){y f=[];y i=g.1Q(/<(2d|15|2l|R)(.*?)>([\\w\\W]*?)<\\/(2d|15|2l|R)>/gi);if(i===26){i=[]}if(7.C.61){y h=g.1Q(/<\\?3u([\\w\\W]*?)\\?>/gi);if(h){i=d.93(i,h)}}if(i){d.18(i,B(j,l){g=g.I(l,"cK"+j);f.21(l)})}}g=g.I(/\\n/g," ");g=g.I(/[\\t]*/g,"");g=g.I(/\\n\\s*\\n/g,"\\n");g=g.I(/^[\\s\\n]*/g," ");g=g.I(/[\\s\\n]*$/g," ");g=g.I(/>\\s{2,}</g,"><");g=7.cJ(g,f);g=g.I(/\\n\\n/g,"\\n");F g},cJ:B(g,f){if(f===E){F g}d.18(f,B(h,j){g=g.I("cK"+h,j)});F g},8a:B(j){j=j.I(/<O>([\\w\\W]*?)<\\/O>/gi,"$1");j=j.I(/[\\iw-\\iD\\iE]/g,"");y l=["<b>\\\\s*</b>","<b>&2i;</b>","<em>\\\\s*</em>"];y h=["<2d></2d>","<2s>\\\\s*</2s>","<dd></dd>","<dt></dt>","<25></25>","<2v></2v>","<1D></1D>","<1j></1j>","<2L></2L>","<O>\\\\s*<O>","<O>&2i;<O>","<p>\\\\s*</p>","<p></p>","<p>&2i;</p>","<p>\\\\s*<br>\\\\s*</p>","<N>\\\\s*</N>","<N>\\\\s*<br>\\\\s*</N>"];if(7.C.db){h=h.iG(l)}G{h=l}y f=h.11;2K(y g=0;g<f;++g){j=j.I(1R 2F(h[g],"gi"),"")}F j},7w:B(m){m=d.2o(m);if(7.C.1z===L){F m}if(m===""||m==="<p></p>"){F 7.C.4i}m=m+"\\n";y o=[];y l=m.1Q(/<(1j|N|2d|2I)(.*?)>([\\w\\W]*?)<\\/(1j|N|2d|2I)>/gi);if(l===26){l=[]}y n=m.1Q(/<!--([\\w\\W]*?)-->/gi);if(n){l=d.93(l,n)}if(7.C.61){y g=m.1Q(/<1w(.*?)2V="M-3u-3A">([\\w\\W]*?)<\\/1w>/gi);if(g){l=d.93(l,g)}}if(l){d.18(l,B(q,r){o[q]=r;m=m.I(r,"{I"+q+"}\\n")})}m=m.I(/<br \\/>\\s*<br \\/>/gi,"\\n\\n");B j(s,i,q){F m.I(1R 2F(s,i),q)}y f="(iy|U|1O|7P|R|8R|15|2l|2z|1n|1j|2M|8f|iA|ii|ih|4G|2L|1A|8N|N|dl|dd|dt|25|2v|1D|2d|4U|3j|1y|aV|aT|2s|7W|hZ|15|p|h[1-6]|hr|aU|i1|1w|fz|fE|i2|5x|35|hY|hX|hT|hS|hU|hV)";m=j("(<"+f+"[^>]*>)","gi","\\n$1");m=j("(</"+f+">)","gi","$1\\n\\n");m=j("\\r\\n","g","\\n");m=j("\\r","g","\\n");m=j("/\\n\\n+/","g","\\n\\n");y p=m.3k(1R 2F("\\hW*\\n","g"),-1);m="";2K(y h in p){if(p.i3(h)){if(p[h].3W("{I")==-1){m+="<p>"+p[h].I(/^\\n+|\\n+$/g,"")+"</p>"}G{m+=p[h]}}}if(m.3W(/<2s/gi)!==-1){d.18(m.1Q(/<2s(.*?)>([\\w\\W]*?)<\\/2s>/gi),B(q,r){y t="";t=r.I("<p>","");t=t.I("</p>","<br>");m=m.I(r,t)})}m=j("<p>s*</p>","gi","");m=j("<p>([^<]+)</(N|7W|1y)>","gi","<p>$1</p></$2>");m=j("<p>s*(</?"+f+"[^>]*>)s*</p>","gi","$1");m=j("<p>(<1D.+?)</p>","gi","$1");m=j("<p>s*(</?"+f+"[^>]*>)","gi","$1");m=j("(</?"+f+"[^>]*>)s*</p>","gi","$1");m=j("(</?"+f+"[^>]*>)s*<br />","gi","$1");m=j("<br />(s*</?(?:p|1D|N|dl|dd|dt|8N|2d|1A|25|2v)[^>]*>)","gi","$1");m=j("\\n</p>","gi","</p>");m=j("</1D><p>","gi","</1D>");m=j("<p>\\t?\\n?<p>","gi","<p>");m=j("</dt><p>","gi","</dt>");m=j("</dd><p>","gi","</dd>");m=j("<br></p></2s>","gi","</2s>");m=j("<p>    </p>","gi","");d.18(o,B(q,r){m=m.I("{I"+q+"}",r)});F d.2o(m)},7u:B(f){y g="3E";if(7.C.8X==="b"){g="b"}y h="em";if(7.C.8E==="i"){h="i"}f=f.I(/<O 15="3n-15: 3d;">([\\w\\W]*?)<\\/O>/gi,"<"+h+">$1</"+h+">");f=f.I(/<O 15="3n-ib: 3i;">([\\w\\W]*?)<\\/O>/gi,"<"+g+">$1</"+g+">");if(7.C.8X==="3E"){f=f.I(/<b>([\\w\\W]*?)<\\/b>/gi,"<3E>$1</3E>")}G{f=f.I(/<3E>([\\w\\W]*?)<\\/3E>/gi,"<b>$1</b>")}if(7.C.8E==="em"){f=f.I(/<i>([\\w\\W]*?)<\\/i>/gi,"<em>$1</em>")}G{f=f.I(/<em>([\\w\\W]*?)<\\/em>/gi,"<i>$1</i>")}f=f.I(/<7I>([\\w\\W]*?)<\\/7I>/gi,"<7p>$1</7p>");if(!/<O(.*?)1g-M="2Q"(.*?)>([\\w\\W]*?)<\\/O>/gi.3p(f)){f=f.I(/<O(.*?)(?!1g-M="2Q")(.*?)>([\\w\\W]*?)<\\/O>/gi,\'<O$1 1g-M="2Q"$2>$3</O>\')}F f},5M:B(h){if(h==""||1r h=="1l"){F h}y i=E;if(7.C.5s!==E){i=L}y f=i===L?7.C.5s:7.C.5Z;y g=/<\\/?([a-z][a-8p-9]*)\\b[^>]*>/gi;h=h.I(g,B(l,j){if(i===L){F d.3G(j.30(),f)>"-1"?l:""}G{F d.3G(j.30(),f)>"-1"?"":l}});h=7.7u(h);F h},8I:B(f,g){y h=f.1Q(/<(2d|5j)(.*?)>([\\w\\W]*?)<\\/(2d|5j)>/gi);if(h!==26){d.18(h,d.K(B(l,m){y j=m.1Q(/<(2d|5j)(.*?)>([\\w\\W]*?)<\\/(2d|5j)>/i);j[3]=j[3].I(/&2i;/g," ");if(g!==E){j[3]=7.8H(j[3])}f=f.I(m,"<"+j[1]+j[2]+">"+j[3]+"</"+j[1]+">")},7))}F f},8H:B(f){f=3y(f).I(/&8t;/g,"&").I(/&6e;/g,"<").I(/&gt;/g,">").I(/&bz;/g,\'"\');F 3y(f).I(/&/g,"&8t;").I(/</g,"&6e;").I(/>/g,"&gt;").I(/"/g,"&bz;")},bB:B(){y f=7.$J.V("1D, 1p, a, b, 3E, i6, i7, i, em, u, iH, 7I, 7p, O, je");f.58(\'[1g-M="2Q"]\').9h(\'[15*="3n-2h"][15*="5Y-1C"]\').T("3n-2h","").T("5Y-1C","");f.58(\'[1g-M="2Q"]\').9h(\'[15*="7x-5T: dc;"][15*="5Y-1C"]\').T("7x-5T","").T("5Y-1C","");f.58(\'[1g-M="2Q"]\').9h(\'[15*="7x-5T: dc;"]\').T("7x-5T","");f.58(\'[1g-M="2Q"]\').T("5Y-1C","");d.18(f,d.K(B(g,h){7.3C(h,"15")},7));7.$J.V(\'N[15="1d-7v: -3K-3L;"]\').1G().bi()},bM:B(g){y l=0,n=g.11,m=0,f=26,h=26,q="",j="",p="";7.5L=0;2K(;l<n;l++){m=l;if(-1==g.3l(l).3x("<")){j+=g.3l(l);F 7.9b(j)}2E(m<n&&g.4d(m)!="<"){m++}if(l!=m){p=g.3l(l,m-l);if(!p.1Q(/^\\s{2,}$/g)){if("\\n"==j.4d(j.11-1)){j+=7.56()}G{if("\\n"==p.4d(0)){j+="\\n"+7.56();p=p.I(/^\\s+/,"")}}j+=p}if(p.1Q(/\\n/)){j+="\\n"+7.56()}}f=m;2E(m<n&&">"!=g.4d(m)){m++}q=g.3l(f,m-f);l=m;y o;if("!--"==q.3l(1,3)){if(!q.1Q(/--$/)){2E("-->"!=g.3l(m,3)){m++}m+=2;q=g.3l(f,m-f);l=m}if("\\n"!=j.4d(j.11-1)){j+="\\n"}j+=7.56();j+=q+">\\n"}G{if("!"==q[1]){j=7.7A(q+">",j)}G{if("?"==q[1]){j+=q+">\\n"}G{if(o=q.1Q(/^<(2l|15|2d)/i)){o[1]=o[1].30();q=7.9a(q);j=7.7A(q,j);h=3y(g.3l(l+1)).30().3x("</"+o[1]);if(h){p=g.3l(l+1,h);l+=h;j+=p}}G{q=7.9a(q);j=7.7A(q,j)}}}}}F 7.9b(j)},56:B(){y g="";2K(y f=0;f<7.5L;f++){g+="\\t"}F g},9b:B(f){f=f.I(/\\n\\s*\\n/g,"\\n");f=f.I(/^[\\s\\n]*/,"");f=f.I(/[\\s\\n]*$/,"");f=f.I(/<2l(.*?)>\\n<\\/2l>/gi,"<2l$1><\\/2l>");7.5L=0;F f},9a:B(g){y i="";g=g.I(/\\n/g," ");g=g.I(/\\s{2,}/g," ");g=g.I(/^\\s+|\\s+$/g," ");y h="";if(g.1Q(/\\/$/)){h="/";g=g.I(/\\/+$/,"")}y f;2E(f=/\\s*([^= ]+)(?:=(([\'"\']).*?\\3|[^ ]+))?/.1M(g)){if(f[2]){i+=f[1].30()+"="+f[2]}G{if(f[1]){i+=f[1].30()}}i+=" ";g=g.3l(f[0].11)}F i.I(/\\s*$/,"")+h+">"},7A:B(f,h){y g=f.1Q(7.84);if(f.1Q(7.bG)||g){h=h.I(/\\s*$/,"");h+="\\n"}if(g&&"/"==f.4d(1)){7.5L--}if("\\n"==h.4d(h.11-1)){h+=7.56()}if(g&&"/"!=f.4d(1)){7.5L++}h+=f;if(f.1Q(7.bq)||f.1Q(7.84)){h=h.I(/ *$/,"");h+="\\n"}F h},85:B(){7.64("","jo")},7V:B(){7.64("3D","jj")},7R:B(){7.64("b8","jl")},7Y:B(){7.64("5i","j6")},64:B(g,i){7.1x();if(7.88()){7.Q.1H(i,E,E);F L}7.1B();y j=7.1V();if(!j&&7.C.1z){7.1M("5e","2s");y f=7.1V();y j=d(\'<N 1g-6a="">\').U(d(f).U());d(f).1U(j);d(j).T("1d-7v",g);7.3C(j,"15");if(g==""&&1r(d(j).1g("6a"))!=="1l"){d(j).1U(d(j).U())}}G{y h=7.2B();d.18(h,d.K(B(m,n){y l=E;if(d.3G(n.Y,7.C.4g)!==-1){l=d(n)}G{l=d(n).2A(7.C.4g.2W().30(),7.$J[0])}if(l){l.T("1d-7v",g);7.3C(l,"15")}},7))}7.1k();7.12()},b3:B(i){y f=d.2o(7.$J.U());f=f.I(/<br\\s?\\/?>/i,"");y h=f.I(/<p>\\s?<\\/p>/gi,"");if(f===""||h===""){i.2a();y g=d(7.C.4i).1S(0);7.$J.U(g);7.1s()}7.12()},3I:B(f){7.1x();y g=7.2B();7.1B();d.18(g,d.K(B(h,j){if(j.Y!=="2G"){7.5e(f,j)}},7));7.1k();7.12()},5e:B(f,i){if(i===E){i=7.1V()}if(i===E){if(7.C.1z===L){7.1H("b5",f)}F L}y h="";if(f!=="2d"){h=d(i).1G()}G{h=d(i).U();if(d.2o(h)===""){h=\'<O id="2c-1u-1"></O>\'}}if(i.Y==="4F"){f="p"}if(7.C.1z===L&&f==="p"){d(i).1U(d("<N>").Z(h).U()+"<br>")}G{y g=d("<"+f+">").Z(h);d(i).1U(g)}},dG:B(h,f,g){if(g!==E){7.1B()}y i=d("<"+f+"/>");d(h).1U(B(){F i.Z(d(7).1G())});if(g!==E){7.1k()}F i},bc:B(){7.1x();if(7.C.1z===E){7.1B();y l=7.2B();if(l){d.18(l,d.K(B(n,o){if(o.Y==="4x"){7.5e("p",o,E)}G{if(o.Y!=="2G"){7.5e("2s",o,E)}}},7))}7.1k()}G{y j=7.1V();if(j.Y==="4x"){7.1B();d(j).1U(d(j).U()+"<br>");7.1k()}G{y m=7.dH("2s");y h=d(m).U();y g=["25","2v","1j","2L","4G","2M","8f","dl"];d.18(g,B(n,o){h=h.I(1R 2F("<"+o+"(.*?)>","gi"),"");h=h.I(1R 2F("</"+o+">","gi"),"")});y f=7.C.8j;f.21("1A");d.18(f,B(n,o){h=h.I(1R 2F("<"+o+"(.*?)>","gi"),"");h=h.I(1R 2F("</"+o+">","gi"),"<br>")});d(m).U(h);7.8P(m);y i=d(m).5N();if(i.2h()!=0&&i[0].Y==="bd"){i.1m()}}}7.12()},iJ:B(f,h){y g=7.2B();d(g).24(f);7.12()},iK:B(f,h){y g=7.2B();d(g).16(f,h);7.12()},iL:B(g){y f=7.2B();d(f).T(g,"");7.3C(f,"15");7.12()},iM:B(h,g){y f=7.2B();d(f).T(h,g);7.12()},iT:B(g){y f=7.2B();d(f).2e(g);7.3C(f,"X");7.12()},iU:B(g){y f=7.2B();d(f).23(g);7.12()},j1:B(f){7.1B();7.8c(B(g){d(g).2e(f);7.3C(g,"X")});7.1k();7.12()},j2:B(f){y g=7.2D();if(!d(g).3c(f)){7.4B("23",f)}},j3:B(f){7.1B();7.8c(B(g){d(g).T(f,"");7.3C(g,"15")});7.1k();7.12()},j4:B(g,f){7.4B("T",g,f)},j0:B(f){7.1B();y h=7.2C(),i=7.5W(),g=7.57();if(h.4z||h.4H===h.5P&&i){g=d(i)}d(g).24(f);7.bk();7.1k();7.12()},iZ:B(f,g){7.4B("16",f,g)},4B:B(i,f,j){7.1x();7.1B();y g=7.2C();y h=7.5W();if(g.4z||g.4H===g.5P&&h){d(h)[i](f,j)}G{7.Q.1H("5S",E,4);y l=7.$J.V("3n");d.18(l,d.K(B(m,n){7.bm(i,n,f,j)},7))}7.1k();7.12()},bm:B(j,i,f,l){y h=d(i).1P(),g;if(h&&h[0].Y==="8s"&&h[0].iW.11!=0){g=h;d(i).1U(d(i).U())}G{g=d(\'<O 1g-M="2Q" 1g-M-4B>\').Z(d(i).1G());d(i).1U(g)}d(g)[j](f,l);F g},8c:B(j){y g=7.2C(),h=7.5W(),f=7.57(),i;if(g.4z||g.4H===g.5P&&h){f=d(h);i=L}d.18(f,d.K(B(l,m){if(!i&&m.Y!=="8s"){if(m.4e.Y==="8s"&&!d(m.4e).3c("31")){m=m.4e}G{F}}j.3t(7,m)},7))},bk:B(){y f=7.$J.V("O[1g-M-4B]");d.18(f,d.K(B(h,j){y g=d(j);if(g.16("X")===1l&&g.16("15")===1l){g.1G().bi()}},7))},iX:B(f){7.1B();7.Q.1H("5S",E,4);y h=7.$J.V("3n");y g;d.18(h,B(j,m){y l=d("<"+f+"/>").Z(d(m).1G());d(m).1U(l);g=l});7.1k();7.12()},iY:B(f){7.1B();y g=f.fW();y h=7.57();d.18(h,B(j,l){if(l.Y===g){d(l).1U(d(l).1G())}});7.1k();7.12()},7M:B(h,j){y m=7.2D();y i=m.4e;7.$J.1s();7.1x();y f=d("<N>").Z(d.8r(h));h=f.U();h=7.8a(h);f=d("<N>").Z(d.8r(h));y g=7.1V();if(f.1G().11==1){y l=f.1G()[0].Y;if(l!="P"&&l==g.Y||l=="4F"){h=f.1d();f=d("<N>").Z(h)}}if(!7.C.1z&&f.1G().11==1&&f.1G()[0].3s==3&&(7.9q().11>2||(!m||m.Y=="fv"&&!i||i.Y=="fx"))){h="<p>"+h+"</p>"}if(f.1G().11>1&&g||f.1G().is("p, :5x, 25, 2v, N, 1j, 2s, 2d, 7W, 1w, 5x, 35, fE, fz")){if(7.1J("3a")){7.Q.2c.4Y().8h(h)}G{7.Q.1H("3z",E,h)}}G{7.7j(h,E)}if(7.4O){7.2Z.2k(d.K(B(){if(!7.C.1z){7.67(7.$J.1G().fq())}G{7.fH()}},7),1)}7.5a();if(j!==E){7.12()}},7j:B(g,l){y m=7.1F();if(m.2R&&m.44){y f=m.2R(0);f.eX();y h=7.Q.3O("N");h.4y=g;y n=7.Q.b7(),j,i;2E((j=h.8v)){i=n.5d(j)}f.32(n);if(i){f=f.8D();f.fc(i);f.6K(L);m.4E();m.4Z(f)}}if(l!==E){7.12()}},iV:B(g){y f=d(d.8r(g));if(f.11){g=f.1d()}7.$J.1s();if(7.1J("3a")){7.Q.2c.4Y().8h(g)}G{7.Q.1H("3z",E,g)}7.12()},32:B(f){f=f[0]||f;y g=7.1F();if(g.2R&&g.44){4C=g.2R(0);4C.eX();4C.32(f);4C.iN(f);4C.fc(f);g.4E();g.4Z(4C)}},fs:B(j,i){y g;y f=j.fr,m=j.fl;if(7.Q.fe){y l=7.Q.fe(f,m);g=7.2C();g.6y(l.iQ,l.38);g.6K(L);g.32(i)}G{if(7.Q.fi){g=7.Q.fi(f,m);g.32(i)}G{if(1r Q.1O.fg!="1l"){g=7.Q.1O.fg();g.fk(f,m);y h=g.j5();h.fk(f,m);g.jm("jk",h);g.4U()}}}},7F:B(f){if(7.bH()){if(d(d.2o(7.$J.U())).1S(0)!=d.2o(f)&&7.$J.1G().fq()[0]!==f){F E}7.1x();if(7.C.1z===E){y g=d(7.C.4i);d(f).22(g);7.3m(g)}G{y g=d(\'<O id="2c-1u-1">\'+7.C.1Y+"</O>",7.Q)[0];d(f).22(g);d(g).22(7.C.1Y);7.1k()}}},7T:B(){7.1B();7.$J.V("#2c-1u-1").34("<br>"+(7.1J("3K")?7.C.1Y:""));7.1k()},jn:B(){7.1B();7.$J.V("#2c-1u-1").34("<br><br>"+(7.1J("3K")?7.C.1Y:""));7.1k()},f2:B(f){y g=d("<br>"+7.C.1Y);d(f).1U(g);7.3m(g)},f3:B(h){h=7.1f("js",E,h);if(7.C.f1){y g=7.Q.3O("N");h=h.I(/<br>|<\\/H[1-6]>|<\\/p>|<\\/N>/gi,"\\n");g.4y=h;h=g.9l||g.f9;h=h.I("\\n","<br>");h=7.7w(h);7.7s(h)}if(7.6d("4F")){h=7.fa(h);7.7s(h);F L}h=h.I(/<p(.*?)X="jq"([\\w\\W]*?)<\\/p>/gi,"<25><p$2</p>");h=h.I(/<p(.*?)X="jp"([\\w\\W]*?)<\\/p>/gi,"<p$2</p></25>");h=h.I(/<!--[\\s\\S]*?-->|<\\?(?:3u)?[\\s\\S]*?\\?>/gi,"");h=h.I(/(&2i;){2,}/gi,"&2i;");h=h.I(/&2i;/gi," ");h=h.I(/<b\\ja="eZ-1h-1u(.*?)">([\\w\\W]*?)<\\/b>/gi,"$2");h=h.I(/<b(.*?)id="j8-eZ-j7(.*?)">([\\w\\W]*?)<\\/b>/gi,"$3");h=7.5M(h);h=h.I(/<1A><\\/1A>/gi,"[1A]");h=h.I(/<1A>&2i;<\\/1A>/gi,"[1A]");h=h.I(/<1A><br><\\/1A>/gi,"[1A]");h=h.I(/<a(.*?)1N="(.*?)"(.*?)>([\\w\\W]*?)<\\/a>/gi,\'[a 1N="$2"]$4[/a]\');h=h.I(/<1n(.*?)>([\\w\\W]*?)<\\/1n>/gi,"[1n$1]$2[/1n]");h=h.I(/<2N(.*?)>([\\w\\W]*?)<\\/2N>/gi,"[2N$1]$2[/2N]");h=h.I(/<43(.*?)>([\\w\\W]*?)<\\/43>/gi,"[43$1]$2[/43]");h=h.I(/<3w(.*?)>([\\w\\W]*?)<\\/3w>/gi,"[3w$1]$2[/3w]");h=h.I(/<2I(.*?)>([\\w\\W]*?)<\\/2I>/gi,"[2I$1]$2[/2I]");h=h.I(/<5f(.*?)>/gi,"[5f$1]");h=h.I(/<1p(.*?)15="(.*?)"(.*?)>/gi,"[1p$1$3]");h=h.I(/<1p(.*?)>/gi,"[1p$1]");h=h.I(/ X="(.*?)"/gi,"");h=h.I(/<(\\w+)([\\w\\W]*?)>/gi,"<$1>");h=h.I(/<[^\\/>][^>]*>(\\s*|\\t*|\\n*|&2i;|<br>)<\\/[^>]+>/gi,"");h=h.I(/<N>\\s*?\\t*?\\n*?(<25>|<2v>|<p>)/gi,"$1");h=h.I(/\\[1A\\]/gi,"<1A>&2i;</1A>");h=h.I(/\\[a 1N="(.*?)"\\]([\\w\\W]*?)\\[\\/a\\]/gi,\'<a 1N="$1">$2</a>\');h=h.I(/\\[1n(.*?)\\]([\\w\\W]*?)\\[\\/1n\\]/gi,"<1n$1>$2</1n>");h=h.I(/\\[2N(.*?)\\]([\\w\\W]*?)\\[\\/2N\\]/gi,"<2N$1>$2</2N>");h=h.I(/\\[43(.*?)\\]([\\w\\W]*?)\\[\\/43\\]/gi,"<43$1>$2</43>");h=h.I(/\\[3w(.*?)\\]([\\w\\W]*?)\\[\\/3w\\]/gi,"<3w$1>$2</3w>");h=h.I(/\\[2I(.*?)\\]([\\w\\W]*?)\\[\\/2I\\]/gi,"<2I$1>$2</2I>");h=h.I(/\\[5f(.*?)\\]/gi,"<5f$1>");h=h.I(/\\[1p(.*?)\\]/gi,"<1p$1>");if(7.C.9o){h=h.I(/<N(.*?)>([\\w\\W]*?)<\\/N>/gi,"<p>$2</p>");h=h.I(/<\\/N><p>/gi,"<p>");h=h.I(/<\\/p><\\/N>/gi,"</p>")}if(7.6d("2G")){h=h.I(/<p>([\\w\\W]*?)<\\/p>/gi,"$1<br>")}G{h=7.7w(h)}h=h.I(/<O(.*?)>([\\w\\W]*?)<\\/O>/gi,"$2");h=h.I(/<1p>/gi,"");h=h.I(/<[^\\/>][^>][^1p|5f|1h]*>(\\s*|\\t*|\\n*|&2i;|<br>)<\\/[^>]+>/gi,"");h=h.I(/\\n{3,}/gi,"\\n");h=h.I(/<p><p>/gi,"<p>");h=h.I(/<\\/p><\\/p>/gi,"</p>");h=h.I(/<1D>(\\s*|\\t*|\\n*)<p>/gi,"<1D>");h=h.I(/<\\/p>(\\s*|\\t*|\\n*)<\\/1D>/gi,"</1D>");if(7.C.1z===L){h=h.I(/<p(.*?)>([\\w\\W]*?)<\\/p>/gi,"$2<br>")}h=h.I(/<[^\\/>][^>][^1p|5f|1h]*>(\\s*|\\t*|\\n*|&2i;|<br>)<\\/[^>]+>/gi,"");h=h.I(/<1p 2q="3K-jd-2S\\:\\/\\/(.*?)"(.*?)>/gi,"");7.8K=E;if(7.1J("3Q")){if(7.C.7L){y i=h.1Q(/<1p 2q="1g:1b(.*?)"(.*?)>/gi);if(i!==26){7.8K=i;2K(k in i){y f=i[k].I("<1p",\'<1p 1g-3Q-7J-1b="\'+k+\'" \');h=h.I(i[k],f)}}}2E(/<br>$/gi.3p(h)){h=h.I(/<br>$/gi,"")}}h=h.I(/<p>•([\\w\\W]*?)<\\/p>/gi,"<1D>$1</1D>");2E(/<3n>([\\w\\W]*?)<\\/3n>/gi.3p(h)){h=h.I(/<3n>([\\w\\W]*?)<\\/3n>/gi,"$1")}7.7s(h)},fa:B(g){g=g.I(/<br>|<\\/H[1-6]>|<\\/p>|<\\/N>/gi,"\\n");y f=7.Q.3O("N");f.4y=g;F 7.8H(f.9l||f.f9)},7s:B(f){if(7.4O){if(!7.C.1z){7.$J.U(7.C.4i)}G{7.$J.U("")}7.$J.1s()}f=7.1f("ig",E,f);7.7M(f);7.4O=E;2k(d.K(B(){a=E;if(7.8K!==E){7.f7()}},7),2x);if(7.C.4f){d(7.Q.1O).3H(7.7t)}G{7.$J.3H(7.7t)}},f7:B(){y f=7.$J.V("1p[1g-3Q-7J-1b]");d.18(f,d.K(B(j,l){y h=d(l);y g=l.2q.3k(",");y m=g[1];y n=g[0].3k(";")[0].3k(":")[1];d.4R(7.C.8T,{6s:n,1g:m},d.K(B(o){y i=d.6i(o);h.16("2q",i.4N);h.24("1g-3Q-7J-1b");7.12();7.1f("3b",h,i)},7))},7))},ft:B(i){y g=i.1I.ie;y f=g.3k(",");y h=f[1];y j=f[0].3k(";")[0].3k(":")[1];if(7.C.7L){d.4R(7.C.8T,{6s:j,1g:h},d.K(B(n){y m=d.6i(n);y l=\'<1p 2q="\'+m.4N+\'" id="fI-1b-1u" />\';7.1H("3z",l,E);y o=d(7.$J.V("1p#fI-1b-1u"));if(o.11){o.24("id")}G{o=E}7.12();if(o){7.1f("3b",o,m)}},7))}G{7.7M(\'<1p 2q="\'+g+\'" />\')}},1x:B(f){if(f!==1l){7.C.42.21(f)}G{7.1B();7.C.42.21(7.$J.U());7.8B("42")}},fB:B(){if(7.C.42.11===0){7.$J.1s();F}7.1B();7.C.68.21(7.$J.U());7.1k(E,L);7.$J.U(7.C.42.eV());7.1k();2k(d.K(7.5a,7),2x)},fw:B(){if(7.C.68.11===0){7.$J.1s();F E}7.1B();7.C.42.21(7.$J.U());7.1k(E,L);7.$J.U(7.C.68.eV());7.1k(L);2k(d.K(7.5a,7),4)},5a:B(){7.3r();7.dP()},dP:B(){7.$J.V("1j").1i("1L",d.K(7.97,7))},3r:B(){if(7.C.3r===E){F E}7.$J.V("1p").18(d.K(B(f,g){if(7.1J("3a")){d(g).16("ix","1i")}7.eh(g)},7))},1F:B(){if(!7.C.2J){F 7.Q.1F()}G{if(!7.C.1n){F 2J.1F()}G{F 2J.1F(7.$2f[0])}}},2C:B(){if(!7.C.2J){if(7.Q.1F){y f=7.Q.1F();if(f.2R&&f.44){F f.2R(0)}}F 7.Q.4Y()}G{if(!7.C.1n){F 2J.4Y()}G{F 2J.4Y(7.8Q())}}},8P:B(f){7.dS(f)},3m:B(f){7.5X(f[0]||f,0,26,0)},67:B(f){7.5X(f[0]||f,1,26,1)},5X:B(m,l,j,h){if(j==26){j=m}if(h==26){h=l}y g=7.1F();if(!g){F}y f=7.2C();f.6y(m,l);f.6D(j,h);9k{g.4E()}9j(i){}g.4Z(f)},dH:B(f){f=f.30();y i=7.1V();if(i){y j=7.dG(i,f);7.12();F j}y h=7.1F();y g=h.2R(0);y j=Q.3O(f);j.5d(g.iv());g.32(j);7.8P(j);F j},im:B(){y f=7.2C();f.6x(7.$J[0]);y g=7.1F();g.4E();g.4Z(f)},dK:B(){7.1F().4E()},bE:B(i){y f=0;y h=7.2C();y g=h.8D();g.6x(i);g.6D(h.5P,h.dR);f=d.2o(g.2W()).11;F f},bK:B(){F 1R e(7.1F().2R(0))},dS:B(j,g,n){if(1r n==="1l"){n=g}j=j[0]||j;y p=7.2C();p.6x(j);y q=7.8M(j);y m=E;y f=0,r;if(q.11==1&&g){p.6y(q[0],g);p.6D(q[0],n)}G{2K(y o=0,l;l=q[o++];){r=f+l.11;if(!m&&g>=f&&(g<r||(g==r&&o<q.11))){p.6y(l,g-f);m=L}if(m&&n<=r){p.6D(l,n-f);6c}f=r}}y h=7.1F();h.4E();h.4Z(p)},8M:B(l){y j=[];if(l.3s==3){j.21(l)}G{y h=l.9e;2K(y g=0,f=h.11;g<f;++g){j.21.e1(j,7.8M(h[g]))}}F j},1B:B(){if(!7.7z()){7.$J.1s()}if(!7.C.2J){7.e2(7.2C())}G{7.4c=2J.ip()}},e2:B(i,f){if(!i){F}y h=d(\'<O id="2c-1u-1" X="M-2c-1u">\'+7.C.1Y+"</O>",7.Q)[0];y g=d(\'<O id="2c-1u-2" X="M-2c-1u">\'+7.C.1Y+"</O>",7.Q)[0];if(i.4z===L){7.6J(i,h,L)}G{7.6J(i,h,L);7.6J(i,g,E)}7.4c=7.$J.U();7.1k(E,E)},6J:B(f,h,g){y i=f.8D();i.6K(g);i.32(h);i.iu()},1k:B(i,f){if(!7.C.2J){if(i===L&&7.4c){7.$J.U(7.4c)}y h=7.$J.V("O#2c-1u-1");y g=7.$J.V("O#2c-1u-2");if(7.1J("3Q")){7.$J.1s()}G{if(!7.7z()){7.$J.1s()}}if(h.11!=0&&g.11!=0){7.5X(h[0],0,g[0],0)}G{if(h.11!=0){7.5X(h[0],0,26,0)}}if(f!==E){7.8B();7.4c=E}}G{2J.it(7.4c)}},8B:B(f){if(!7.C.2J){d.18(7.$J.V("O.M-2c-1u"),B(){y g=d.2o(d(7).U().I(/[^\\eW-~]/g,""));if(g==""){d(7).1m()}G{d(7).24("X").24("id")}})}G{2J.ir(7.4c)}},2D:B(){y f=E;y g=7.1F();if(g.44>0){f=g.2R(0).4H}F 7.7o(f)},3F:B(f){f=f||7.2D();if(f){F 7.7o(d(f).1P()[0])}G{F E}},1V:B(f){if(1r f==="1l"){f=7.2D()}2E(f){if(7.6L(f)){if(d(f).3c("31")){F E}F f}f=f.4e}F E},2B:B(g){y h=[];if(1r g=="1l"){y f=7.2C();if(f&&f.4z===L){F[7.1V()]}y g=7.57(f)}d.18(g,d.K(B(j,l){if(7.C.1n===E&&d(l).83("N.31").2h()==0){F E}if(7.6L(l)){h.21(l)}},7));if(h.11===0){h=[7.1V()]}F h},6L:B(f){F f.3s==1&&7.8Z.3p(f.kr)},9m:B(f){F 7.8Z.3p(f)},dk:B(j){if(1r j=="1l"||j==E){y j=7.2C()}if(j&&j.4z===L){F[7.2D()]}y f=7.1F();9k{y p=f.2R(0).eG()}9j(n){F(E)}y l=7.Q.3O("O");l.5d(p);2Z.9i=l.9e;y m=9i.11;y g=[];2K(y h=0,o=m;h<o;h++){g.21(9i[h])}if(g.11==0){g.21(7.2D())}F g},57:B(h,f){if(7.C.1z){F 7.dk(h)}if(1r h=="1l"||h==E){y h=7.2C()}if(h&&h.4z===L){if(1r f==="1l"&&7.9m(f)){y l=7.1V();if(l.Y==f){F[l]}G{F[]}}G{F[7.2D()]}}y g=[],j=[];y i=7.Q.1F();if(!i.kv){g=7.9q(i.2R(0))}d.18(g,d.K(B(m,n){if(7.C.1n===E&&d(n).83("N.31").2h()==0){F E}if(1r f==="1l"){if(d.2o(n.9l)!=""){j.21(n)}}G{if(n.Y==f){j.21(n)}}},7));if(j.11==0){if(1r f==="1l"&&7.9m(f)){y l=7.1V();if(l.Y==f){F j.21(l)}G{F[]}}G{j.21(7.2D())}}F j},5W:B(f){if(!f){f=7.2D()}2E(f){if(f.3s==1){if(d(f).3c("31")){F E}F f}f=f.4e}F E},9q:B(g){g=g||7.2C();y h=g.4H;y f=g.5P;if(h==f){F[h]}y i=[];2E(h&&h!=f){i.21(h=7.dq(h))}h=g.4H;2E(h&&h!=g.ky){i.di(h);h=h.4e}F i},dq:B(f){if(f.kx()){F f.8v}G{2E(f&&!f.dB){f=f.4e}if(!f){F 26}F f.dB}},dC:B(){F 7.1F().2W()},kk:B(){y j="";y l=7.1F();if(l.44){y g=7.Q.3O("N");y f=l.44;2K(y h=0;h<f;++h){g.5d(l.2R(h).eG())}j=g.4y}F 7.95(j)},eH:B(){7.1B();7.4J(7.C.1a.1j,7.C.fG,kP,d.K(B(){d("#fb").1L(d.K(7.eI,7));2k(B(){d("#am").1s()},3Z)},7))},eI:B(){y s=d("#am").1e(),g=d("#f8").1e(),o=d("<N></N>"),f=39.de(39.dD()*dy),q=d(\'<1j id="1j\'+f+\'"><4G></4G></1j>\'),h,m,n,p;2K(h=0;h<s;h++){m=d("<2L></2L>");2K(n=0;n<g;n++){p=d("<1A>"+7.C.1Y+"</1A>");if(h===0&&n===0){p.Z(\'<O id="2c-1u-1">\'+7.C.1Y+"</O>")}d(m).Z(p)}q.Z(m)}o.Z(q);y j=o.U();7.2j();7.1k();y l=7.1V()||7.2D();if(l){d(l).22(j)}G{7.7j(j,E)}7.1k();y r=7.$J.V("#1j"+f);7.97(r);7.5O();r.V("O#2c-1u-1").1m();r.24("id");7.12()},97:B(f){7.$1j=d(f.1I||f).2A("1j");7.$4G=d(f.1I).2A("4G");7.$2M=7.$1j.V("2M");7.$81=d(f.1I||7.$1j.V("1A").7b());7.$3v=d(f.1I||7.$1j.V("2L").7b()).2A("2L")},eE:B(){7.1x();if(!7.$1j){F}7.$1j.1m();7.$1j=E;7.12()},eD:B(){7.1x();if(!7.$3v){F}y f=7.$3v.7d().11?7.$3v.7d():7.$3v.5N();if(f.11){y g=f.6M("1A").7b();if(g.11){g.4W(\'<O id="2c-1u-1">\'+7.C.1Y+"</O>");7.1k()}}7.$3v.1m();7.12()},ez:B(){7.1x();y f=7.$81.1S(0).kU;7.$1j.V("2L").18(d.K(B(g,h){y j=f-1<0?f+1:f-1;if(g===0){d(h).V("1A").eq(j).4W(\'<O id="2c-1u-1">\'+7.C.1Y+"</O>");7.1k()}d(h).V("1A").eq(f).1m()},7));7.12()},eA:B(){7.1x();if(7.$1j.V("2M").2h()!==0){7.9c()}G{y f=7.$1j.V("2L").7b().4K();f.V("1A").U(7.C.1Y);7.$2M=d("<2M></2M>");7.$2M.Z(f);7.$1j.4W(7.$2M);7.12()}},9c:B(){7.1x();d(7.$2M).1m();7.$2M=E;7.12()},eC:B(){7.9r("34")},eJ:B(){7.9r("22")},eK:B(){7.8m("34")},eR:B(){7.8m("22")},9r:B(f){7.1x();y g=7.$3v.4K();g.V("1A").U(7.C.1Y);if(f==="22"){7.$3v.22(g)}G{7.$3v.34(g)}7.12()},8m:B(g){7.1x();y f=0;7.$3v.V("1A").18(d.K(B(h,j){if(d(j)[0]===7.$81[0]){f=h}},7));7.$1j.V("2L").18(d.K(B(h,l){y j=d(l).V("1A").eq(f);y m=j.4K();m.U(7.C.1Y);g==="22"?j.22(m):j.34(m)},7));7.12()},eL:B(){7.1B();7.4J(7.C.1a.2N,7.C.f5,jK,d.K(B(){d("#f0").1L(d.K(7.eN,7));2k(B(){d("#9A").1s()},3Z)},7))},eN:B(){y f=d("#9A").1e();f=7.5M(f);7.1k();y g=7.1V()||7.2D();if(g){d(g).22(f)}G{7.7j(f,E)}7.12();7.2j()},eO:B(){7.1B();y f=d.K(B(){7.5v=E;y h=7.1F();y g="",o="",j="";y i=7.3F();y l=d(i).1P().1S(0);if(l&&l.Y==="A"){i=l}if(i&&i.Y==="A"){g=i.1N;o=d(i).1d();j=i.1I;7.5v=i}G{o=h.2W()}d(".6w").1e(o);y q=ex.ew.1N.I(/\\/$/i,"");y n=g.I(q,"");if(7.C.5Q===E){y p=1R 2F("^(8x|8S|6B)://"+ex.ew.jI,"i");n=n.I(p,"")}y m=d("#3M").V("a");if(7.C.7X===E){m.eq(1).1m()}if(7.C.7Q===E){m.eq(2).1m()}if(7.C.7X===E&&7.C.7Q===E){d("#3M").1m();d("#69").1e(n)}G{if(g.3W("6h:")===0){7.ah.3t(7,2);d("#5K").1e(2);d("#ay").1e(g.I("6h:",""))}G{if(n.3W(/^#/gi)===0){7.ah.3t(7,3);d("#5K").1e(3);d("#aI").1e(n.I(/^#/gi,""))}G{d("#69").1e(n)}}}if(j==="5l"){d("#4V").6X("6V",L)}d("#fy").1L(d.K(7.ec,7));2k(B(){d("#69").1s()},3Z)},7);7.4J(7.C.1a.2z,7.C.dM,jH,f)},ec:B(){y j=d("#5K").1e();y h="",n="",l="",m="";if(j==="1"){h=d("#69").1e();n=d("#dO").1e();if(d("#4V").6X("6V")){l=\' 1I="5l"\';m="5l"}y i="((jP--)?[a-8p-9]+(-[a-8p-9]+)*.)+[a-z]{2,}";y g=1R 2F("^(8x|8S|6B)://"+i,"i");y f=1R 2F("^"+i,"i");if(h.3W(g)==-1&&h.3W(f)==0&&7.C.5Q){h=7.C.5Q+h}}G{if(j==="2"){h="6h:"+d("#ay").1e();n=d("#fF").1e()}G{if(j==="3"){h="#"+d("#aI").1e();n=d("#fJ").1e()}}}7.e6(\'<a 1N="\'+h+\'"\'+l+">"+n+"</a>",d.2o(n),h,m)},e6:B(f,i,g,h){7.1k();if(i!==""){if(7.5v){7.1x();d(7.5v).1d(i).16("1N",g);if(h!==""){d(7.5v).16("1I",h)}G{d(7.5v).24("1I")}7.12()}G{7.1M("3z",f)}}7.2j()},e8:B(){7.1B();y f=d.K(B(){y g=7.1F();y h="";if(7.88()){h=g.1d}G{h=g.2W()}d("#9u").1e(h);if(!7.4b()){7.8g("#45",{2S:7.C.5R,36:7.C.36,2O:d.K(7.8u,7),33:d.K(B(j,i){7.1f("e9",i)},7)})}7.a0("45",{3L:L,2S:7.C.5R,2O:d.K(7.8u,7),33:d.K(B(j,i){7.1f("e9",i)},7)})},7);7.4J(7.C.1a.2U,7.C.dp,jE,f)},8u:B(g){7.1k();if(g!==E){y i=d("#9u").1e();if(i===""){i=g.a2}y h=\'<a 1N="\'+g.4N+\'" id="4N-1u">\'+i+"</a>";if(7.1J("3K")&&!!7.2Z.8b){h=h+"&2i;"}7.1H("3z",h,E);y f=d(7.$J.V("a#4N-1u"));if(f.2h()!=0){f.24("id")}G{f=E}7.12();7.1f("5R",f,g)}7.2j()},et:B(){7.1B();y f=d.K(B(){if(7.C.5V){d.k6(7.C.5V,d.K(B(m){y i={},l=0;d.18(m,d.K(B(o,p){if(1r p.6O!=="1l"){l++;i[p.6O]=l}},7));y j=E;d.18(m,d.K(B(r,s){y q="";if(1r s.R!=="1l"){q=s.R}y o=0;if(!d.eu(i)&&1r s.6O!=="1l"){o=i[s.6O];if(j===E){j=".5p"+o}}y p=d(\'<1p 2q="\'+s.k4+\'" X="5p 5p\'+o+\'" 2V="\'+s.1b+\'" R="\'+q+\'" />\');d("#a1").Z(p);d(p).1L(d.K(7.du,7))},7));if(!d.eu(i)){d(".5p").1T();d(j).1K();y n=B(o){d(".5p").1T();d(".5p"+d(o.1I).1e()).1K()};y h=d(\'<4U id="k7">\');d.18(i,B(p,o){h.Z(d(\'<3j 2T="\'+o+\'">\'+p+"</3j>"))});d("#a1").34(h);h.6n(n)}},7))}G{d("#3M").V("a").eq(1).1m()}if(7.C.3b||7.C.6g){if(!7.4b()&&7.C.6g===E){if(d("#45").11){7.8g("#45",{2S:7.C.3b,36:7.C.36,2O:d.K(7.9U,7),33:d.K(B(i,h){7.1f("8l",h)},7)})}}if(7.C.6g===E){7.a0("45",{3L:L,2S:7.C.3b,2O:d.K(7.9U,7),33:d.K(B(i,h){7.1f("8l",h)},7)})}G{d("#45").1i("6n.M",d.K(7.fm,7))}}G{d(".3f").1T();if(!7.C.5V){d("#3M").1m();d("#aG").1K()}G{y g=d("#3M").V("a");g.eq(0).1m();g.eq(1).23("4k");d("#aC").1K()}}d("#dL").1L(d.K(7.dz,7));if(!7.C.3b&&!7.C.5V){2k(B(){d("#4D").1s()},3Z)}},7);7.4J(7.C.1a.1b,7.C.e0,kb,f)},eS:B(h){y f=h;y g=f.1P().1P();y i=d.K(B(){d("#9E").1e(f.16("9R"));d("#fU").16("1N",f.16("2q"));d("#9Z").1e(f.T("4r"));if(d(g).1S(0).Y==="A"){d("#4D").1e(d(g).16("1N"));if(d(g).16("1I")=="5l"){d("#4V").6X("6V",L)}}d("#dV").1L(d.K(B(){7.aw(f)},7));d("#dX").1L(d.K(B(){7.ep(f)},7))},7);7.4J(7.C.1a.1b,7.C.do,g0,i)},aw:B(g){y f=d(g).1P();d(g).1m();if(f.11&&f[0].Y==="P"){7.$J.1s();7.3m(f)}7.1f("g6",g);7.2j();7.12()},ep:B(i){y g=d(i);y h=g.1P();g.16("9R",d("#9E").1e());y n=d("#9Z").1e();if(n==="1t"){g.T({"4r":"1t",1Z:"0 5g 5g 0"})}G{if(n==="3D"){g.T({"4r":"3D",1Z:"0 0 5g 5g"})}G{y l=g.2A("#M-1b-1E");if(l.2h()!=0){l.T({"4r":"",1Z:""})}g.T({"4r":"",1Z:""})}}y j=d.2o(d("#4D").1e());if(j!==""){y m=E;if(d("#4V").6X("6V")){m=L}if(h.1S(0).Y!=="A"){y f=d(\'<a 1N="\'+j+\'">\'+7.5h(i)+"</a>");if(m){f.16("1I","5l")}g.1U(f)}G{h.16("1N",j);if(m){h.16("1I","5l")}G{h.24("1I")}}}G{if(h.1S(0).Y==="A"){h.1U(7.5h(i))}}7.2j();7.3r();7.12()},5k:B(h){if(h!==E&&d(h.1I).1P().2h()!=0&&d(h.1I).1P()[0].id==="M-1b-1E"){F E}y f=7.$J.V("#M-1b-1E");if(f.2h()==0){F E}7.$J.V("#M-1b-aF, #M-1b-9J").1m();y g=f.T("1Z");if(g!="eP"){f.V("1p").T("1Z",g);f.T("1Z","")}f.V("1p").T("eQ","");f.1U(B(){F d(7).1G()});d(Q).2H("1L.M-1b-5U-1T");7.$J.2H("1L.M-1b-5U-1T");7.$J.2H("4q.M-1b-aj");7.12()},eh:B(g){y f=d(g);f.1i("ar",d.K(B(){7.5k(E)},7));f.1i("gc",d.K(B(){7.$J.1i("5r.M-1b-eg-5r",d.K(B(){2k(d.K(B(){7.3r();7.$J.2H("5r.M-1b-eg-5r");7.12()},7),1)},7))},7));f.1i("1L",d.K(B(l){if(7.$J.V("#M-1b-1E").2h()!=0){F E}y n=E,q,p,m=f.2r()/f.1C(),o=20,j=10;y h=7.ee(f);y i=E;h.1i("ar",B(r){i=L;r.2a();m=f.2r()/f.1C();q=39.4t(r.ad-f.eq(0).38().1t);p=39.4t(r.ab-f.eq(0).38().1W)});d(7.Q.1O).1i("e5",d.K(B(v){if(i){y s=39.4t(v.ad-f.eq(0).38().1t)-q;y r=39.4t(v.ab-f.eq(0).38().1W)-p;y u=f.1C();y w=7O(u,10)+r;y t=39.4t(w*m);if(t>o){f.2r(t);if(t<2x){7.4j.T({7B:"-6r",7G:"-gv",5S:"gp",9G:"go eF"})}G{7.4j.T({7B:"-7h",7G:"-eT",5S:"7h",9G:"6r 5g"})}}q=39.4t(v.ad-f.eq(0).38().1t);p=39.4t(v.ab-f.eq(0).38().1W);7.12()}},7)).1i("6Z",B(){i=E});7.$J.1i("4q.M-1b-aj",d.K(B(s){y r=s.6U;if(7.2n.6T==r||7.2n.ai==r){7.5k(E);7.aw(f)}},7));d(Q).1i("1L.M-1b-5U-1T",d.K(7.5k,7));7.$J.1i("1L.M-1b-5U-1T",d.K(7.5k,7))},7))},ee:B(g){y h=d(\'<O id="M-1b-1E" 1g-M="2Q">\');h.T({2u:"ed",2p:"gB-fO",9v:0,fM:"e4 fR fS(0, 0, 0, .6)","4r":g.T("4r")});h.16("2X",E);y i=g.T("1Z");if(i!="eP"){h.T("1Z",i);g.T("1Z","")}g.T("eQ",0.5).22(h);7.4j=d(\'<O id="M-1b-aF" 1g-M="2Q">\'+7.C.1a.eU+"</O>");7.4j.T({2u:"6j",9w:2,1W:"50%",1t:"50%",7B:"-7h",7G:"-eT",9v:1,dx:"#dw",5T:"#e3",5S:"7h",9G:"6r 5g",9S:"fY"});7.4j.16("2X",E);7.4j.1i("1L",d.K(B(){7.eS(g)},7));h.Z(7.4j);y f=d(\'<O id="M-1b-9J" 1g-M="2Q"></O>\');f.T({2u:"6j",9w:2,9v:1,9S:"ht-5U",hj:"-ho",3D:"-eF",hA:"e4 hL #e3",dx:"#dw",2r:"dv",1C:"dv"});f.16("2X",E);h.Z(f);h.Z(g);F f},du:B(g){y f=\'<1p id="1b-1u" 2q="\'+d(g.1I).16("2V")+\'" 9R="\'+d(g.1I).16("R")+\'" />\';if(7.C.4w){f="<p>"+f+"</p>"}7.7l(f,L)},dz:B(){y g=d("#4D").1e();if(g!==""){y f=\'<1p id="1b-1u" 2q="\'+g+\'" />\';if(7.C.1z===E){f="<p>"+f+"</p>"}7.7l(f,L)}G{7.2j()}},9U:B(f){7.7l(f)},7l:B(g,h){7.1k();if(g!==E){y f="";if(h!==L){f=\'<1p id="1b-1u" 2q="\'+g.4N+\'" />\';if(7.C.4w){f="<p>"+f+"</p>"}}G{f=g}7.1H("3z",f,E);y i=d(7.$J.V("1p#1b-1u"));if(i.11){i.24("id")}G{i=E}7.12();h!==L&&7.1f("3b",i,g)}7.2j();7.3r()},dj:B(){d.3S(7.C,{dp:3y()+\'<1w><N id="M-1X" X="M-1X M-1X-a5" 15="2p: 28;"><N id="M-1X-4S" X="M-1X-4S" 15="2r: 2x%;"></N></N><1y id="gS" 5m="4R" 4A="" 70="6P/1y-1g"><1q>\'+7.C.1a.a2+\'</1q><1v 1o="1d" id="9u" X="3q" /><N 15="1Z-1W: 6r;"><1v 1o="2U" id="45" 2m="2U" /></N></1y></1w>\',do:3y()+"<1w><1q>"+7.C.1a.R+\'</1q><1v id="9E" X="3q" /><1q>\'+7.C.1a.2z+\'</1q><1v id="4D" X="3q" /><1q><1v 1o="dN" id="4V"> \'+7.C.1a.aD+"</1q><1q>"+7.C.1a.dF+\'</1q><4U id="9Z"><3j 2T="28">\'+7.C.1a.28+\'</3j><3j 2T="1t">\'+7.C.1a.1t+\'</3j><3j 2T="3D">\'+7.C.1a.3D+\'</3j></4U></1w><35><2g id="dV" X="3h">\'+7.C.1a.dU+\'</2g>&2i;&2i;&2i;<2g X="3h 4T">\'+7.C.1a.4X+\'</2g><1v 1o="2g" 2m="9Y" X="3h" id="dX" 2T="\'+7.C.1a.9Y+\'" /></35>\',e0:3y()+\'<1w><N id="3M"><a 1N="#" X="4k">\'+7.C.1a.4I+\'</a><a 1N="#">\'+7.C.1a.a6+\'</a><a 1N="#">\'+7.C.1a.2z+\'</a></N><N id="M-1X" X="M-1X M-1X-a5" 15="2p: 28;"><N id="M-1X-4S" X="M-1X-4S" 15="2r: 2x%;"></N></N><1y id="gJ" 5m="4R" 4A="" 70="6P/1y-1g"><N id="dQ" X="3f"><1v 1o="2U" id="45" 2m="2U" /></N><N id="aC" X="3f" 15="2p: 28;"><N id="a1"></N></N></1y><N id="aG" X="3f" 15="2p: 28;"><1q>\'+7.C.1a.dJ+\'</1q><1v 1o="1d" 2m="4D" id="4D" X="3q"  /></N></1w><35><2g X="3h 4T">\'+7.C.1a.4X+\'</2g><1v 1o="2g" 2m="4I" X="3h" id="dL" 2T="\'+7.C.1a.63+\'" /></35>\',dM:3y()+\'<1w><1y id="hf" 5m="4R" 4A=""><N id="3M"><a 1N="#" X="4k">9z</a><a 1N="#">aB</a><a 1N="#">\'+7.C.1a.aH+\'</a></N><1v 1o="7k" id="5K" 2T="1" /><N X="3f" id="dQ"><1q>9z</1q><1v 1o="1d" id="69" X="3q"  /><1q>\'+7.C.1a.1d+\'</1q><1v 1o="1d" X="3q 6w" id="dO" /><1q><1v 1o="dN" id="4V"> \'+7.C.1a.aD+\'</1q></N><N X="3f" id="aC" 15="2p: 28;"><1q>aB</1q><1v 1o="1d" id="ay" X="3q" /><1q>\'+7.C.1a.1d+\'</1q><1v 1o="1d" X="3q 6w" id="fF" /></N><N X="3f" id="aG" 15="2p: 28;"><1q>\'+7.C.1a.aH+\'</1q><1v 1o="1d" X="3q" id="aI"  /><1q>\'+7.C.1a.1d+\'</1q><1v 1o="1d" X="3q 6w" id="fJ" /></N></1y></1w><35><2g X="3h 4T">\'+7.C.1a.4X+\'</2g><1v 1o="2g" X="3h" id="fy" 2T="\'+7.C.1a.63+\'" /></35>\',fG:3y()+"<1w><1q>"+7.C.1a.fD+\'</1q><1v 1o="1d" 2h="5" 2T="2" id="am" /><1q>\'+7.C.1a.fC+\'</1q><1v 1o="1d" 2h="5" 2T="3" id="f8" /></1w><35><2g X="3h 4T">\'+7.C.1a.4X+\'</2g><1v 1o="2g" 2m="4I" X="3h" id="fb" 2T="\'+7.C.1a.63+\'" /></35>\',f5:3y()+\'<1w><1y id="gP"><1q>\'+7.C.1a.fu+\'</1q><5t id="9A" 15="2r: 99%; 1C: hg;"></5t></1y></1w><35><2g X="3h 4T">\'+7.C.1a.4X+\'</2g><1v 1o="2g" X="3h" id="f0" 2T="\'+7.C.1a.63+\'" /></35>\'})},4J:B(m,i,g,n){y f=d("#9L");if(!f.11){7.$ff=f=d(\'<N id="9L" 15="2p: 28;"></N>\');d("1O").4W(7.$ff)}if(7.C.9K){f.1K().1i("1L",d.K(7.2j,7))}y j=d("#9y");if(!j.11){7.$fh=j=d(\'<N id="9y" 15="2p: 28;"><N id="9B">&hw;</N><5x id="7q"></5x><N id="7D"></N></N>\');d("1O").Z(7.$fh)}d("#9B").1i("1L",d.K(7.2j,7));7.5A=d.K(B(o){if(o.2n===7.2n.9T){7.2j();F E}},7);d(Q).3B(7.5A);7.$J.3B(7.5A);7.4u=E;if(i.3x("#")==0){7.4u=d(i);d("#7D").7n().Z(7.4u.U());7.4u.U("")}G{d("#7D").7n().Z(i)}j.V("#7q").U(m);if(1r d.fn.fd!=="1l"){j.fd({gm:"#7q"});j.V("#7q").T("9S","gs")}y l=d("#3M");if(l.11){y h=7;l.V("a").18(B(o,p){o++;d(p).1i("1L",B(r){r.2a();l.V("a").2e("4k");d(7).23("4k");d(".3f").1T();d("#3f"+o).1K();d("#5K").1e(o);if(h.4b()===E){y q=j.er();j.T("1Z-1W","-"+(q+10)/2+"2y")}})})}j.V(".4T").1i("1L",d.K(7.2j,7));if(7.C.4f===L){7.aQ=7.Q.1O.3H}if(7.4b()===E){j.T({2u:"7C",1W:"-aa",1t:"50%",2r:g+"2y",7G:"-"+(g+60)/2+"2y"}).1K();7.aO=d(Q.1O).T("aP");d(Q.1O).T("aP","7k")}G{j.T({2u:"7C",2r:"2x%",1C:"2x%",1W:"0",1t:"0",1Z:"0",5H:"gq"}).1K()}if(1r n==="B"){n()}if(7.4b()===E){2k(B(){y o=j.er();j.T({1W:"50%",1C:"3L",5H:"3L",7B:"-"+(o+10)/2+"2y"})},10)}},2j:B(){d("#9B").2H("1L",7.2j);d("#9y").4Q("jt",d.K(B(){y f=d("#7D");if(7.4u!==E){7.4u.U(f.U());7.4u=E}f.U("");if(7.C.9K){d("#9L").1T().2H("1L",7.2j)}d(Q).ej("3B",7.5A);7.$J.ej("3B",7.5A);7.1k();if(7.C.4f&&7.aQ){d(7.Q.1O).3H(7.aQ)}},7));if(7.4b()===E){d(Q.1O).T("aP",7.aO?7.aO:"dr")}F E},ah:B(f){d(".3f").1T();d("#3M").V("a").2e("4k").eq(f-1).23("4k");d("#3f"+f).1K()},fm:B(l){y h=l.1I.79;2K(y g=0,j;j=h[g];g++){7.fA(j)}},fA:B(f){7.bt(f,d.K(B(g){7.fp(f,g)},7))},bt:B(f,h){y g=1R ei();g.7E("i0",7.C.6g+"?2m="+f.2m+"&1o="+f.1o,L);g.il("1d/iq; kq=x-kw-kh");g.kS=B(i){if(7.eo==4&&7.9Q==3Z){d("#M-1X").dW();h(k9(7.k0))}G{if(7.eo==4&&7.9Q!=3Z){}}};g.dI()},fj:B(h,f){y g=1R ei();if("ge"in g){g.7E(h,f,L)}G{if(1r eY!="1l"){g=1R eY();g.7E(h,f)}G{g=26}}F g},fp:B(g,f){y h=7.fj("hx",f);if(!h){}G{h.fo=d.K(B(){if(h.9Q==3Z){d("#M-1X").1T();y l=f.3k("?");if(!l[0]){F E}7.1k();y i="";i=\'<1p id="1b-1u" 2q="\'+l[0]+\'" />\';if(7.C.4w){i="<p>"+i+"</p>"}7.1H("3z",i,E);y j=d(7.$J.V("1p#1b-1u"));if(j.11){j.24("id")}G{j=E}7.12();7.1f("3b",j,E);7.2j();7.3r()}G{}},7);h.hl=B(){};h.4I.hP=B(i){};h.f4("hI-hC",g.1o);h.f4("x-gI-gT","gW-he");h.dI(g)}},a0:B(h,f){7.2w={2S:E,2O:E,33:E,4P:E,a9:E,3L:E,1v:E};d.3S(7.2w,f);y g=d("#"+h);if(g.11&&g[0].Y==="gH"){7.2w.1v=g;7.el=d(g[0].1y)}G{7.el=g}7.ek=7.el.16("4A");if(7.2w.3L){d(7.2w.1v).6n(d.K(B(i){7.el.aM(B(j){F E});7.9V(i)},7))}G{if(7.2w.a9){d("#"+7.2w.a9).1L(d.K(7.9V,7))}}},9V:B(f){d("#M-1X").dW();7.ey(7.4h,7.dE())},dE:B(){7.id="f"+39.de(39.dD()*dy);y g=7.Q.3O("N");y f=\'<1n 15="2p:28" id="\'+7.id+\'" 2m="\'+7.id+\'"></1n>\';g.4y=f;d(g).71("1O");if(7.2w.4P){7.2w.4P()}d("#"+7.id).ds(d.K(7.ef,7));F 7.id},ey:B(j,i){if(7.2w.1v){y l="hu"+7.id,g="hQ"+7.id;7.1y=d(\'<1y  4A="\'+7.2w.2S+\'" 5m="6k" 1I="\'+i+\'" 2m="\'+l+\'" id="\'+l+\'" 70="6P/1y-1g" />\');if(7.C.36!==E&&1r 7.C.36==="2I"){d.18(7.C.36,d.K(B(n,f){if(f!=26&&f.2W().3x("#")===0){f=d(f).1e()}y o=d("<1v/>",{1o:"7k",2m:n,2T:f});d(7.1y).Z(o)},7))}y h=7.2w.1v;y m=d(h).4K();d(h).16("id",g).34(m).71(7.1y);d(7.1y).T("2u","6j").T("1W","-aa").T("1t","-aa").71("1O");7.1y.aM()}G{j.16("1I",i).16("5m","6k").16("70","6P/1y-1g").16("4A",7.2w.2S);7.4h.aM()}},ef:B(){y j=d("#"+7.id)[0],l;if(j.eb){l=j.eb}G{if(j.ac){l=j.ac.Q}G{l=2Z.g8[7.id].Q}}if(7.2w.2O){d("#M-1X").1T();if(1r l!=="1l"){y h=l.1O.4y;y g=h.1Q(/\\{(.|\\n)*\\}/)[0];g=g.I(/^\\[/,"");g=g.I(/\\]$/,"");y f=d.6i(g);if(1r f.33=="1l"){7.2w.2O(f)}G{7.2w.33(7,f);7.2j()}}G{7.2j();gj("ev g2!")}}7.el.16("4A",7.ek);7.el.16("1I","")},8g:B(g,f){7.3o=d.3S({2S:E,2O:E,33:E,jR:E,36:E,1d:7.C.1a.es,ea:7.C.1a.e7},f);if(2Z.7c===1l){F E}7.86=d(\'<N X="jz"></N>\');7.3J=d(\'<N X="hR">\'+7.3o.1d+"</N>");7.eM=d(\'<N X="jw">\'+7.3o.ea+"</N>");7.86.Z(7.3J);d(g).34(7.86);d(g).34(7.eM);7.3J.1i("kl",d.K(B(){F 7.dn()},7));7.3J.1i("kJ",d.K(B(){F 7.dm()},7));7.3J.1S(0).kF=d.K(B(h){h.2a();7.3J.2e("8G").23("5r");7.eB(h.80.79[0])},7)},eB:B(g){y i=dZ.kT.dh();if(i.4I){i.4I.kO("1X",d.K(7.dT,7),E)}y h=B(){F i};y f=1R 7c();if(7.3o.36!==E&&1r 7.3o.36==="2I"){d.18(7.3o.36,d.K(B(l,j){if(j!=26&&j.2W().3x("#")===0){j=d(j).1e()}f.Z(l,j)},7))}f.Z("2U",g);d.8z({2S:7.3o.2S,dA:"U",1g:f,dh:h,dg:E,6s:E,df:E,1o:"6k",2O:d.K(B(l){l=l.I(/^\\[/,"");l=l.I(/\\]$/,"");y j=d.6i(l);if(1r j.33=="1l"){7.3o.2O(j)}G{7.3o.33(7,j);7.3o.2O(E)}},7)})},dn:B(){7.3J.23("8G");F E},dm:B(){7.3J.2e("8G");F E},dT:B(g,h){y f=g.dY?7O(g.dY/g.ij*2x,10):g;7.3J.1d("ik "+f+"% "+(h||""))},4b:B(){F/(iF|iC|iB|iz)/.3p(96.98)},7K:B(f){if(1r(f)==="1l"){F 0}F 7O(f.I("2y",""),10)},5h:B(f){F d("<N>").Z(d(f).eq(0).4K()).U()},f6:B(f){F ia.3X.2W.3t(f)=="[2I 3y]"},8Y:B(f){f=f.I(/&#7r;|<br>|<br\\/>|&2i;/gi,"");f=f.I(/\\s/g,"");f=f.I(/^<p>[^\\W\\w\\D\\d]*?<\\/p>$/i,"");F f==""},1J:B(g){y h=96.98.30();y f=/(8b)[ \\/]([\\w.]+)/.1M(h)||/(3K)[ \\/]([\\w.]+)/.1M(h)||/(7y)(?:.*7N|)[ \\/]([\\w.]+)/.1M(h)||/(3a) ([\\w.]+)/.1M(h)||h.3x("ji")<0&&/(3Q)(?:.*? jr:([\\w.]+)|)/.1M(h)||[];if(g=="7N"){F f[2]}if(g=="3K"){F(f[1]=="8b"||f[1]=="3K")}F f[1]==g},88:B(){if(7.1J("3a")&&7O(7.1J("7N"),10)<9){F L}F E},b4:B(g){y f=g.iP(L);y h=7.Q.3O("N");h.5d(f);F h.4y},8e:B(){y f=7.$J[0];y h=7.Q.b7();y g;2E((g=f.8v)){h.5d(g)}F h},7o:B(f){if(!f){F E}if(7.C.1n){F f}if(d(f).83("N.31").11==0||d(f).3c("31")){F E}G{F f}},6d:B(f){y g=7.3F(),h=7.2D();F g&&g.Y===f?g:h&&h.Y===f?h:E},bH:B(){y g=7.1V();y i=7.bE(g);y h=d.2o(d(g).1d()).I(/\\n\\r\\n/g,"");y f=h.11;if(i==f){F L}G{F E}},7z:B(){y f,g=7.1F();if(g&&g.44&&g.44>0){f=g.2R(0).4H}if(!f){F E}if(7.C.1n){if(7.bK().bx()){F!7.$J.is(f)}G{F L}}F d(f).2A("N.31").11!=0},3C:B(g,f){if(d(g).16(f)==""){d(g).24(f)}},aS:B(h,g){y f=26;2E((f=h.3x(g))!==-1){h.7H(f,1)}F h}};c.3X.5n.3X=c.3X;d.4a.fn.a3=B(t,q,j,o){y p=/(^|&6e;|\\s)(bP\\..+?\\..+?)(\\s|&gt;|$)/g,m=/(^|&6e;|\\s)(((6B?|8S):\\/\\/|6h:).+?)(\\s|&gt;|$)/g,f=/(6B?:\\/\\/.*\\.(?:cI|io|cN|cF))/gi,s=/^.*(ks.be\\/|v\\/|u\\/\\w\\/|3w\\/|ko\\?v=|\\&v=)([^#\\&\\?]*).*/;y r=(7.$J?7.$J.1S(0):7).9e,h=r.11;2E(h--){y g=r[h];if(g.3s===3){y l=g.6f;if(o&&l&&l.1Q(s)){l=l.I(s,\'<1n 2r="kD" 1C="kH" 2q="//bP.jN.jG/3w/$2" co="0" jQ></1n>\');d(g).22(l).1m()}G{if(j&&l&&l.1Q(f)){l=l.I(f,\'<1p 2q="$1">\');d(g).22(l).1m()}G{if(q&&l&&(l.1Q(p)||l.1Q(m))){l=l.I(/&/g,"&8t;").I(/</g,"&6e;").I(/>/g,"&gt;").I(p,\'$1<a 1N="\'+t+\'$2">$2</a>$3\').I(m,\'$1<a 1N="$2">$2</a>$5\');d(g).22(l).1m()}}}}G{if(g.3s===1&&!/^(a|2g|5t)$/i.3p(g.Y)){d.4a.fn.a3.3t(g,t,q,j,o)}}}}})(dZ);',62,1297,'|||||||this|||||||||||||||||||||||||||var|||function|opts||false|return|else||replace|editor|proxy|true|redactor|div|span||document|title||css|html|find||class|tagName|append||length|sync|||style|attr||each|toolbar|curLang|image|func|text|val|callback|data|source|on|table|selectionRestore|undefined|remove|iframe|type|img|label|typeof|focus|left|marker|input|section|bufferSet|form|linebreaks|td|selectionSave|height|li|box|getSelection|contents|execCommand|target|browser|show|click|exec|href|body|parent|match|new|get|hide|replaceWith|getBlock|top|progress|invisibleSpace|margin||push|after|addClass|removeAttr|ul|null||none||preventDefault|air|selection|pre|removeClass|frame|button|size|nbsp|modalClose|setTimeout|script|name|keyCode|trim|display|src|width|blockquote|buttonGet|position|ol|uploadOptions|100|px|link|closest|getBlocks|getRange|getCurrent|while|RegExp|LI|off|object|rangy|for|tr|thead|video|success|dropdown|verified|getRangeAt|url|value|file|rel|toString|contenteditable|fullpage|window|toLowerCase|redactor_editor|insertNode|error|before|footer|uploadFields||offset|Math|msie|imageUpload|hasClass|italic|className|redactor_tab|buttons|redactor_modal_btn|bold|option|split|substr|selectionStart|font|draguploadOptions|test|redactor_input|observeImages|nodeType|call|php|current_tr|embed|indexOf|String|inserthtml|tag|keyup|removeEmptyAttr|right|strong|getParent|inArray|scrollTop|formatBlocks|dropareabox|webkit|auto|redactor_tabs|content|createElement|placeholder|mozilla|shortcutsLoad|extend|shortcutsLoadFormat|shiftKey|toolbarFixed|search|prototype|visual|200||buttonActive|buffer|audio|rangeCount|redactor_file||deleted|||Redactor|isMobile|savedSel|charAt|parentNode|autoresize|alignmentTags|element|emptyHtml|imageEditter|redactor_tabs_act|redactor_placeholder|direction|Insert|textareamode|orderedlist|keydown|float|unorderedlist|round|modalcontent|dir|paragraphy|BLOCKQUOTE|innerHTML|collapsed|action|inlineMethods|range|redactor_file_link|removeAllRanges|PRE|tbody|startContainer|upload|modalInit|clone|formatting|indent|filelink|selectall|start|fadeOut|post|bar|redactor_btn_modal_close|select|redactor_link_blank|prepend|cancel|createRange|addRange||||||outdent|cleanGetTabs|getNodes|not|redactor_act|observeStart|autosave|dropact|appendChild|formatBlock|param|10px|outerHtml|justify|code|imageResizeHide|_blank|method|init|buttonBuild|redactorfolder|join|drop|allowedTags|textarea|underline|insert_link_node|unlink|header|buttonSeparator|modified|hdlModalClose|Delete|Add|Header|horizontalrule|enter|tabindex|minHeight|shortcuts|isFunction|redactor_tab_selected|cleanlevel|cleanStripTags|next|buttonActiveObserver|endContainer|linkProtocol|fileUpload|fontSize|color|resize|imageGetJson|getElement|selectionSet|line|deniedTags||phpTags|cleanRemoveSpaces|insert|alignmentSet|||selectionEnd|rebuffer|redactor_link_url|tagblock|insertunorderedlist|break|currentOrParentIs|lt|nodeValue|s3|mailto|parseJSON|absolute|POST|alignleft|ARTICLE|change|alignright|activeButtonsAdd|activeButtons|7px|contentType|ASIDE|aligncenter|insertorderedlist|redactor_link_text|selectNodeContents|setStart|alignment|template|https|javascript|setEnd|indentValue|FOOTER|redactor_btn_|SECTION|ADDRESS|selectionSetMarker|collapse|nodeTestBlocks|children|convertImageLinks|folder|multipart|set|autosaveInterval|ENTER|BACKSPACE|which|checked|insertAfter|prop|buildCodearea|mouseup|enctype|appendTo|||||||dropdownHideAll|files|airBindMousemoveHide|first|FormData|prev|one|separator|toolbarFixedBox|11px|DIV|insertHtmlAdvanced|hidden|imageInsert|HEADER|empty|isParentRedactor|del|redactor_modal_header|x200b|pasteInsert|saveScroll|cleanConvertInlineTags|align|cleanParagraphy|background|opera|isFocused|placeTag|marginTop|fixed|redactor_modal_inner|open|insertAfterLastElement|marginLeft|splice|strike|paste|normalize|clipboardUpload|insertHtml|version|parseInt|head|linkAnchor|alignmentCenter|buildOptions|insertLineBreak|iframeAddCss|alignmentRight|address|linkEmail|alignmentJustify|airShow|dataTransfer|current_td|iframeLoad|parents|cleannewLevel|alignmentLeft|droparea|redactor_air|oldIE|buildAfter|cleanRemoveEmptyTags|chrome|inlineEachNodes|buildBindKeyboard|extractContent|tfoot|draguploadInit|pasteHTML|toggle|blockLevelElements|setFullpageOnInit|imageUploadError|tableAddColumn|toolbarExternal|altKey|z0|toolbarObserveScroll|parseHTML|SPAN|amp|fileCallback|firstChild|uuid|http|toolbarFixedTarget|ajax|indentingOutdent|selectionRemoveMarkers|indentingStart|cloneRange|italicTag|indentingIndent|hover|cleanEncodeEntities|cleanSavePreCode|iframePage|pasteClipboardMozilla|insideOutdent|getTextNodesIn|th|templateVars|selectionElement|iframeDoc|meta|ftp|clipboardUploadUrl|cleanEmpty|cleanConverters|cleanConvertProtected|boldTag|isEmpty|rTestBlock|||redactor_btn|merge|redactor_button_disabled|syncClean|navigator|tableObserver|userAgent||cleanTag|cleanFinish|tableDeleteHead|buttonInactive|childNodes|redactor_btn_right|case|filter|selnodes|catch|try|textContent|tagTestBlock|link_insert|convertDivs|activeButtonsStates|getRangeSelectedNodes|tableAddRow|focusSet|DOWN|redactor_filename|lineHeight|zIndex|insert_row_below|redactor_modal|URL|redactor_insert_video_area|redactor_modal_close|Table|Row|redactor_file_alt|insert_column_left|padding|align_justify|rBlockTest|resizer|modalOverlay|redactor_modal_overlay|Column|insert_row_above|insert_table|ownLine|status|alt|cursor|ESC|imageCallback|uploadSubmit|sourceHeight|contOwnLine|save|redactor_form_image_align|uploadInit|redactor_image_box|filename|formatLinkify|delete_table|striped|choose|dnbImageTypes|drag|trigger|2000px|pageY|contentWindow|pageX|align_left|plugins|insert_column_right|modalSetTab|DELETE|delete|add_head|backcolor|redactor_table_rows|delete_head|delete_column|delete_row|iframeAppend|mousedown|RedactorPlugins|fontcolor|sourceOld|FIGCAPTION|imageRemove|createTextNode|redactor_link_mailto|buildEnable|align_right|Email|redactor_tab2|link_new_tab|ctrlKey|editter|redactor_tab3|anchor|redactor_link_anchor|align_center|convertLinks|convertVideoLinks|submit|buildEventKeydownInsertLineBreak|modalSaveBodyOveflow|overflow|saveModalScroll|quote|removeFromArrayByValue|area|fieldset|map|header5|header4|header2|header3|header1|Video|DL|formatEmpty|getFragmentHtml|formatblock|DT|createDocumentFragment|center|List|Color|OUTPUT|formatQuote|BR||H3|H2|H1|unwrap|H4|inlineUnwrapSpan|DD|inlineSetMethods|H6|H5|Head|cleanlineAfter||Edit|s3executeOnSignedUrl|the|to|newLevel|equals|lang|quot|langs|cleanUnverified|Align|Code|getCaretOffset|Left|cleanlineBefore|isEndOfElement|Right|Image|getCaretOffsetRange|Link|cleanHtml|paragraph|nofollow|www|TD|metaKey|innerWidth|airEnable|toolbar_fixed_box|TAB|toolbarFixedTopOffset|visibility|airBindHide|LEFT_WIN|originalEvent|returnValue|buildEventClipboardUpload|cleanup|clipboardData|dropdownHide|buildEventKeydown|clipboardFilePaste|items|tabFocus|8203|placeholderFocus|placeholderRemove|placeholderRemoveFromCode|buildPlugins|iframeStart|iframeCreate|clearInterval|write|documentElement|substring|setInterval|buttonsAdd|formattingTags|frameborder|buttonsCustom|buttonSource|buildEventKeyup|toolbarBuild|airButtons|buildEventPaste|dropdownShow|inserthorizontalrule|close|linkNofollow|tidyHtml|formattingPre|buildStart|buildContent|buildMobile|mobile|gif|getCodeIframe|double|png|cleanReplacer|buffer_|cleanReConvertProtected|placeholderStart|jpeg|setCodeIframe|setEditor|buildFromTextarea|buildFromElement|buttonInactiveVisual|blurCallback|blur|focusCallback|buttonActiveVisual|buildEventDrop|redactor_dropdown|redactor_dropdown_box_|dropdownBuild|redactor_btn_html|dragUpload|redactor_dropdown_link|wym|buildAddClasses|link_edit|buttonActiveToggle|initToolbar|redactor_editor_wym|buttonInactiveAll|removeEmptyTags|transparent||floor|processData|cache|xhr|unshift|modalTemplatesInit|getSelectedNodes||draguploadOndragleave|draguploadOndrag|modal_image_edit|modal_file|nextNode|visible|load||imageThumbClick|8px|000|backgroundColor|99999|imageCallbackLink|dataType|nextSibling|getSelectionText|random|uploadFrame|image_position|formatChangeTag|selectionWrap|send|image_web_link|selectionRemove|redactor_upload_btn|modal_link|checkbox|redactor_link_url_text|observeTables|redactor_tab1|endOffset|setCaret|uploadProgress|_delete|redactor_image_delete_btn|fadeIn|redactorSaveBtn|loaded|jQuery|modal_image|apply|selectionCreateMarker|fff|1px|mousemove|linkInsert|or_choose|fileShow|fileUploadError|atext|contentDocument|linkProcess|relative|imageResizeControls|uploadLoaded|inside|imageResize|XMLHttpRequest|unbind|element_action||||readyState|imageSave||outerHeight|drop_file_here|imageShow|isEmptyObject|Upload|location|self|uploadForm|tableDeleteColumn|tableAddHead|draguploadUpload|tableAddRowAbove|tableDeleteRow|tableDeleteTable|5px|cloneContents|tableShow|tableInsert|tableAddRowBelow|tableAddColumnLeft|videoShow|dropalternative|videoInsert|linkShow|0px|opacity|tableAddColumnRight|imageEdit|18px|edit|pop|u0000|deleteContents|XDomainRequest|internal|redactor_insert_video_btn|pastePlainText|replaceLineBreak|pasteClean|setRequestHeader|modal_video|isString|pasteClipboardUploadMozilla|redactor_table_columns|innerText|pastePre|redactor_insert_table_btn|setStartAfter|draggable|caretPositionFromPoint|overlay|createTextRange|modal|caretRangeFromPoint|s3createCORSRequest|moveToPoint|clientY|s3handleFileSelect||onload|s3uploadToS3|last|clientX|insertNodeToCaretPositionFromPoint|pasteClipboardUpload|video_html_code|BODY|bufferRedo|HTML|redactor_insert_link_btn|article|s3uploadFile|bufferUndo|columns|rows|aside|redactor_link_mailto_text|modal_table|focusEnd|clipboard|redactor_link_anchor_text|sourceWidth|defaultView|outline|dropdowns|block|ownerDocument|Embed|dashed|rgba|removeFormat|redactor_image_edit_src|Open|toUpperCase|Columns|pointer|Title|380|tab|failed|charCodeAt|None|Position|imageDelete|LEFT|frames|Name|optional|TH|dragstart|Underline|withCredentials|isArray|removeChild|Web||alert|Alignment|stylesheet|handle|Text|3px|9px|300px|META|move||web|13px|Rule|Deleted|Horizontal|CTRL|Justify|inline|readAsDataURL|TEXTAREA|Rows|Choose|redactor_box|INPUT|amz|redactorInsertImageForm|separator_drop3|redactor_|Or|enableObjectResizing|separator_drop1|redactorInsertVideoForm|separator_drop2|min|redactorUploadFileForm|acl|Download|blank|public|getEditor|about|getBox|getToolbar|||||||getIframe|syncBefore|syncAfter|destroy|Callback|removeData|getObject|read|redactorInsertLinkForm|160px|Drop|redactor_format_h1|bottom|redactor_format_pre|onerror|FileReader|getAsFile|4px|undo|redactor_format_blockquote||File|nw|redactorUploadForm|redo|times|PUT|download|redactor_format_h2|border|strikethrough|Type|redactor_format_h5|Center|bull|enableInlineTableEditing|here|Content|redactor_format_h4|536|solid|Chrome|redactor_format_h3|slow|onprogress|redactorUploadFile|redactor_dropareabox|details|figcaption|menu|summary|ns|figure|nav|math|GET|legend|hgroup|hasOwnProperty|frameset|redactor_separator|sub|sup|ltr|applet|Object|weight|noscript||result||pasteAfter|colgroup|col|total|Loading|overrideMimeType|selectionAll||jpg|saveSelection|plain|removeMarkers||restoreSelection|detach|extractContents|u200B|unselectable|comment|Android|caption|BlackBerry|iPod|u200D|uFEFF|iPhone|concat|small|VERSION|blockRemoveAttr|blockSetAttr|blockRemoveStyle|blockSetStyle|setEndAfter|use|cloneNode|offsetNode|startOffset|strict|blockRemoveClass|blockSetClass|insertText|attributes|inlineFormat|inlineRemoveFormat|inlineSetAttr|inlineRemoveAttr|inlineRemoveClass|inlineSetClass|inlineRemoveStyle|inlineSetStyle|duplicate|JustifyFull|guid|docs|slice|sid|arguments|string|fake|cite|such|No|Array|compatible|JustifyRight|EndToEnd|JustifyCenter|setEndPoint|insertDoubleLineBreak|JustifyLeft|MsoListParagraphCxSpLast|MsoListParagraphCxSpFirst|rv|pasteBefore|fast|replaced|Anchor|redactor_dropalternative|redactor_toolbar|redactor_toolbar_|redactor_droparea|1000|escape|encodeURIComponent|Bold|500|redactor_air_|com|460|host|UL|600|1005|Quote|youtube|scroll|xn|allowfullscreen|preview|Save|Cancel|Indent|Outdent|Above|Below|superscript|subscript|responseText|Ordered|Unordered|innerHeight|thumb|Italic|getJSON|redactor_image_box_select|Font|decodeURIComponent|Back|610|Normal|focusNode|buttonAddFirst|buttonAddAfter|buttonAddBefore|defined|buttonAdd|buttonSetLeft|getSelectionHtml|dragover|buttonRemoveSeparatorBefore|buttonSetRight|watch|buttonRemove|charset|nodeName|youtu|OL|default|isCollapsed|user|hasChildNodes|commonAncestorContainer|switch|buttonAddSeparatorBefore|buttonRemoveSeparatorAfter|Formatting|560|Unlink|ondrop|redactor_dropdown_|315|collapseToStart|dragleave|redactor_separator_drop|buttonAddSeparatorAfter|stopPropagation|buttonAddSeparator|addEventListener|300|buttonChangeIcon|buttonRemoveIcon|onreadystatechange|ajaxSettings|cellIndex'.split('|'),0,{}))
\ No newline at end of file
diff --git a/open.php b/open.php
index 3292e8564900e9676784ca54dd0599e9e6f59d2c..db51e85d395fab9225dbb4ca0efb88df7f7139cb 100644
--- a/open.php
+++ b/open.php
@@ -36,6 +36,7 @@ if($_POST):
     //Ticket::create...checks for errors..
     if(($ticket=Ticket::create($vars, $errors, SOURCE))){
         $msg='Support ticket request created';
+        Draft::deleteForNamespace('ticket.client.'.substr(session_id(), -12));
         //Logged in...simply view the newly created ticket.
         if($thisclient && $thisclient->isValid()) {
             if(!$cfg->showRelatedTickets())
diff --git a/pages/index.php b/pages/index.php
index 75c5490dd7be32bd7be1de368cefeeee830ec432..fc65aebc11b59fa80c0cb28860b562ab8f2e4e22 100644
--- a/pages/index.php
+++ b/pages/index.php
@@ -48,7 +48,7 @@ if (!$page->isActive() || $page->getType() != 'other')
 
 require(CLIENTINC_DIR.'header.inc.php');
 
-print $page->getBody();
+print $page->getBodyWithImages();
 
 require(CLIENTINC_DIR.'footer.inc.php');
 ?>
diff --git a/scp/ajax.php b/scp/ajax.php
index 0f0771d3742efe983fe325fff52fe937f31e8dc5..3eeca0f0062e868f67aa660739943b356edd43fe 100644
--- a/scp/ajax.php
+++ b/scp/ajax.php
@@ -61,6 +61,14 @@ $dispatcher = patterns('',
         url_get('^lookup', 'lookup'),
         url_get('^search', 'search')
     )),
+    url('^/draft/', patterns('ajax.draft.php:DraftAjaxAPI',
+        url_post('^(?P<id>\d+)$', 'updateDraft'),
+        url_delete('^(?P<id>\d+)$', 'deleteDraft'),
+        url_post('^(?P<id>\d+)/attach$', 'uploadInlineImage'),
+        url_get('^(?P<namespace>[\w.]+)$', 'getDraft'),
+        url_post('^(?P<namespace>[\w.]+)$', 'createDraft'),
+        url_get('^images/browse$', 'getFileList')
+    )),
     url_post('^/upgrader', array('ajax.upgrader.php:UpgraderAjaxAPI', 'upgrade'))
 );
 
diff --git a/scp/canned.php b/scp/canned.php
index c085e4116c2530d21db6932d22696aa2b981eb6b..262c5f4893109ca0f4d26b703aaca249645b1a8d 100644
--- a/scp/canned.php
+++ b/scp/canned.php
@@ -37,18 +37,35 @@ if($_POST && $thisstaff->canManageCannedResponses()) {
                 //Delete removed attachments.
                 //XXX: files[] shouldn't be changed under any circumstances.
                 $keepers = $_POST['files']?$_POST['files']:array();
-                $attachments = $canned->getAttachments(); //current list of attachments.
+                $attachments = $canned->attachments->getSeparates(); //current list of attachments.
                 foreach($attachments as $k=>$file) {
                     if($file['id'] && !in_array($file['id'], $keepers)) {
-                        $canned->deleteAttachment($file['id']);
+                        $canned->attachments->delete($file['id']);
                     }
                 }
                 //Upload NEW attachments IF ANY - TODO: validate attachment types??
                 if($_FILES['attachments'] && ($files=AttachmentFile::format($_FILES['attachments'])))
-                    $canned->uploadAttachments($files);
+                    $canned->attachments->upload($files);
+
+                // Attach inline attachments from the editor
+                if (isset($_POST['draft_id'])
+                        && ($draft = Draft::lookup($_POST['draft_id']))) {
+                    $canned->attachments->deleteInlines();
+                    $canned->attachments->upload(
+                        $draft->getAttachmentIds($_POST['response']),
+                        true);
+                }
 
                 $canned->reload();
 
+                // XXX: Handle nicely notifying a user that the draft was
+                // deleted | OR | show the draft for the user on the name
+                // page refresh or a nice bar popup immediately with
+                // something like "This page is out-of-date", and allow the
+                // user to voluntarily delete their draft
+                //
+                // Delete drafts for all users for this canned response
+                Draft::deleteForNamespace('canned.'.$canned->getId());
             } elseif(!$errors['err']) {
                 $errors['err']='Error updating canned response. Try again!';
             }
@@ -59,8 +76,16 @@ if($_POST && $thisstaff->canManageCannedResponses()) {
                 $_REQUEST['a']=null;
                 //Upload attachments
                 if($_FILES['attachments'] && ($c=Canned::lookup($id)) && ($files=AttachmentFile::format($_FILES['attachments'])))
-                    $c->uploadAttachments($files);
+                    $c->attachments->upload($files);
+
+                // Attach inline attachments from the editor
+                if (isset($_POST['draft_id'])
+                        && ($draft = Draft::lookup($_POST['draft_id'])))
+                    $c->attachments->upload(
+                        $draft->getAttachmentIds($_POST['response']), true);
 
+                // Delete this user's drafts for new canned-responses
+                Draft::deleteForNamespace('canned', $thisstaff->getId());
             } elseif(!$errors['err']) {
                 $errors['err']='Unable to add canned response. Correct error(s) below and try again.';
             }
diff --git a/scp/css/dropdown.css b/scp/css/dropdown.css
index a95f6517b8b39a8f297fbf20c5234868a2543c40..961abd6fa0fb3b7945ef6bcd56594c1c947ddb8d 100644
--- a/scp/css/dropdown.css
+++ b/scp/css/dropdown.css
@@ -93,7 +93,6 @@
   border: 1px solid #aaa;
   cursor: pointer;
   font-size: 11px;
-  height: 18px;
   overflow: hidden;
   background-color: #dddddd;
   background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #efefef), color-stop(100% #dddddd));
@@ -103,7 +102,7 @@
   background-image: -o-linear-gradient(top, #efefef 0%, #dddddd 100%);
   background-image: linear-gradient(top, #efefef 0%, #dddddd 100%);
   padding: 0 5px;
-  text-decoration: none;
+  text-decoration: none !important;
   line-height:18px;
   float:right;
   margin-left:5px;
diff --git a/scp/css/scp.css b/scp/css/scp.css
index 560eaae90a0c87e41d976a05a787ae3a7f2b3fea..648d05c1348e68f8ea600ef8338caaf7d5dea101 100644
--- a/scp/css/scp.css
+++ b/scp/css/scp.css
@@ -727,7 +727,9 @@ h2 .reload {
     background:url(../images/icons/note.gif) 10px 50% no-repeat;
 }
 
-#ticket_thread table {
+#ticket_thread table.message,
+#ticket_thread table.response,
+#ticket_thread table.note {
     margin-top:10px;
     border:1px solid #aaa;
     border-bottom:2px solid #aaa;
@@ -782,19 +784,19 @@ h2 .reload {
     padding-left:5px;
 }
 
-#ticket_thread .message th {
+#ticket_thread > .message th {
     background:#C3D9FF;
 }
 
-#ticket_thread .response th {
+#ticket_thread > .response th {
     background:#FFE0B3;
 }
 
-#ticket_thread .note th {
+#ticket_thread > .note th {
     background:#FFE;
 }
 
-#ticket_thread table td, #ticket_notes table td {
+#ticket_notes table td {
     padding:5px;
 }
 
@@ -817,11 +819,11 @@ h2 .reload {
     margin-top:30px;
 }
 
-#response_options form {
+#response_options > form {
     padding:0 10px;
 }
 
-#response_options ul {
+#response_options ul.tabs {
     padding:4px 0 0 190px;
     margin:0;
     text-align:center;
@@ -830,14 +832,14 @@ h2 .reload {
     background:#eef3f8;
 }
 
-#response_options li {
+#response_options ul.tabs li {
     margin:0;
     padding:0;
     display:inline;
     list-style:none;
 }
 
-#response_options li a {
+#response_options ul.tabs li a {
     width:130px;
     font-weight:bold;
     padding:5px;
@@ -861,7 +863,7 @@ h2 .reload {
     background-repeat:no-repeat;
 }
 
-#response_options li a.active {
+#response_options ul.tabs li a.active {
     height:18px;
     color:#184E81;
     background-color:#f9f9f9;
@@ -870,18 +872,18 @@ h2 .reload {
     border-bottom:none;
 }
 
-#response_options form {
+#response_options > form {
     padding:10px 5px;
     background:#f9f9f9;
     border:1px solid #aaa;
     border-top:none;
 }
 
-#response_options table {
+#response_options > table {
     width:928px;
 }
 
-#response_options td {
+#response_options > table td {
     vertical-align:top;
 }
 
@@ -889,7 +891,7 @@ h2 .reload {
     width:760px !important;
 }
 
-#response_options input[type=text], #response_options textarea {
+#response_options input[type=text], #response_options textarea:not(.richtext) {
     border:1px solid #aaa;
     background:#fff;
 }
@@ -1190,10 +1192,16 @@ time {
     width:500px;
     height:250px;
     height:auto !important;
-    background:#fff;
-    border:1px solid #2a67ac;
+    background:#f8f8f8;
+    border:2px solid #2a67ac;
     display:none;
     z-index:1200;
+    box-shadow: 0 5px 60px #001;
+    border-radius: 5px;
+}
+
+.redactor_air {
+    z-index: 1201 !important;
 }
 
 .dialog#advanced-search {
@@ -1404,3 +1412,46 @@ ul.progress li.no small {color:red;}
 
 #loading h4, #upgrading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; }
 
+/* Inline image hovering with download link */
+.image-hover {
+    display: inline-block;
+    position: relative;
+}
+.image-hover .caption {
+    background-color: rgba(0,0,0,0.5);
+    min-width: 20em;
+    color: white;
+    padding: 1em;
+    display: none;
+    width: 100%;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
+}
+.image-hover .caption .filename {
+    display: inline-block;
+    max-width: 60%;
+    overflow: hidden;
+}
+
+.thread-body img:not(.optional) {
+    width: auto;
+    height: auto;
+    max-width: 100%;
+}
+
+.non-local-image {
+    display: inline-block;
+}
+
+.non-local-image:after {
+    background: url(../images/ost-logo.png) center center no-repeat;
+    background-size: cover;
+    content: "";
+    z-index: -1;
+    width: 100%;
+    height: 100%;
+    display: block;
+    opacity: 0.3;
+}
diff --git a/scp/emailtest.php b/scp/emailtest.php
index f62bdc6bb86fffac40632713af87d27acd40a850..6a0787e377362ec8f3dd2eb2b9ae1614174856f9 100644
--- a/scp/emailtest.php
+++ b/scp/emailtest.php
@@ -35,8 +35,11 @@ if($_POST){
         $errors['message']='Message required';
 
     if(!$errors && $email){
-        if($email->send($_POST['email'],$_POST['subj'],$_POST['message']))
+        if($email->send($_POST['email'],$_POST['subj'],
+                Format::sanitize($_POST['message']))) {
             $msg='Test email sent successfully to '.Format::htmlchars($_POST['email']);
+            Draft::deleteForNamespace('email.diag');
+        }
         else
             $errors['err']='Error sending email - try again.';
     }elseif($errors['err']){
@@ -105,8 +108,11 @@ require(STAFFINC_DIR.'header.inc.php');
         </tr>
         <tr>
             <td colspan=2>
-                <em><strong>Message</strong>: email message to send.</em>&nbsp;<span class="error">*&nbsp;<?php echo $errors['message']; ?></span><br>
-                <textarea name="message" cols="21" rows="10" style="width: 90%;"><?php echo $info['message']; ?></textarea>
+                <div style="padding-top:0.5em;padding-bottom:0.5em">
+                <em><strong>Message</strong>: email message to send.</em>&nbsp;<span class="error">*&nbsp;<?php echo $errors['message']; ?></span></div>
+                <textarea class="richtext draft draft-delete" name="message" cols="21"
+                    data-draft-namespace="email.diag"
+                    rows="10" style="width: 90%;"><?php echo $info['message']; ?></textarea>
             </td>
         </tr>
     </tbody>
diff --git a/scp/faq.php b/scp/faq.php
index de33a64b2c018b988ec2ebbbabac41b65aadf3f3..75b7356e44114759ca1acc4a05f12c6ba58a27ad 100644
--- a/scp/faq.php
+++ b/scp/faq.php
@@ -28,9 +28,11 @@ if($_POST):
     switch(strtolower($_POST['do'])) {
         case 'create':
         case 'add':
-            if(($faq=FAQ::add($_POST,$errors)))
+            if(($faq=FAQ::add($_POST,$errors))) {
                 $msg='FAQ added successfully';
-            elseif(!$errors['err'])
+                // Delete draft for this new faq
+                Draft::deleteForNamespace('faq', $thisstaff->getId());
+            } elseif(!$errors['err'])
                 $errors['err'] = 'Unable to add FAQ. Try again!';
         break;
         case 'update':
@@ -41,8 +43,10 @@ if($_POST):
                 $msg='FAQ updated successfully';
                 $_REQUEST['a']=null; //Go back to view
                 $faq->reload();
+                // Delete pending draft updates for this faq (for ALL users)
+                Draft::deleteForNamespace('faq.'.$faq->getId());
             } elseif(!$errors['err'])
-                $errors['err'] = 'Unable to update FAQ. Try again!';     
+                $errors['err'] = 'Unable to update FAQ. Try again!';
             break;
         case 'manage-faq':
             if(!$faq) {
@@ -80,7 +84,7 @@ if($_POST):
             break;
         default:
             $errors['err']='Unknown action';
-    
+
     }
 endif;
 
diff --git a/scp/image.php b/scp/image.php
index 089625ca1b340ff5718be52bdb31cc4b43c579ea..f10fcd6e9039817022330ee87aa00009127888a2 100644
--- a/scp/image.php
+++ b/scp/image.php
@@ -25,7 +25,10 @@ $h=trim($_GET['h']);
 if(!$h  || strlen($h)!=64  //32*2
         || !($file=AttachmentFile::lookup(substr($h,0,32))) //first 32 is the file hash.
         || strcasecmp($h, $file->getDownloadHash())) //next 32 is file id + session hash.
-    die('Unknown or invalid file. #'.Format::htmlchars($_GET['h']));
+    Http::response(404, 'Unknown or invalid file');
 
-$file->display();
+if ($_GET['s'] && is_numeric($_GET['s']))
+    $file->display($_GET['s']);
+else
+    $file->display();
 ?>
diff --git a/scp/js/scp.js b/scp/js/scp.js
index ec2daf54261907dfaf64bc6fa64dcb71ccdf73f8..1269f1d8182da004b64677ddc3ccb648b74feb50 100644
--- a/scp/js/scp.js
+++ b/scp/js/scp.js
@@ -190,11 +190,23 @@ $(document).ready(function(){
                 cache: false,
                 success: function(canned){
                     //Canned response.
+                    var box = $('#response',fObj),
+                        redactor = box.data('redactor');
                     if(canned.response) {
-                        if($('#append',fObj).is(':checked') &&  $('#response',fObj).val())
-                            $('#response',fObj).val($('#response',fObj).val()+"\n\n"+canned.response+"\n");
-                        else
-                            $('#response',fObj).val(canned.response);
+                        if($('#append',fObj).is(':checked') &&  $('#response',fObj).val()) {
+                            if (redactor)
+                                redactor('insertHtml', canned.response);
+                            else
+                                box.val(canned.response);
+                        }
+                        else {
+                            if (redactor)
+                                redactor('set', canned.response);
+                            else
+                                box.val(canned.response);
+                        }
+                        if (redactor)
+                            redactor('observeStart');
                     }
                     //Canned attachments.
                     if(canned.files && $('.canned_attachments',fObj).length) {
@@ -249,20 +261,6 @@ $(document).ready(function(){
     /* Get config settings from the backend */
     jQuery.fn.exists = function() { return this.length>0; };
 
-    var getConfig = (function() {
-        var dfd = $.Deferred();
-        return function() {
-            if (!dfd.isResolved())
-                $.ajax({
-                    url: "ajax.php/config/scp",
-                    dataType: 'json',
-                    success: function (json_config) {
-                        dfd.resolve(json_config);
-                    }
-                });
-            return dfd;
-        }
-    })();
     /* Multifile uploads */
     var elems = $('.multifile');
     if (elems.exists()) {
@@ -285,18 +283,6 @@ $(document).ready(function(){
         showOn:'both'
      });
 
-    /* NicEdit richtext init */
-    var rtes = $('.richtext');
-    var rtes_count = rtes.length;
-    for(i=0;i<rtes_count;i++) {
-        var initial_value = rtes[i].value;
-        rtes[i].id = 'rte-'+i;
-        new nicEditor({iconsPath:'images/nicEditorIcons.gif'}).panelInstance('rte-'+i);
-        if(initial_value=='') {
-            nicEditors.findEditor('rte-'+i).setContent('');
-        }
-    }
-
     /* Typeahead tickets lookup */
     $('#basic-ticket-search').typeahead({
         source: function (typeahead, query) {
@@ -434,3 +420,19 @@ $(document).ready(function(){
              });
     });
 });
+
+// NOTE: getConfig should be global
+getConfig = (function() {
+    var dfd = $.Deferred();
+    return function() {
+        if (dfd.state() != 'resolved')
+            $.ajax({
+                url: "ajax.php/config/scp",
+                dataType: 'json',
+                success: function (json_config) {
+                    dfd.resolve(json_config);
+                }
+            });
+        return dfd;
+    }
+})();
diff --git a/scp/js/ticket.js b/scp/js/ticket.js
index ab83eab43ae8be4a65af0b15177d4ea93b9f5fe4..451c7675a199e6ce11164a2f1264b675ed35a1e4 100644
--- a/scp/js/ticket.js
+++ b/scp/js/ticket.js
@@ -278,8 +278,8 @@ jQuery(function($) {
         $('#toggle_ticket_thread').removeClass('active');
         $('#toggle_notes').addClass('active');
     } else {
-        $('#response_options ul li:first a').addClass('active');
-        $('#response_options '+$('#response_options ul li:first a').attr('href')).show();
+        $('#response_options ul.tabs li:first a').addClass('active');
+        $('#response_options '+$('#response_options ul.tabs li:first a').attr('href')).show();
     }
 
     $('#reply_tab').click(function() {
@@ -292,9 +292,9 @@ jQuery(function($) {
         }
      });
 
-    $('#response_options ul li a').click(function(e) {
+    $('#response_options ul.tabs li a').click(function(e) {
         e.preventDefault();
-        $('#response_options ul li a').removeClass('active');
+        $('#response_options ul.tabs li a').removeClass('active');
         $(this).addClass('active');
         $('#response_options form').hide();
         //window.location.hash = this.hash;
@@ -361,4 +361,84 @@ jQuery(function($) {
         return false;
     });
 
+    var showNonLocalImage = function(div) {
+        var $div = $(div),
+            $img = $div.append($('<img>')
+              .attr('src', $div.data('src'))
+              .attr('alt', $div.attr('alt'))
+              .attr('title', $div.attr('title'))
+              .attr('style', $div.data('style'))
+            );
+        if ($div.attr('width'))
+            $img.width($div.attr('width'));
+        if ($div.attr('height'))
+            $img.height($div.attr('height'));
+    };
+
+    // Optionally show external images
+    $('.thread-entry').each(function(i, te) {
+        var extra = $(te).find('.textra'),
+            imgs = $(te).find('div.non-local-image[data-src]');
+        if (!extra) return;
+        if (!imgs.length) return;
+        extra.append($('<a>')
+          .addClass("action-button show-images")
+          .css({'font-weight':'normal'})
+          .text(' Show Images')
+          .click(function(ev) {
+            imgs.each(function(i, img) {
+              showNonLocalImage(img);
+              $(img).removeClass('non-local-image')
+                // Remove placeholder sizing
+                .width('auto')
+                .height('auto')
+                .removeAttr('width')
+                .removeAttr('height');
+              extra.find('.show-images').hide();
+            });
+          })
+          .prepend($('<i>')
+            .addClass('icon-picture')
+          )
+        );
+        imgs.each(function(i, img) {
+            var $img = $(img);
+            // Save a copy of the original styling
+            $img.data('style', $img.attr('style'));
+            // If the image has a 'height' attribute, use it, otherwise, use
+            // 40px
+            if ($img.attr('height'))
+                $img.height($img.attr('height'));
+            else
+                $img.height('40px');
+            // Ensure the image placeholder is visible width-wise
+            if (!$img.width())
+                $img.width('80px');
+            // TODO: Add a hover-button to show just one image
+        });
+    });
 });
+
+showImagesInline = function(urls, thread_id) {
+    var selector = (thread_id == undefined)
+        ? '.thread-body img[data-cid]'
+        : '.thread-body#thread-id-'+thread_id+' img[data-cid]';
+    $(selector).each(function(i, el) {
+        var cid = $(el).data('cid'),
+            info = urls[cid],
+            e = $(el);
+        if (info) {
+            // Add a hover effect with the filename
+            var caption = $('<div class="image-hover">')
+                .hover(
+                    function() { $(this).find('.caption').slideDown(250); },
+                    function() { $(this).find('.caption').slideUp(250); }
+                ).append($('<div class="caption">')
+                    .append('<span class="filename">'+info.filename+'</span>')
+                    .append('<a href="'+info.download_url+'" class="action-button"><i class="icon-download-alt"></i> Download</a>')
+                )
+            caption.appendTo(e.parent())
+            e.appendTo(caption);
+        }
+    });
+}
diff --git a/scp/pages.php b/scp/pages.php
index 295852bafd112f2e4a1254e480862845a3cba558..ee3af72dbe8d296200dd87f79d4acd8f420dff45 100644
--- a/scp/pages.php
+++ b/scp/pages.php
@@ -26,6 +26,12 @@ if($_POST) {
             if(($pageId=Page::create($_POST, $errors))) {
                 $_REQUEST['a'] = null;
                 $msg='Page added successfully';
+                // Attach inline attachments from the editor
+                if (isset($_POST['draft_id'])
+                        && ($draft = Draft::lookup($_POST['draft_id'])))
+                    $c->attachments->upload(
+                        $draft->getAttachmentIds($_POST['response']), true);
+                Draft::deleteForNamespace('page');
             } elseif(!$errors['err'])
                 $errors['err'] = 'Unable to add page. Try again!';
         break;
@@ -35,6 +41,15 @@ if($_POST) {
             elseif($page->update($_POST, $errors)) {
                 $msg='Page updated successfully';
                 $_REQUEST['a']=null; //Go back to view
+                // Attach inline attachments from the editor
+                if (isset($_POST['draft_id'])
+                        && ($draft = Draft::lookup($_POST['draft_id']))) {
+                    $page->attachments->deleteInlines();
+                    $page->attachments->upload(
+                        $draft->getAttachmentIds($_POST['response']),
+                        true);
+                }
+                Draft::deleteForNamespace('page.'.$page->getId());
             } elseif(!$errors['err'])
                 $errors['err'] = 'Unable to update page. Try again!';
             break;
diff --git a/scp/templates.php b/scp/templates.php
index fd0ed3dde61e306030d5ee5d89fc40d393526ea8..2b46e927bc150975162f7bcbe0a9c4734e4b9ef0 100644
--- a/scp/templates.php
+++ b/scp/templates.php
@@ -29,8 +29,10 @@ if($_POST){
             if(!$template){
                 $errors['err']='Unknown or invalid template';
             }elseif($template->update($_POST,$errors)){
-                $template->reload();
                 $msg='Message template updated successfully';
+                // Drop drafts for this template for ALL users
+                Draft::deleteForNamespace('tpl.'.$template->getCodeName()
+                    .'.'.$template->getTplId());
             }elseif(!$errors['err']){
                 $errors['err']='Error updating message template. Try again!';
             }
@@ -41,6 +43,9 @@ if($_POST){
             }elseif($new = EmailTemplate::add($_POST,$errors)){
                 $template = $new;
                 $msg='Message template updated successfully';
+                // Drop drafts for this user for this template
+                Draft::deleteForNamespace('tpl.'.$new->getCodeName()
+                    .$new->getTplId(), $thisstaff->getId());
             }elseif(!$errors['err']){
                 $errors['err']='Error updating message template. Try again!';
             }
diff --git a/scp/tickets.php b/scp/tickets.php
index 0a9ba30a443e88034c12c453989fc4537822d184..45d0cd44a9634e4662ab249dba0ae2a73e7b29cb 100644
--- a/scp/tickets.php
+++ b/scp/tickets.php
@@ -19,6 +19,7 @@ require_once(INCLUDE_DIR.'class.ticket.php');
 require_once(INCLUDE_DIR.'class.dept.php');
 require_once(INCLUDE_DIR.'class.filter.php');
 require_once(INCLUDE_DIR.'class.canned.php');
+require_once(INCLUDE_DIR.'class.json.php');
 
 
 $page='';
@@ -67,6 +68,12 @@ if($_POST && !$errors):
             if(!$errors && ($response=$ticket->postReply($vars, $errors, isset($_POST['emailreply'])))) {
                 $msg='Reply posted successfully';
                 $ticket->reload();
+
+                // Cleanup drafts for the ticket. If not closed, only clean
+                // for this staff. Else clean all drafts for the ticket.
+                Draft::deleteForNamespace('ticket.%.' . $ticket->getId(),
+                    $ticket->isClosed() ? false : $thisstaff->getId());
+
                 if($ticket->isClosed() && $wasOpen)
                     $ticket=null;
 
@@ -171,6 +178,11 @@ if($_POST && !$errors):
                 if($wasOpen && $ticket->isClosed())
                     $ticket = null; //Going back to main listing.
 
+                // Cleanup drafts for the ticket. If not closed, only clean
+                // for this staff. Else clean all drafts for the ticket.
+                Draft::deleteForTicket($ticket->getId(),
+                    $ticket->isClosed() ? false : $thisstaff->getId());
+
             } else {
 
                 if(!$errors['err'])
@@ -451,6 +463,7 @@ if($_POST && !$errors):
                         $_REQUEST['a']=null;
                         if(!$ticket->checkStaffAccess($thisstaff) || $ticket->isClosed())
                             $ticket=null;
+                        Draft::deleteForNamespace('ticket.staff%', $thisstaff->getId());
                     } elseif(!$errors['err']) {
                         $errors['err']='Unable to create the ticket. Correct the error(s) and try again';
                     }
diff --git a/setup/inc/install-prereq.inc.php b/setup/inc/install-prereq.inc.php
index 46f117e53d175d232df01588e2df9b902fd6052c..6bdb25594a14be7d89975c3656c82937dd16b2a4 100644
--- a/setup/inc/install-prereq.inc.php
+++ b/setup/inc/install-prereq.inc.php
@@ -15,15 +15,17 @@ if(!defined('SETUPINC')) die('Kwaheri!');
             These items are necessary in order to install and use osTicket.
             <ul class="progress">
                 <li class="<?php echo $installer->check_php()?'yes':'no'; ?>">
-                PHP v4.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li>
+                PHP v5.3 or greater - (<small><b><?php echo PHP_VERSION; ?></b></small>)</li>
                 <li class="<?php echo $installer->check_mysql()?'yes':'no'; ?>">
-                MySQL v4.4 or greater - (<small><b><?php echo extension_loaded('mysql')?'module loaded':'missing!'; ?></b></small>)</li>
+                MySQL v5.0 or greater - (<small><b><?php echo extension_loaded('mysql')?'module loaded':'missing!'; ?></b></small>)</li>
             </ul>
             <h3>Recommended:</h3>
             You can use osTicket without these, but you may not be able to use all features.
             <ul class="progress">
                 <li class="<?php echo extension_loaded('gd')?'yes':'no'; ?>">Gdlib extension</li>
                 <li class="<?php echo extension_loaded('imap')?'yes':'no'; ?>">PHP IMAP extension</li>
+                <li class="<?php echo extension_loaded('xml')?'yes':'no'; ?>">PHP XML extension (for HTML email processing, and XML API)</li>
+                <li class="<?php echo extension_loaded('json')?'yes':'no'; ?>">PHP JSON extension (faster performance)</li>
             </ul>
             <div id="bar">
                 <form method="post" action="install.php">
diff --git a/setup/inc/streams/core/install-mysql.sql b/setup/inc/streams/core/install-mysql.sql
index f560a201a0b28815059c80a0b7a56b546ad69043..6841080644432453870cf42922339b95c660c27f 100644
--- a/setup/inc/streams/core/install-mysql.sql
+++ b/setup/inc/streams/core/install-mysql.sql
@@ -15,6 +15,15 @@ CREATE TABLE `%TABLE_PREFIX%api_key` (
   UNIQUE KEY `apikey` (`apikey`)
 ) DEFAULT CHARSET=utf8;
 
+DROP TABLE IF EXISTS `%TABLE_PREFIX%attachment`;
+CREATE TABLE `%TABLE_PREFIX%attachment` (
+  `object_id` int(11) unsigned NOT NULL,
+  `type` char(1) NOT NULL,
+  `file_id` int(11) unsigned NOT NULL,
+  `inline` tinyint(1) unsigned NOT NULL DEFAULT '0',
+  PRIMARY KEY (`object_id`,`file_id`,`type`)
+) DEFAULT CHARSET=utf8;
+
 DROP TABLE IF EXISTS `%TABLE_PREFIX%faq`;
 CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq` (
   `faq_id` int(10) unsigned NOT NULL auto_increment,
@@ -32,13 +41,6 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq` (
   KEY `ispublished` (`ispublished`)
 ) DEFAULT CHARSET=utf8;
 
-DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_attachment`;
-CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_attachment` (
-  `faq_id` int(10) unsigned NOT NULL,
-  `file_id` int(10) unsigned NOT NULL,
-  PRIMARY KEY  (`faq_id`,`file_id`)
-) DEFAULT CHARSET=utf8;
-
 DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_category`;
 CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_category` (
   `category_id` int(10) unsigned NOT NULL auto_increment,
@@ -195,6 +197,17 @@ CREATE TABLE `%TABLE_PREFIX%department` (
   KEY `tpl_id` (`tpl_id`)
 ) DEFAULT CHARSET=utf8;
 
+DROP TABLE IF EXISTS `%TABLE_PREFIX%draft`;
+CREATE TABLE `%TABLE_PREFIX%draft` (
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `staff_id` int(11) unsigned NOT NULL,
+  `namespace` varchar(32) NOT NULL DEFAULT '',
+  `body` text NOT NULL,
+  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `updated` timestamp NULL DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) DEFAULT CHARSET=utf8;
+
 DROP TABLE IF EXISTS `%TABLE_PREFIX%email`;
 CREATE TABLE `%TABLE_PREFIX%email` (
   `email_id` int(11) unsigned NOT NULL auto_increment,
@@ -398,13 +411,6 @@ CREATE TABLE `%TABLE_PREFIX%canned_response` (
   KEY `active` (`isenabled`)
 ) DEFAULT CHARSET=utf8;
 
-DROP TABLE IF EXISTS `%TABLE_PREFIX%canned_attachment`;
-CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%canned_attachment` (
-  `canned_id` int(10) unsigned NOT NULL,
-  `file_id` int(10) unsigned NOT NULL,
-  PRIMARY KEY  (`canned_id`,`file_id`)
-) DEFAULT CHARSET=utf8;
-
 DROP TABLE IF EXISTS `%TABLE_PREFIX%session`;
 CREATE TABLE `%TABLE_PREFIX%session` (
   `session_id` varchar(255) collate ascii_general_ci NOT NULL default '',
diff --git a/setup/setup.inc.php b/setup/setup.inc.php
index f0fee2989584117a279d36376066e990b62bb4ce..c68bd7a62a2c9658411f36cd0fe4bd7cd0dee41f 100644
--- a/setup/setup.inc.php
+++ b/setup/setup.inc.php
@@ -15,7 +15,7 @@
 **********************************************************************/
 
 #This  version - changed on every release
-define('THIS_VERSION', '1.7-git');
+define('THIS_VERSION', '1.8-git');
 
 #inits - error reporting.
 $error_reporting = E_ALL & ~E_NOTICE;
diff --git a/tickets.php b/tickets.php
index d1293db874536f9d2edf836b37838a019366ea79..b47ed0f1528335e9ee5eb871fcd8ca3c34d7b975 100644
--- a/tickets.php
+++ b/tickets.php
@@ -17,6 +17,7 @@
 require('secure.inc.php');
 if(!is_object($thisclient) || !$thisclient->isValid()) die('Access denied'); //Double check again.
 require_once(INCLUDE_DIR.'class.ticket.php');
+require_once(INCLUDE_DIR.'class.json.php');
 $ticket=null;
 if($_REQUEST['id']) {
     if(!($ticket=Ticket::lookupByExtId($_REQUEST['id']))) {
@@ -43,9 +44,14 @@ if($_POST && is_object($ticket) && $ticket->getId()):
             $vars = array('message'=>$_POST['message']);
             if($cfg->allowOnlineAttachments() && $_FILES['attachments'])
                 $vars['files'] = AttachmentFile::format($_FILES['attachments'], true);
+            if (isset($_POST['draft_id']))
+                $vars['draft_id'] = $_POST['draft_id'];
 
             if(($msgid=$ticket->postMessage($vars, 'Web'))) {
                 $msg='Message Posted Successfully';
+                // Cleanup drafts for the ticket. If not closed, only clean
+                // for this staff. Else clean all drafts for the ticket.
+                Draft::deleteForNamespace('ticket.client.' . $ticket->getExtId());
             } else {
                 $errors['err']='Unable to post the message. Try again';
             }