From 8000e6f8cebf94fe606f03b77ce2679e686c57d8 Mon Sep 17 00:00:00 2001 From: sunhater Date: Sat, 8 Feb 2014 20:47:00 +0200 Subject: [PATCH 001/125] 3.0-dev I started major version 3 which requires PHP version >= 5.3.0. Things to be done in 3.x versions: - Namespaces support in PHP sources. Default namespace - "kcfinder"; - Remove deprecated magic quotes support; - Replace __autoload() with spl_autoload_register(); - jQuery UI integration; - YUI Compressor integration; --- browse.php | 3 +- config.php | 2 +- core/autoload.php | 65 ++++++++------- core/browser.php | 158 ++++++++++++++++++------------------ core/types/type_img.php | 4 +- core/types/type_mime.php | 4 +- core/uploader.php | 62 +++++--------- css.php | 3 +- doc/README | 2 +- integration/drupal.php | 4 +- js/browser/0bject.js | 2 +- js/browser/clipboard.js | 2 +- js/browser/dropUpload.js | 2 +- js/browser/files.js | 2 +- js/browser/folders.js | 2 +- js/browser/init.js | 2 +- js/browser/joiner.php | 4 +- js/browser/misc.js | 2 +- js/browser/settings.js | 2 +- js/browser/toolbar.js | 2 +- js/helper.js | 2 +- js_localize.php | 3 +- lang/en.php | 2 +- lib/class_image.php | 8 +- lib/class_image_gd.php | 4 +- lib/class_image_gmagick.php | 12 +-- lib/class_image_imagick.php | 10 ++- lib/class_input.php | 86 -------------------- lib/class_zipFolder.php | 4 +- lib/helper_dir.php | 6 +- lib/helper_file.php | 4 +- lib/helper_httpCache.php | 4 +- lib/helper_path.php | 4 +- lib/helper_text.php | 4 +- themes/oxygen/about.txt | 2 +- tpl/tpl_javascript.php | 40 ++++++--- upload.php | 3 +- 37 files changed, 237 insertions(+), 290 deletions(-) delete mode 100644 lib/class_input.php diff --git a/browse.php b/browse.php index 0d00fd8..f23f480 100644 --- a/browse.php +++ b/browse.php @@ -4,7 +4,7 @@ * * @desc Browser calling script * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,7 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; require "core/autoload.php"; $browser = new browser(); $browser->action(); diff --git a/config.php b/config.php index 4b0c005..808b559 100644 --- a/config.php +++ b/config.php @@ -4,7 +4,7 @@ * * @desc Base configuration file * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/core/autoload.php b/core/autoload.php index ae2f4df..d677c41 100644 --- a/core/autoload.php +++ b/core/autoload.php @@ -4,7 +4,7 @@ * * @desc This file is included first, before each other * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -20,10 +20,8 @@ * It's recommended to use constants instead. */ - -// PHP VERSION CHECK -if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) - die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); +if (!preg_match('/^(\d+\.\d+)/', PHP_VERSION, $ver) || ($ver[1] < 5.3)) + die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5.3.0! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); // SAFE MODE CHECK @@ -39,34 +37,32 @@ } -// MAGIC AUTOLOAD CLASSES FUNCTION -function __autoload($class) { - if ($class == "uploader") - require "core/uploader.php"; - elseif ($class == "browser") - require "core/browser.php"; - elseif (file_exists("core/types/$class.php")) - require "core/types/$class.php"; - elseif (file_exists("lib/class_$class.php")) - require "lib/class_$class.php"; - elseif (file_exists("lib/helper_$class.php")) - require "lib/helper_$class.php"; -} +// REGISTER AUTOLOAD FUNCTION +spl_autoload_register(function($path) { + $path = explode("\\", $path); + if (count($path) == 1) + return; -// json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING -if (!function_exists("json_encode")) { + list($ns, $class) = $path; - function kcfinder_json_string_encode($string) { - return '"' . - str_replace('/', "\\/", - str_replace("\t", "\\t", - str_replace("\r", "\\r", - str_replace("\n", "\\n", - str_replace('"', "\\\"", - str_replace("\\", "\\\\", - $string)))))) . '"'; + if ($ns == "kcfinder") { + if ($class == "uploader") + require "core/uploader.php"; + elseif ($class == "browser") + require "core/browser.php"; + elseif (file_exists("core/types/$class.php")) + require "core/types/$class.php"; + elseif (file_exists("lib/class_$class.php")) + require "lib/class_$class.php"; + elseif (file_exists("lib/helper_$class.php")) + require "lib/helper_$class.php"; } +}); + + +// json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING +if (!function_exists("json_encode")) { function json_encode($data) { @@ -76,7 +72,7 @@ function json_encode($data) { // OBJECT if (array_keys($data) !== range(0, count($data) - 1)) { foreach ($data as $key => $val) - $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); + $ret[] = json_encode((string) $key) . ':' . json_encode($val); return "{" . implode(",", $ret) . "}"; // ARRAY @@ -101,7 +97,14 @@ function json_encode($data) { return $data; // STRING - return kcfinder_json_string_encode($data); + return '"' . + str_replace('/', "\\/", + str_replace("\t", "\\t", + str_replace("\r", "\\r", + str_replace("\n", "\\n", + str_replace('"', "\\\"", + str_replace("\\", "\\\\", + $data)))))) . '"'; } } diff --git a/core/browser.php b/core/browser.php index 370fc88..d15456c 100644 --- a/core/browser.php +++ b/core/browser.php @@ -4,7 +4,7 @@ * * @desc Browser actions class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class browser extends uploader { protected $action; protected $thumbsDir; @@ -20,16 +22,16 @@ class browser extends uploader { public function __construct() { parent::__construct(); - if (isset($this->post['dir'])) { - $dir = $this->checkInputDir($this->post['dir'], true, false); - if ($dir === false) unset($this->post['dir']); - $this->post['dir'] = $dir; + if (isset($_POST['dir'])) { + $dir = $this->checkInputDir($_POST['dir'], true, false); + if ($dir === false) unset($_POST['dir']); + $_POST['dir'] = $dir; } - if (isset($this->get['dir'])) { - $dir = $this->checkInputDir($this->get['dir'], true, false); - if ($dir === false) unset($this->get['dir']); - $this->get['dir'] = $dir; + if (isset($_GET['dir'])) { + $dir = $this->checkInputDir($_GET['dir'], true, false); + if ($dir === false) unset($_GET['dir']); + $_GET['dir'] = $dir; } $thumbsDir = $this->config['uploadDir'] . "/" . $this->config['thumbsDir']; @@ -63,15 +65,15 @@ public function __construct() { unlink($file); } - if (isset($this->get['theme']) && - ($this->get['theme'] == basename($this->get['theme'])) && - is_dir("themes/{$this->get['theme']}") + if (isset($_GET['theme']) && + ($_GET['theme'] == basename($_GET['theme'])) && + is_dir("themes/{$_GET['theme']}") ) - $this->config['theme'] = $this->get['theme']; + $this->config['theme'] = $_GET['theme']; } public function action() { - $act = isset($this->get['act']) ? $this->get['act'] : "browser"; + $act = isset($_GET['act']) ? $_GET['act'] : "browser"; if (!method_exists($this, "act_$act")) $act = "browser"; $this->action = $act; @@ -115,11 +117,11 @@ public function action() { } protected function act_browser() { - if (isset($this->get['dir']) && - is_dir("{$this->typeDir}/{$this->get['dir']}") && - is_readable("{$this->typeDir}/{$this->get['dir']}") + if (isset($_GET['dir']) && + is_dir("{$this->typeDir}/{$_GET['dir']}") && + is_readable("{$this->typeDir}/{$_GET['dir']}") ) - $this->session['dir'] = path::normalize("{$this->type}/{$this->get['dir']}"); + $this->session['dir'] = path::normalize("{$this->type}/{$_GET['dir']}"); return $this->output(); } @@ -140,15 +142,15 @@ protected function act_init() { } protected function act_thumb() { - $this->getDir($this->get['dir'], true); - if (!isset($this->get['file']) || !isset($this->get['dir'])) + $this->getDir($_GET['dir'], true); + if (!isset($_GET['file']) || !isset($_GET['dir'])) $this->sendDefaultThumb(); - $file = $this->get['file']; + $file = $_GET['file']; if (basename($file) != $file) $this->sendDefaultThumb(); - $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; + $file = "{$this->thumbsDir}/{$this->type}/{$_GET['dir']}/$file"; if (!is_file($file) || !is_readable($file)) { - $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); + $file = "{$this->config['uploadDir']}/{$this->type}/{$_GET['dir']}/" . basename($file); if (!is_file($file) || !is_readable($file)) $this->sendDefaultThumb($file); $image = image::factory($this->imageDriver, $file); @@ -176,7 +178,7 @@ protected function act_expand() { protected function act_chDir() { $this->postDir(); // Just for existing check - $this->session['dir'] = $this->type . "/" . $this->post['dir']; + $this->session['dir'] = $this->type . "/" . $_POST['dir']; $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); return json_encode(array( 'files' => $this->getFiles($this->session['dir']), @@ -186,13 +188,13 @@ protected function act_chDir() { protected function act_newDir() { if (!$this->config['access']['dirs']['create'] || - !isset($this->post['dir']) || - !isset($this->post['newDir']) + !isset($_POST['dir']) || + !isset($_POST['newDir']) ) $this->errorMsg("Unknown error."); $dir = $this->postDir(); - $newDir = $this->normalizeDirname(trim($this->post['newDir'])); + $newDir = $this->normalizeDirname(trim($_POST['newDir'])); if (!strlen($newDir)) $this->errorMsg("Please enter new folder name."); if (preg_match('/[\/\\\\]/s', $newDir)) @@ -208,13 +210,13 @@ protected function act_newDir() { protected function act_renameDir() { if (!$this->config['access']['dirs']['rename'] || - !isset($this->post['dir']) || - !isset($this->post['newName']) + !isset($_POST['dir']) || + !isset($_POST['newName']) ) $this->errorMsg("Unknown error."); $dir = $this->postDir(); - $newName = $this->normalizeDirname(trim($this->post['newName'])); + $newName = $this->normalizeDirname(trim($_POST['newName'])); if (!strlen($newName)) $this->errorMsg("Please enter new folder name."); if (preg_match('/[\/\\\\]/s', $newName)) @@ -223,7 +225,7 @@ protected function act_renameDir() { $this->errorMsg("Folder name shouldn't begins with '.'"); if (!@rename($dir, dirname($dir) . "/$newName")) $this->errorMsg("Cannot rename the folder."); - $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; + $thumbDir = "$this->thumbsTypeDir/{$_POST['dir']}"; if (is_dir($thumbDir)) @rename($thumbDir, dirname($thumbDir) . "/$newName"); return json_encode(array('name' => $newName)); @@ -231,8 +233,8 @@ protected function act_renameDir() { protected function act_deleteDir() { if (!$this->config['access']['dirs']['delete'] || - !isset($this->post['dir']) || - !strlen(trim($this->post['dir'])) + !isset($_POST['dir']) || + !strlen(trim($_POST['dir'])) ) $this->errorMsg("Unknown error."); @@ -244,14 +246,14 @@ protected function act_deleteDir() { if (is_array($result) && count($result)) $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result))); - $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; + $thumbDir = "$this->thumbsTypeDir/{$_POST['dir']}"; if (is_dir($thumbDir)) dir::prune($thumbDir); return true; } protected function act_upload() { if (!$this->config['access']['files']['upload'] || - !isset($this->post['dir']) + !isset($_POST['dir']) ) $this->errorMsg("Unknown error."); @@ -276,9 +278,9 @@ protected function act_upload() { protected function act_download() { $dir = $this->postDir(); - if (!isset($this->post['dir']) || - !isset($this->post['file']) || - (false === ($file = "$dir/{$this->post['file']}")) || + if (!isset($_POST['dir']) || + !isset($_POST['file']) || + (false === ($file = "$dir/{$_POST['file']}")) || !file_exists($file) || !is_readable($file) ) $this->errorMsg("Unknown error."); @@ -288,7 +290,7 @@ protected function act_download() { header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); header("Content-Type: application/octet-stream"); - header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $this->post['file']) . '"'); + header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $_POST['file']) . '"'); header("Content-Transfer-Encoding:­ binary"); header("Content-Length: " . filesize($file)); readfile($file); @@ -298,23 +300,23 @@ protected function act_download() { protected function act_rename() { $dir = $this->postDir(); if (!$this->config['access']['files']['rename'] || - !isset($this->post['dir']) || - !isset($this->post['file']) || - !isset($this->post['newName']) || - (false === ($file = "$dir/{$this->post['file']}")) || + !isset($_POST['dir']) || + !isset($_POST['file']) || + !isset($_POST['newName']) || + (false === ($file = "$dir/{$_POST['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) ) $this->errorMsg("Unknown error."); if (isset($this->config['denyExtensionRename']) && $this->config['denyExtensionRename'] && - (file::getExtension($this->post['file'], true) !== - file::getExtension($this->post['newName'], true) + (file::getExtension($_POST['file'], true) !== + file::getExtension($_POST['newName'], true) ) ) $this->errorMsg("You cannot rename the extension of files!"); - $newName = $this->normalizeFilename(trim($this->post['newName'])); + $newName = $this->normalizeFilename(trim($_POST['newName'])); if (!strlen($newName)) $this->errorMsg("Please enter new file name."); if (preg_match('/[\/\\\\]/s', $newName)) @@ -330,8 +332,8 @@ protected function act_rename() { if (!@rename($file, $newName)) $this->errorMsg("Unknown error."); - $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - $thumbFile = "$thumbDir/{$this->post['file']}"; + $thumbDir = "{$this->thumbsTypeDir}/{$_POST['dir']}"; + $thumbFile = "$thumbDir/{$_POST['file']}"; if (file_exists($thumbFile)) @rename($thumbFile, "$thumbDir/" . basename($newName)); @@ -341,15 +343,15 @@ protected function act_rename() { protected function act_delete() { $dir = $this->postDir(); if (!$this->config['access']['files']['delete'] || - !isset($this->post['dir']) || - !isset($this->post['file']) || - (false === ($file = "$dir/{$this->post['file']}")) || + !isset($_POST['dir']) || + !isset($_POST['file']) || + (false === ($file = "$dir/{$_POST['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) || !@unlink($file) ) $this->errorMsg("Unknown error."); - $thumb = "{$this->thumbsTypeDir}/{$this->post['dir']}/{$this->post['file']}"; + $thumb = "{$this->thumbsTypeDir}/{$_POST['dir']}/{$_POST['file']}"; if (file_exists($thumb)) @unlink($thumb); return true; } @@ -357,15 +359,15 @@ protected function act_delete() { protected function act_cp_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['copy'] || - !isset($this->post['dir']) || + !isset($_POST['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || - !isset($this->post['files']) || !is_array($this->post['files']) || - !count($this->post['files']) + !isset($_POST['files']) || !is_array($_POST['files']) || + !count($_POST['files']) ) $this->errorMsg("Unknown error."); $error = array(); - foreach($this->post['files'] as $file) { + foreach($_POST['files'] as $file) { $file = path::normalize($file); if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); @@ -392,7 +394,7 @@ protected function act_cp_cbd() { @chmod("$dir/$base", $this->config['filePerms']); $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { - $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; + $toThumb = "{$this->thumbsTypeDir}/{$_POST['dir']}"; if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); $toThumb .= "/$base"; @@ -408,15 +410,15 @@ protected function act_cp_cbd() { protected function act_mv_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['move'] || - !isset($this->post['dir']) || + !isset($_POST['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || - !isset($this->post['files']) || !is_array($this->post['files']) || - !count($this->post['files']) + !isset($_POST['files']) || !is_array($_POST['files']) || + !count($_POST['files']) ) $this->errorMsg("Unknown error."); $error = array(); - foreach($this->post['files'] as $file) { + foreach($_POST['files'] as $file) { $file = path::normalize($file); if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); @@ -443,7 +445,7 @@ protected function act_mv_cbd() { @chmod("$dir/$base", $this->config['filePerms']); $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { - $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; + $toThumb = "{$this->thumbsTypeDir}/{$_POST['dir']}"; if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); $toThumb .= "/$base"; @@ -458,14 +460,14 @@ protected function act_mv_cbd() { protected function act_rm_cbd() { if (!$this->config['access']['files']['delete'] || - !isset($this->post['files']) || - !is_array($this->post['files']) || - !count($this->post['files']) + !isset($_POST['files']) || + !is_array($_POST['files']) || + !count($_POST['files']) ) $this->errorMsg("Unknown error."); $error = array(); - foreach($this->post['files'] as $file) { + foreach($_POST['files'] as $file) { $file = path::normalize($file); if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); @@ -490,7 +492,7 @@ protected function act_rm_cbd() { protected function act_downloadDir() { $dir = $this->postDir(); - if (!isset($this->post['dir']) || $this->config['denyZipDownload']) + if (!isset($_POST['dir']) || $this->config['denyZipDownload']) $this->errorMsg("Unknown error."); $filename = basename($dir) . ".zip"; do { @@ -508,15 +510,15 @@ protected function act_downloadDir() { protected function act_downloadSelected() { $dir = $this->postDir(); - if (!isset($this->post['dir']) || - !isset($this->post['files']) || - !is_array($this->post['files']) || + if (!isset($_POST['dir']) || + !isset($_POST['files']) || + !is_array($_POST['files']) || $this->config['denyZipDownload'] ) $this->errorMsg("Unknown error."); $zipFiles = array(); - foreach ($this->post['files'] as $file) { + foreach ($_POST['files'] as $file) { $file = path::normalize($file); if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) continue; @@ -547,14 +549,14 @@ protected function act_downloadSelected() { } protected function act_downloadClipboard() { - if (!isset($this->post['files']) || - !is_array($this->post['files']) || + if (!isset($_POST['files']) || + !is_array($_POST['files']) || $this->config['denyZipDownload'] ) $this->errorMsg("Unknown error."); $zipFiles = array(); - foreach ($this->post['files'] as $file) { + foreach ($_POST['files'] as $file) { $file = path::normalize($file); if ((substr($file, 0, 1) == ".")) continue; @@ -780,8 +782,8 @@ protected function getTree($dir, $index=0) { protected function postDir($existent=true) { $dir = $this->typeDir; - if (isset($this->post['dir'])) - $dir .= "/" . $this->post['dir']; + if (isset($_POST['dir'])) + $dir .= "/" . $_POST['dir']; if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); return $dir; @@ -789,8 +791,8 @@ protected function postDir($existent=true) { protected function getDir($existent=true) { $dir = $this->typeDir; - if (isset($this->get['dir'])) - $dir .= "/" . $this->get['dir']; + if (isset($_GET['dir'])) + $dir .= "/" . $_GET['dir']; if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); return $dir; diff --git a/core/types/type_img.php b/core/types/type_img.php index a2089b8..9aefbc8 100644 --- a/core/types/type_img.php +++ b/core/types/type_img.php @@ -4,7 +4,7 @@ * * @desc Image detection class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class type_img { public function checkFile($file, array $config) { diff --git a/core/types/type_mime.php b/core/types/type_mime.php index 0b9a0d0..7e535dc 100644 --- a/core/types/type_mime.php +++ b/core/types/type_mime.php @@ -4,7 +4,7 @@ * * @desc MIME type detection class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class type_mime { public function checkFile($file, array $config) { diff --git a/core/uploader.php b/core/uploader.php index 42414fc..92547d0 100644 --- a/core/uploader.php +++ b/core/uploader.php @@ -4,7 +4,7 @@ * * @desc Uploader class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,10 +12,12 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class uploader { /** Release version */ - const VERSION = "2.52"; + const VERSION = "3.0-dev"; /** Config session-overrided settings * @var array */ @@ -80,18 +82,6 @@ class uploader { * @var array */ protected $labels = array(); -/** Contain unprocessed $_GET array. Please use this instead of $_GET - * @var array */ - protected $get; - -/** Contain unprocessed $_POST array. Please use this instead of $_POST - * @var array */ - protected $post; - -/** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE - * @var array */ - protected $cookie; - /** Session array. Please use this property instead of $_SESSION * @var array */ protected $session; @@ -109,21 +99,11 @@ public function __get($property) { public function __construct() { - // DISABLE MAGIC QUOTES - if (function_exists('set_magic_quotes_runtime')) - @set_magic_quotes_runtime(false); - - // INPUT INIT - $input = new input(); - $this->get = &$input->get; - $this->post = &$input->post; - $this->cookie = &$input->cookie; - // SET CMS INTEGRATION ATTRIBUTE - if (isset($this->get['cms']) && - in_array($this->get['cms'], array("drupal")) + if (isset($_GET['cms']) && + in_array($_GET['cms'], array("drupal")) ) - $this->cms = $this->get['cms']; + $this->cms = $_GET['cms']; // LINKING UPLOADED FILE if (count($_FILES)) @@ -183,10 +163,10 @@ public function __construct() { $firstType = array_keys($this->types); $firstType = $firstType[0]; $this->type = ( - isset($this->get['type']) && - isset($this->types[$this->get['type']]) + isset($_GET['type']) && + isset($this->types[$_GET['type']]) ) - ? $this->get['type'] : $firstType; + ? $_GET['type'] : $firstType; // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS if (is_array($this->types[$this->type])) { @@ -247,10 +227,10 @@ public function __construct() { @mkdir($this->config['uploadDir'], $this->config['dirPerms']); // HOST APPLICATIONS INIT - if (isset($this->get['CKEditorFuncNum'])) - $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum']; - if (isset($this->get['opener']) && - (strtolower($this->get['opener']) == "tinymce") && + if (isset($_GET['CKEditorFuncNum'])) + $this->opener['CKEditor']['funcNum'] = $_GET['CKEditorFuncNum']; + if (isset($_GET['opener']) && + (strtolower($_GET['opener']) == "tinymce") && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath']) ) @@ -258,11 +238,11 @@ public function __construct() { // LOCALIZATION foreach ($this->langInputNames as $key) - if (isset($this->get[$key]) && - preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && - file_exists("lang/" . strtolower($this->get[$key]) . ".php") + if (isset($_GET[$key]) && + preg_match('/^[a-z][a-z\._\-]*$/i', $_GET[$key]) && + file_exists("lang/" . strtolower($_GET[$key]) . ".php") ) { - $this->lang = $this->get[$key]; + $this->lang = $_GET[$key]; break; } $this->localize($this->lang); @@ -304,8 +284,8 @@ public function upload() { $message = ""; $dir = "{$this->typeDir}/"; - if (isset($this->get['dir']) && - (false !== ($gdir = $this->checkInputDir($this->get['dir']))) + if (isset($_GET['dir']) && + (false !== ($gdir = $this->checkInputDir($_GET['dir']))) ) { $udir = path::normalize("$dir$gdir"); if (substr($udir, 0, strlen($dir)) !== $dir) @@ -404,7 +384,7 @@ protected function checkUploadedFile(array $aFile=null) { array('size' => ini_get('upload_max_filesize'))) : ( ($file['error'] == UPLOAD_ERR_FORM_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", - array('size' => $this->get['MAX_FILE_SIZE'])) : ( + array('size' => $_GET['MAX_FILE_SIZE'])) : ( ($file['error'] == UPLOAD_ERR_PARTIAL) ? $this->label("The uploaded file was only partially uploaded.") : ( ($file['error'] == UPLOAD_ERR_NO_FILE) ? diff --git a/css.php b/css.php index fcf0830..291eb92 100644 --- a/css.php +++ b/css.php @@ -4,7 +4,7 @@ * * @desc Base CSS definitions * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,7 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; require "core/autoload.php"; $mtime = @filemtime(__FILE__); if ($mtime) httpCache::checkMTime($mtime); diff --git a/doc/README b/doc/README index 2ddaad8..830c9d4 100644 --- a/doc/README +++ b/doc/README @@ -1,4 +1,4 @@ -[===========================< KCFinder 2.52 >================================] +[===========================< KCFinder 3.0-dev >================================] [ ] [ Copyright 2010-2014 KCFinder Project ] [ http://kcfinder.sunhater.com ] diff --git a/integration/drupal.php b/integration/drupal.php index 9791138..d0787a3 100644 --- a/integration/drupal.php +++ b/integration/drupal.php @@ -4,7 +4,7 @@ * * @desc CMS integration code: Drupal * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Dany Alejandro Cabrera * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -110,6 +110,4 @@ function CheckAuthentication($drupal_path) { CheckAuthentication(get_drupal_path()); -spl_autoload_register('__autoload'); - ?> \ No newline at end of file diff --git a/js/browser/0bject.js b/js/browser/0bject.js index 521b1e4..9881df8 100644 --- a/js/browser/0bject.js +++ b/js/browser/0bject.js @@ -4,7 +4,7 @@ * * @desc Base JavaScript object properties * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/clipboard.js b/js/browser/clipboard.js index c97af84..685656b 100644 --- a/js/browser/clipboard.js +++ b/js/browser/clipboard.js @@ -4,7 +4,7 @@ * * @desc Clipboard functionality * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/dropUpload.js b/js/browser/dropUpload.js index f7e28f8..a222d30 100644 --- a/js/browser/dropUpload.js +++ b/js/browser/dropUpload.js @@ -4,7 +4,7 @@ * * @desc Upload files using drag and drop * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Forum user (updated by Pavel Tzonkov) * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/files.js b/js/browser/files.js index 2d7707c..afd1d7b 100644 --- a/js/browser/files.js +++ b/js/browser/files.js @@ -4,7 +4,7 @@ * * @desc File related functionality * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/folders.js b/js/browser/folders.js index e170cc4..3256241 100644 --- a/js/browser/folders.js +++ b/js/browser/folders.js @@ -4,7 +4,7 @@ * * @desc Folder related functionality * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/init.js b/js/browser/init.js index ab8df3d..23bb3f5 100644 --- a/js/browser/init.js +++ b/js/browser/init.js @@ -4,7 +4,7 @@ * * @desc Object initializations * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/joiner.php b/js/browser/joiner.php index f587098..5573ed4 100644 --- a/js/browser/joiner.php +++ b/js/browser/joiner.php @@ -4,7 +4,7 @@ * * @desc Join all JavaScript files in current directory * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + chdir(".."); // For compatibility chdir(".."); require "lib/helper_httpCache.php"; diff --git a/js/browser/misc.js b/js/browser/misc.js index 5c1a6d8..2a75af2 100644 --- a/js/browser/misc.js +++ b/js/browser/misc.js @@ -4,7 +4,7 @@ * * @desc Miscellaneous functionality * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/settings.js b/js/browser/settings.js index 30f98b6..09f9506 100644 --- a/js/browser/settings.js +++ b/js/browser/settings.js @@ -4,7 +4,7 @@ * * @desc Settings panel functionality * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/browser/toolbar.js b/js/browser/toolbar.js index e3fc3d7..4d7eaa2 100644 --- a/js/browser/toolbar.js +++ b/js/browser/toolbar.js @@ -4,7 +4,7 @@ * * @desc Toolbar functionality * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js/helper.js b/js/helper.js index 264afb6..1b040d7 100644 --- a/js/helper.js +++ b/js/helper.js @@ -2,7 +2,7 @@ * * @desc Helper object * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/js_localize.php b/js_localize.php index 94235b2..35a3107 100644 --- a/js_localize.php +++ b/js_localize.php @@ -4,7 +4,7 @@ * * @desc Load language labels into JavaScript * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,7 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; require "core/autoload.php"; if (function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(false); diff --git a/lang/en.php b/lang/en.php index c311c7a..b98cd3b 100644 --- a/lang/en.php +++ b/lang/en.php @@ -4,7 +4,7 @@ * * @desc Default English localization * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 diff --git a/lib/class_image.php b/lib/class_image.php index 8dec4c2..026bdf3 100644 --- a/lib/class_image.php +++ b/lib/class_image.php @@ -4,7 +4,7 @@ * * @desc Abstract image driver class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + abstract class image { const DEFAULT_JPEG_QUALITY = 75; @@ -76,7 +78,7 @@ public function __construct($image, array $options=array()) { * @return object */ final static function factory($driver, $image, array $options=array()) { - $class = "image_$driver"; + $class = __NAMESPACE__ . "\\image_$driver"; return new $class($image, $options); } @@ -90,7 +92,7 @@ final static function getDriver(array $drivers=array('gd')) { foreach ($drivers as $driver) { if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) continue; - $class = "image_$driver"; + $class = __NAMESPACE__ . "\\image_$driver"; if (class_exists($class) && method_exists($class, "available")) { eval("\$avail = $class::available();"); if ($avail) return $driver; diff --git a/lib/class_image_gd.php b/lib/class_image_gd.php index a79bd79..51260f7 100644 --- a/lib/class_image_gd.php +++ b/lib/class_image_gd.php @@ -4,7 +4,7 @@ * * @desc GD image driver class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class image_gd extends image { diff --git a/lib/class_image_gmagick.php b/lib/class_image_gmagick.php index 7c7e02e..ce6f545 100644 --- a/lib/class_image_gmagick.php +++ b/lib/class_image_gmagick.php @@ -4,7 +4,7 @@ * * @desc GraphicsMagick image driver class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class image_gmagick extends image { static $MIMES = array( @@ -56,7 +58,7 @@ public function resizeFit($width, $height, $background=false) {// $this->image->setImageBackgroundColor($background); $x = round(($width - $w) / 2); $y = round(($height - $h) / 2); - $img = new Gmagick(); + $img = new \Gmagick(); $img->newImage($width, $height, $background); $img->compositeImage($this->image, 1, $x, $y); } catch (Exception $e) { @@ -152,7 +154,7 @@ public function flipVertical() { public function watermark($file, $left=false, $top=false) { try { - $wm = new Gmagick($file); + $wm = new \Gmagick($file); $w = $wm->getImageWidth(); $h = $wm->getImageHeight(); } catch (Exception $e) { @@ -187,7 +189,7 @@ public function watermark($file, $left=false, $top=false) { protected function getBlankImage($width, $height) { try { - $img = new Gmagick(); + $img = new \Gmagick(); $img->newImage($width, $height, "none"); } catch (Exception $e) { return false; @@ -215,7 +217,7 @@ protected function getImage($image, &$width, &$height) { } elseif (is_string($image)) { try { - $image = new Gmagick($image); + $image = new \Gmagick($image); $w = $image->getImageWidth(); $h = $image->getImageHeight(); } catch (Exception $e) { diff --git a/lib/class_image_imagick.php b/lib/class_image_imagick.php index d492769..1b31b9a 100644 --- a/lib/class_image_imagick.php +++ b/lib/class_image_imagick.php @@ -4,7 +4,7 @@ * * @desc ImageMagick image driver class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class image_imagick extends image { static $MIMES = array( @@ -147,7 +149,7 @@ public function flipVertical() { public function watermark($file, $left=false, $top=false) { try { - $wm = new Imagick($file); + $wm = new \Imagick($file); $size = $wm->getImageGeometry(); } catch (Exception $e) { return false; @@ -183,7 +185,7 @@ public function watermark($file, $left=false, $top=false) { protected function getBlankImage($width, $height) { try { - $img = new Imagick(); + $img = new \Imagick(); $img->newImage($width, $height, "none"); $img->setImageCompressionQuality(100); } catch (Exception $e) { @@ -217,7 +219,7 @@ protected function getImage($image, &$width, &$height) { } elseif (is_string($image)) { try { - $image = new Imagick($image); + $image = new \Imagick($image); $image->setImageCompressionQuality(100); $size = $image->getImageGeometry(); } catch (Exception $e) { diff --git a/lib/class_input.php b/lib/class_input.php deleted file mode 100644 index 34e159a..0000000 --- a/lib/class_input.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2014 KCFinder Project - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 - * @link http://kcfinder.sunhater.com - */ - -class input { - - /** Filtered $_GET array - * @var array */ - public $get; - - /** Filtered $_POST array - * @var array */ - public $post; - - /** Filtered $_COOKIE array - * @var array */ - public $cookie; - - /** magic_quetes_gpc ini setting flag - * @var bool */ - protected $magic_quotes_gpc; - - /** magic_quetes_sybase ini setting flag - * @var bool */ - protected $magic_quotes_sybase; - - public function __construct() { - $this->magic_quotes_gpc = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); - $this->magic_quotes_sybase = ini_get('magic_quotes_sybase'); - $this->magic_quotes_sybase = $this->magic_quotes_sybase - ? !in_array(strtolower(trim($this->magic_quotes_sybase)), - array('off', 'no', 'false')) - : false; - $_GET = $this->filter($_GET); - $_POST = $this->filter($_POST); - $_COOKIE = $this->filter($_COOKIE); - $this->get = &$_GET; - $this->post = &$_POST; - $this->cookie = &$_COOKIE; - } - - /** Magic method to get non-public properties like public. - * @param string $property - * @return mixed */ - - public function __get($property) { - return property_exists($this, $property) ? $this->$property : null; - } - - /** Filter the given subject. If magic_quotes_gpc and/or magic_quotes_sybase - * ini settings are turned on, the method will remove backslashes from some - * escaped characters. If the subject is an array, elements with non- - * alphanumeric keys will be removed - * @param mixed $subject - * @return mixed */ - - public function filter($subject) { - if ($this->magic_quotes_gpc) { - if (is_array($subject)) { - foreach ($subject as $key => $val) - if (!preg_match('/^[a-z\d_]+$/si', $key)) - unset($subject[$key]); - else - $subject[$key] = $this->filter($val); - } elseif (is_scalar($subject)) - $subject = $this->magic_quotes_sybase - ? str_replace("\\'", "'", $subject) - : stripslashes($subject); - - } - - return $subject; - } -} - -?> \ No newline at end of file diff --git a/lib/class_zipFolder.php b/lib/class_zipFolder.php index 124304f..6027483 100644 --- a/lib/class_zipFolder.php +++ b/lib/class_zipFolder.php @@ -5,7 +5,7 @@ * * @desc Directory to ZIP file archivator * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -13,6 +13,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class zipFolder { protected $zip; protected $root; diff --git a/lib/helper_dir.php b/lib/helper_dir.php index a0a8689..b19b8dd 100644 --- a/lib/helper_dir.php +++ b/lib/helper_dir.php @@ -4,7 +4,7 @@ * * @desc Directory helper class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class dir { /** Checks if the given directory is really writable. The standard PHP @@ -141,7 +143,7 @@ static function content($dir, array $options=null) { $files[] = $options['addPath'] ? "$dir/$file" : $file; } closedir($dh); - usort($files, array("dir", "fileSort")); + usort($files, array(__NAMESPACE__ . "\\dir", "fileSort")); return $files; } diff --git a/lib/helper_file.php b/lib/helper_file.php index 3dceb95..e7c5e4f 100644 --- a/lib/helper_file.php +++ b/lib/helper_file.php @@ -4,7 +4,7 @@ * * @desc File helper class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class file { static $MIME = array( diff --git a/lib/helper_httpCache.php b/lib/helper_httpCache.php index 9e51488..6db157c 100644 --- a/lib/helper_httpCache.php +++ b/lib/helper_httpCache.php @@ -4,7 +4,7 @@ * * @desc HTTP cache helper class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class httpCache { const DEFAULT_TYPE = "text/html"; const DEFAULT_EXPIRE = 604800; // in seconds diff --git a/lib/helper_path.php b/lib/helper_path.php index aeb87f6..6cf9eb7 100644 --- a/lib/helper_path.php +++ b/lib/helper_path.php @@ -4,7 +4,7 @@ * * @desc Path helper class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class path { /** Get the absolute URL path of the given one. Returns FALSE if the URL diff --git a/lib/helper_text.php b/lib/helper_text.php index e9cbb83..5790edc 100644 --- a/lib/helper_text.php +++ b/lib/helper_text.php @@ -4,7 +4,7 @@ * * @desc Text processing helper class * @package KCFinder - * @version 2.52 + * @version 3.0-dev * @author Pavel Tzonkov * @copyright 2010-2014 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 @@ -12,6 +12,8 @@ * @link http://kcfinder.sunhater.com */ +namespace kcfinder; + class text { /** Replace repeated white spaces to single space diff --git a/themes/oxygen/about.txt b/themes/oxygen/about.txt index 41cf073..aa1cec8 100644 --- a/themes/oxygen/about.txt +++ b/themes/oxygen/about.txt @@ -5,7 +5,7 @@ http://www.kde.org Theme Details: Project: KCFinder - http://kcfinder.sunhater.com -Version: 2.52 +Version: 3.0-dev Author: Pavel Tzonkov Licenses: GPLv2 - http://www.opensource.org/licenses/gpl-2.0.php LGPLv2 - http://www.opensource.org/licenses/lgpl-2.1.php diff --git a/tpl/tpl_javascript.php b/tpl/tpl_javascript.php index 0d8aeaa..11ee99f 100644 --- a/tpl/tpl_javascript.php +++ b/tpl/tpl_javascript.php @@ -1,15 +1,25 @@ + -opener['TinyMCE']) && $this->opener['TinyMCE']): ?> +opener['TinyMCE']) && $this->opener['TinyMCE']): +?> - -config['theme']}/init.js")): ?> +config['theme']}/init.js")): +?> - + - - - - + opener['TinyMCE']) && $this->opener['TinyMCE']): From 5438055b227d1204892453d707b5fbf46e3c3916 Mon Sep 17 00:00:00 2001 From: sunhater Date: Fri, 14 Feb 2014 22:03:21 +0200 Subject: [PATCH 007/125] 3.0-dev update2 Minify JS & CSS updates; Favicon added' --- browse.php | 2 +- {css => cache}/base.css | 0 cache/base.js | 2986 +++++++++++++++++++++++++++++++++ cache/theme_dark.css | 1 + cache/theme_dark.js | 1 + cache/theme_oxygen.css | 566 +++++++ cache/theme_oxygen.js | 3 + config.php | 3 +- core/autoload.php | 184 +- core/bootstrap.php | 181 ++ core/{ => class}/browser.php | 0 core/class/minifier.php | 96 ++ core/{ => class}/uploader.php | 2 +- css/000.base.css | 225 +++ css/index.php | 67 +- favicon.ico | Bin 0 -> 1406 bytes index.php | 5 + js/040.browser.js | 0 js/index.php | 69 +- themes/dark/css.php | 11 + themes/dark/init.js | 3 +- themes/dark/js.php | 11 + themes/oxygen/css.php | 11 + themes/oxygen/init.js | 3 +- themes/oxygen/js.php | 11 + tpl/tpl_browser.php | 1 + tpl/tpl_css.php | 2 +- tpl/tpl_javascript.php | 4 +- upload.php | 2 +- 29 files changed, 4133 insertions(+), 317 deletions(-) rename {css => cache}/base.css (100%) create mode 100644 cache/base.js create mode 100644 cache/theme_dark.css create mode 100644 cache/theme_dark.js create mode 100644 cache/theme_oxygen.css create mode 100644 cache/theme_oxygen.js create mode 100644 core/bootstrap.php rename core/{ => class}/browser.php (100%) create mode 100644 core/class/minifier.php rename core/{ => class}/uploader.php (99%) create mode 100644 css/000.base.css create mode 100644 favicon.ico create mode 100644 index.php create mode 100644 js/040.browser.js create mode 100644 themes/dark/css.php create mode 100644 themes/dark/js.php create mode 100644 themes/oxygen/css.php create mode 100644 themes/oxygen/js.php diff --git a/browse.php b/browse.php index 2f4911e..6575ca2 100644 --- a/browse.php +++ b/browse.php @@ -12,7 +12,7 @@ * @link http://kcfinder.sunhater.com */ -require "core/autoload.php"; +require "core/bootstrap.php"; $browser = "kcfinder\\browser"; // To execute core/autoload.php on older $browser = new $browser(); // PHP versions (even PHP 4) $browser->action(); diff --git a/css/base.css b/cache/base.css similarity index 100% rename from css/base.css rename to cache/base.css diff --git a/cache/base.js b/cache/base.js new file mode 100644 index 0000000..795265a --- /dev/null +++ b/cache/base.js @@ -0,0 +1,2986 @@ +/*! + * jQuery JavaScript Library v1.6.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu May 12 15:04:36 2011 -0400 + */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,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=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,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=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};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=n.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.6.1",length:0,size:function(){return this.length},toArray:function(){return D.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)?C.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(),y.done(a);return this},eq:function(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(D.apply(this,arguments),"slice",D.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:C,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(;j0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=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=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.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}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0: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=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?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]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},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.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)}})),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 x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem +)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.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!!k(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 bc[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=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||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=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.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:[]}},l.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&&(l.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.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.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 k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-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||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());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(W(c[0])||W(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),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};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
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},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){return this.each(function(){f(this).wrapAll(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(arguments[0]);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(arguments[0]).toArray());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){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.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;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.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("
").append(c.replace(bO,"")).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||bP.test(this.nodeName)||bJ.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(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},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}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),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?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),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._Deferred(),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=bI.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.done,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(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.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]!=="*"?", */*; 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=b$(bV,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){status<2?w(-1,z):f.error(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(bE,"+")}}),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=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";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),m.text=h.responseText;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,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);/*! + * jquery.event.drag - v 2.0.0 + * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com + * Open Source MIT License - http://threedubmedia.com/code/license + */ +(function(f){f.fn.drag=function(b,a,d){var e=typeof b=="string"?b:"",k=f.isFunction(b)?b:f.isFunction(a)?a:null;if(e.indexOf("drag")!==0)e="drag"+e;d=(b==k?a:d)||{};return k?this.bind(e,d,k):this.trigger(e)};var i=f.event,h=i.special,c=h.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",livekey:"livedrag",add:function(b){var a=f.data(this,c.datakey),d=b.data||{};a.related+=1;if(!a.live&&b.selector){a.live=true;i.add(this,"draginit."+ c.livekey,c.delegate)}f.each(c.defaults,function(e){if(d[e]!==undefined)a[e]=d[e]})},remove:function(){f.data(this,c.datakey).related-=1},setup:function(){if(!f.data(this,c.datakey)){var b=f.extend({related:0},c.defaults);f.data(this,c.datakey,b);i.add(this,"mousedown",c.init,b);this.attachEvent&&this.attachEvent("ondragstart",c.dontstart)}},teardown:function(){if(!f.data(this,c.datakey).related){f.removeData(this,c.datakey);i.remove(this,"mousedown",c.init);i.remove(this,"draginit",c.delegate);c.textselect(true); this.detachEvent&&this.detachEvent("ondragstart",c.dontstart)}},init:function(b){var a=b.data,d;if(!(a.which>0&&b.which!=a.which))if(!f(b.target).is(a.not))if(!(a.handle&&!f(b.target).closest(a.handle,b.currentTarget).length)){a.propagates=1;a.interactions=[c.interaction(this,a)];a.target=b.target;a.pageX=b.pageX;a.pageY=b.pageY;a.dragging=null;d=c.hijack(b,"draginit",a);if(a.propagates){if((d=c.flatten(d))&&d.length){a.interactions=[];f.each(d,function(){a.interactions.push(c.interaction(this,a))})}a.propagates= a.interactions.length;a.drop!==false&&h.drop&&h.drop.handler(b,a);c.textselect(false);i.add(document,"mousemove mouseup",c.handler,a);return false}}},interaction:function(b,a){return{drag:b,callback:new c.callback,droppable:[],offset:f(b)[a.relative?"position":"offset"]()||{top:0,left:0}}},handler:function(b){var a=b.data;switch(b.type){case !a.dragging&&"mousemove":if(Math.pow(b.pageX-a.pageX,2)+Math.pow(b.pageY-a.pageY,2) + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +var _ = function(id) { + return document.getElementById(id); +}; + +_.nopx = function(val) { + return parseInt(val.replace(/^(\d+)px$/, "$1")); +}; + +_.unselect = function() { + if (document.selection && document.selection.empty) + document.selection.empty() ; + else if (window.getSelection) { + var sel = window.getSelection(); + if (sel && sel.removeAllRanges) + sel.removeAllRanges(); + } +}; + +_.selection = function(field, start, end) { + if (field.createTextRange) { + var selRange = field.createTextRange(); + selRange.collapse(true); + selRange.moveStart('character', start); + selRange.moveEnd('character', end-start); + selRange.select(); + } else if (field.setSelectionRange) { + field.setSelectionRange(start, end); + } else if (field.selectionStart) { + field.selectionStart = start; + field.selectionEnd = end; + } + field.focus(); +}; + +_.htmlValue = function(value) { + return value + .replace(/\&/g, "&") + .replace(/\"/g, """) + .replace(/\'/g, "'"); +}; + +_.htmlData = function(value) { + return value + .replace(/\&/g, "&") + .replace(/\/g, ">") + .replace(/\ /g, " "); +} + +_.jsValue = function(value) { + return value + .replace(/\\/g, "\\\\") + .replace(/\r?\n/, "\\\n") + .replace(/\"/g, "\\\"") + .replace(/\'/g, "\\'"); +}; + +_.basename = function(path) { + var expr = /^.*\/([^\/]+)\/?$/g; + return expr.test(path) + ? path.replace(expr, "$1") + : path; +}; + +_.dirname = function(path) { + var expr = /^(.*)\/[^\/]+\/?$/g; + return expr.test(path) + ? path.replace(expr, "$1") + : ''; +}; + +_.inArray = function(needle, arr) { + if ((typeof arr == 'undefined') || !arr.length || !arr.push) + return false; + for (var i = 0; i < arr.length; i++) + if (arr[i] == needle) + return true; + return false; +}; + +_.getFileExtension = function(filename, toLower) { + if (typeof(toLower) == 'undefined') toLower = true; + if (/^.*\.[^\.]*$/.test(filename)) { + var ext = filename.replace(/^.*\.([^\.]*)$/, "$1"); + return toLower ? ext.toLowerCase(ext) : ext; + } else + return ""; +}; + +_.escapeDirs = function(path) { + var fullDirExpr = /^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/, + prefix = ""; + if (fullDirExpr.test(path)) { + var port = path.replace(fullDirExpr, "$4"); + prefix = path.replace(fullDirExpr, "$1://$2") + if (port.length) + prefix += ":" + port; + prefix += "/"; + path = path.replace(fullDirExpr, "$5"); + } + + var dirs = path.split('/'); + var escapePath = ''; + for (var i = 0; i < dirs.length; i++) + escapePath += encodeURIComponent(dirs[i]) + '/'; + + return prefix + escapePath.substr(0, escapePath.length - 1); +}; + +_.outerSpace = function(selector, type, mbp) { + if (!mbp) mbp = "mbp"; + var r = 0; + if (/m/i.test(mbp)) { + var m = _.nopx($(selector).css('margin-' + type)); + if (m) r += m; + } + if (/b/i.test(mbp)) { + var b = _.nopx($(selector).css('border-' + type + '-width')); + if (b) r += b; + } + if (/p/i.test(mbp)) { + var p = _.nopx($(selector).css('padding-' + type)); + if (p) r += p; + } + return r; +}; + +_.outerLeftSpace = function(selector, mbp) { + return _.outerSpace(selector, 'left', mbp); +}; + +_.outerTopSpace = function(selector, mbp) { + return _.outerSpace(selector, 'top', mbp); +}; + +_.outerRightSpace = function(selector, mbp) { + return _.outerSpace(selector, 'right', mbp); +}; + +_.outerBottomSpace = function(selector, mbp) { + return _.outerSpace(selector, 'bottom', mbp); +}; + +_.outerHSpace = function(selector, mbp) { + return (_.outerLeftSpace(selector, mbp) + _.outerRightSpace(selector, mbp)); +}; + +_.outerVSpace = function(selector, mbp) { + return (_.outerTopSpace(selector, mbp) + _.outerBottomSpace(selector, mbp)); +}; + +_.kuki = { + prefix: '', + duration: 356, + domain: '', + path: '', + secure: false, + + set: function(name, value, duration, domain, path, secure) { + name = this.prefix + name; + if (duration == null) duration = this.duration; + if (secure == null) secure = this.secure; + if ((domain == null) && this.domain) domain = this.domain; + if ((path == null) && this.path) path = this.path; + secure = secure ? true : false; + + var date = new Date(); + date.setTime(date.getTime() + (duration * 86400000)); + var expires = date.toGMTString(); + + var str = name + '=' + value + '; expires=' + expires; + if (domain != null) str += '; domain=' + domain; + if (path != null) str += '; path=' + path; + if (secure) str += '; secure'; + + return (document.cookie = str) ? true : false; + }, + + get: function(name) { + name = this.prefix + name; + var nameEQ = name + '='; + var kukis = document.cookie.split(';'); + var kuki; + + for (var i = 0; i < kukis.length; i++) { + kuki = kukis[i]; + while (kuki.charAt(0) == ' ') + kuki = kuki.substring(1, kuki.length); + + if (kuki.indexOf(nameEQ) == 0) + return kuki.substring(nameEQ.length, kuki.length); + } + + return null; + }, + + del: function(name) { + return this.set(name, '', -1); + }, + + isSet: function(name) { + return (this.get(name) != null); + } +}; + +_.md5 = function(string) { + + var RotateLeft = function(lValue, iShiftBits) { + return (lValue<>>(32-iShiftBits)); + }; + + var AddUnsigned = function(lX,lY) { + var lX4, lY4, lX8, lY8, lResult; + lX8 = (lX & 0x80000000); + lY8 = (lY & 0x80000000); + lX4 = (lX & 0x40000000); + lY4 = (lY & 0x40000000); + lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); + if (lX4 & lY4) + return (lResult ^ 0x80000000 ^ lX8 ^ lY8); + if (lX4 | lY4) + return (lResult & 0x40000000) + ? (lResult ^ 0xC0000000 ^ lX8 ^ lY8) + : (lResult ^ 0x40000000 ^ lX8 ^ lY8); + else + return (lResult ^ lX8 ^ lY8); + }; + + var F = function(x, y, z) { return (x & y) | ((~x) & z); }; + var G = function(x, y, z) { return (x & z) | (y & (~z)); }; + var H = function(x, y, z) { return (x ^ y ^ z); }; + var I = function(x, y, z) { return (y ^ (x | (~z))); }; + + var FF = function(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + var GG = function(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + var HH = function(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + var II = function(a, b, c, d, x, s, ac) { + a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); + return AddUnsigned(RotateLeft(a, s), b); + }; + + var ConvertToWordArray = function(string) { + var lWordCount; + var lMessageLength = string.length; + var lNumberOfWords_temp1 = lMessageLength + 8; + var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; + var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; + var lWordArray = [lNumberOfWords - 1]; + var lBytePosition = 0; + var lByteCount = 0; + while (lByteCount < lMessageLength) { + lWordCount = (lByteCount - (lByteCount % 4)) / 4; + lBytePosition = (lByteCount % 4) * 8; + lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); + lByteCount++; + } + lWordCount = (lByteCount - (lByteCount % 4)) / 4; + lBytePosition = (lByteCount % 4) * 8; + lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); + lWordArray[lNumberOfWords - 2] = lMessageLength << 3; + lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; + return lWordArray; + }; + + var WordToHex = function(lValue) { + var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; + for (lCount = 0; lCount <= 3; lCount++) { + lByte = (lValue >>> (lCount * 8)) & 255; + WordToHexValue_temp = "0" + lByte.toString(16); + WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2,2); + } + return WordToHexValue; + }; + + var x = []; + var k, AA, BB, CC, DD, a, b, c, d; + var S11 = 7, S12 = 12, S13 = 17, S14 = 22; + var S21 = 5, S22 = 9, S23 = 14, S24 = 20; + var S31 = 4, S32 = 11, S33 = 16, S34 = 23; + var S41 = 6, S42 = 10, S43 = 15, S44 = 21; + + string = _.utf8encode(string); + + x = ConvertToWordArray(string); + + a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; + + for (k = 0; k < x.length; k += 16) { + AA = a; BB = b; CC = c; DD = d; + a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); + d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); + c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); + b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); + a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); + d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); + c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); + b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); + a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); + d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); + c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); + b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); + a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); + d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); + c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); + b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); + a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); + d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); + c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); + b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); + a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); + d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); + c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); + b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); + a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); + d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); + c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); + b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); + a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); + d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); + c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); + b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); + a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); + d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); + c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); + b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); + a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); + d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); + c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); + b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); + a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); + d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); + c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); + b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); + a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); + d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); + c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); + b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); + a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); + d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); + c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); + b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); + a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); + d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); + c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); + b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); + a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); + d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); + c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); + b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); + a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); + d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); + c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); + b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); + a = AddUnsigned(a, AA); + b = AddUnsigned(b, BB); + c = AddUnsigned(c, CC); + d = AddUnsigned(d, DD); + } + + var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); + + return temp.toLowerCase(); +}; + +_.utf8encode = function(string) { + string = string.replace(/\r\n/g,"\n"); + var utftext = ""; + + for (var n = 0; n < string.length; n++) { + + var c = string.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } else if((c > 127) && (c < 2048)) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + + } + + return utftext; +}; +/** This file is part of KCFinder project + * + * @desc Base JavaScript object properties + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +var browser = { + opener: {}, + support: {}, + files: [], + clipboard: [], + labels: [], + shows: [], + orders: [], + cms: "" +}; +/** This file is part of KCFinder project + * + * @desc Base JavaScript object properties + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +var browser = { + opener: {}, + support: {}, + files: [], + clipboard: [], + labels: [], + shows: [], + orders: [], + cms: "" +}; +/** This file is part of KCFinder project + * + * @desc Object initializations + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.init = function() { + if (!this.checkAgent()) return; + + $('body').click(function() { + browser.hideDialog(); + }); + $('#shadow').click(function() { + return false; + }); + $('#dialog').unbind(); + $('#dialog').click(function() { + return false; + }); + $('#alert').unbind(); + $('#alert').click(function() { + return false; + }); + this.initOpeners(); + this.initSettings(); + this.initContent(); + this.initToolbar(); + this.initResizer(); + this.initDropUpload(); +}; + +browser.checkAgent = function() { + if (!$.browser.version || + ($.browser.msie && (parseInt($.browser.version) < 7) && !this.support.chromeFrame) || + ($.browser.opera && (parseInt($.browser.version) < 10)) || + ($.browser.mozilla && (parseFloat($.browser.version.replace(/^(\d+(\.\d+)?)([^\d].*)?$/, "$1")) < 1.8)) + ) { + var html = '
Your browser is not capable to display KCFinder. Please update your browser or install another one: Mozilla Firefox, Apple Safari, Google Chrome, Opera.'; + if ($.browser.msie) + html += ' You may also install Google Chrome Frame ActiveX plugin to get Internet Explorer 6 working.'; + html += '
'; + $('body').html(html); + return false; + } + return true; +}; + +browser.initOpeners = function() { + if (this.opener.TinyMCE && (typeof(tinyMCEPopup) == 'undefined')) + this.opener.TinyMCE = null; + + if (this.opener.TinyMCE) + this.opener.callBack = true; + + if ((!this.opener.name || (this.opener.name == 'fckeditor')) && + window.opener && window.opener.SetUrl + ) { + this.opener.FCKeditor = true; + this.opener.callBack = true; + } + + if (this.opener.CKEditor) { + if (window.parent && window.parent.CKEDITOR) + this.opener.CKEditor.object = window.parent.CKEDITOR; + else if (window.opener && window.opener.CKEDITOR) { + this.opener.CKEditor.object = window.opener.CKEDITOR; + this.opener.callBack = true; + } else + this.opener.CKEditor = null; + } + + if (!this.opener.CKEditor && !this.opener.FCKEditor && !this.TinyMCE) { + if ((window.opener && window.opener.KCFinder && window.opener.KCFinder.callBack) || + (window.parent && window.parent.KCFinder && window.parent.KCFinder.callBack) + ) + this.opener.callBack = window.opener + ? window.opener.KCFinder.callBack + : window.parent.KCFinder.callBack; + + if (( + window.opener && + window.opener.KCFinder && + window.opener.KCFinder.callBackMultiple + ) || ( + window.parent && + window.parent.KCFinder && + window.parent.KCFinder.callBackMultiple + ) + ) + this.opener.callBackMultiple = window.opener + ? window.opener.KCFinder.callBackMultiple + : window.parent.KCFinder.callBackMultiple; + } +}; + +browser.initContent = function() { + $('div#folders').html(this.label("Loading folders...")); + $('div#files').html(this.label("Loading files...")); + $.ajax({ + type: 'GET', + dataType: 'json', + url: browser.baseGetData('init'), + async: false, + success: function(data) { + if (browser.check4errors(data)) + return; + browser.dirWritable = data.dirWritable; + $('#folders').html(browser.buildTree(data.tree)); + browser.setTreeData(data.tree); + browser.initFolders(); + browser.files = data.files ? data.files : []; + browser.orderFiles(); + }, + error: function() { + $('div#folders').html(browser.label("Unknown error.")); + $('div#files').html(browser.label("Unknown error.")); + } + }); +}; + +browser.initResizer = function() { + var cursor = ($.browser.opera) ? 'move' : 'col-resize'; + $('#resizer').css('cursor', cursor); + $('#resizer').drag('start', function() { + $(this).css({opacity:'0.4', filter:'alpha(opacity:40)'}); + $('#all').css('cursor', cursor); + }); + $('#resizer').drag(function(e) { + var left = e.pageX - parseInt(_.nopx($(this).css('width')) / 2); + left = (left >= 0) ? left : 0; + left = (left + _.nopx($(this).css('width')) < $(window).width()) + ? left : $(window).width() - _.nopx($(this).css('width')); + $(this).css('left', left); + }); + var end = function() { + $(this).css({opacity:'0', filter:'alpha(opacity:0)'}); + $('#all').css('cursor', ''); + var left = _.nopx($(this).css('left')) + _.nopx($(this).css('width')); + var right = $(window).width() - left; + $('#left').css('width', left + 'px'); + $('#right').css('width', right + 'px'); + _('files').style.width = $('#right').innerWidth() - _.outerHSpace('#files') + 'px'; + _('resizer').style.left = $('#left').outerWidth() - _.outerRightSpace('#folders', 'm') + 'px'; + _('resizer').style.width = _.outerRightSpace('#folders', 'm') + _.outerLeftSpace('#files', 'm') + 'px'; + browser.fixFilesHeight(); + }; + $('#resizer').drag('end', end); + $('#resizer').mouseup(end); +}; + +browser.resize = function() { + _('left').style.width = '25%'; + _('right').style.width = '75%'; + _('toolbar').style.height = $('#toolbar a').outerHeight() + "px"; + _('shadow').style.width = $(window).width() + 'px'; + _('shadow').style.height = _('resizer').style.height = $(window).height() + 'px'; + _('left').style.height = _('right').style.height = + $(window).height() - $('#status').outerHeight() + 'px'; + _('folders').style.height = + $('#left').outerHeight() - _.outerVSpace('#folders') + 'px'; + browser.fixFilesHeight(); + var width = $('#left').outerWidth() + $('#right').outerWidth(); + _('status').style.width = width + 'px'; + while ($('#status').outerWidth() > width) + _('status').style.width = _.nopx(_('status').style.width) - 1 + 'px'; + while ($('#status').outerWidth() < width) + _('status').style.width = _.nopx(_('status').style.width) + 1 + 'px'; + if ($.browser.msie && ($.browser.version.substr(0, 1) < 8)) + _('right').style.width = $(window).width() - $('#left').outerWidth() + 'px'; + _('files').style.width = $('#right').innerWidth() - _.outerHSpace('#files') + 'px'; + _('resizer').style.left = $('#left').outerWidth() - _.outerRightSpace('#folders', 'm') + 'px'; + _('resizer').style.width = _.outerRightSpace('#folders', 'm') + _.outerLeftSpace('#files', 'm') + 'px'; +}; + +browser.fixFilesHeight = function() { + _('files').style.height = + $('#left').outerHeight() - $('#toolbar').outerHeight() - _.outerVSpace('#files') - + (($('#settings').css('display') != "none") ? $('#settings').outerHeight() : 0) + 'px'; +}; +/** This file is part of KCFinder project + * + * @desc Toolbar functionality + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.initToolbar = function() { + $('#toolbar a').click(function() { + browser.hideDialog(); + }); + + if (!_.kuki.isSet('displaySettings')) + _.kuki.set('displaySettings', 'off'); + + if (_.kuki.get('displaySettings') == 'on') { + $('#toolbar a[href="kcact:settings"]').addClass('selected'); + $('#settings').css('display', 'block'); + browser.resize(); + } + + $('#toolbar a[href="kcact:settings"]').click(function () { + if ($('#settings').css('display') == 'none') { + $(this).addClass('selected'); + _.kuki.set('displaySettings', 'on'); + $('#settings').css('display', 'block'); + browser.fixFilesHeight(); + } else { + $(this).removeClass('selected'); + _.kuki.set('displaySettings', 'off'); + $('#settings').css('display', 'none'); + browser.fixFilesHeight(); + } + return false; + }); + + $('#toolbar a[href="kcact:refresh"]').click(function() { + browser.refresh(); + return false; + }); + + if (window.opener || this.opener.TinyMCE || $('iframe', window.parent.document).get(0)) + $('#toolbar a[href="kcact:maximize"]').click(function() { + browser.maximize(this); + return false; + }); + else + $('#toolbar a[href="kcact:maximize"]').css('display', 'none'); + + $('#toolbar a[href="kcact:about"]').click(function() { + var html = '
' + + '
KCFinder ' + browser.version + '
'; + if (browser.support.check4Update) + html += '
' + browser.label("Checking for new version...") + '
'; + html += + '
' + browser.label("Licenses:") + ' GPLv2 & LGPLv2
' + + '
Copyright ©2010-2014 Pavel Tzonkov
' + + '' + + '
'; + $('#dialog').html(html); + $('#dialog').data('title', browser.label("About")); + browser.showDialog(); + var close = function() { + browser.hideDialog(); + browser.unshadow(); + } + $('#dialog button').click(close); + var span = $('#checkver > span'); + setTimeout(function() { + $.ajax({ + dataType: 'json', + url: browser.baseGetData('check4Update'), + async: true, + success: function(data) { + if (!$('#dialog').html().length) + return; + span.removeClass('loading'); + if (!data.version) { + span.html(browser.label("Unable to connect!")); + browser.showDialog(); + return; + } + if (browser.version < data.version) + span.html('' + browser.label("Download version {version} now!", {version: data.version}) + ''); + else + span.html(browser.label("KCFinder is up to date!")); + browser.showDialog(); + }, + error: function() { + if (!$('#dialog').html().length) + return; + span.removeClass('loading'); + span.html(browser.label("Unable to connect!")); + browser.showDialog(); + } + }); + }, 1000); + $('#dialog').unbind(); + + return false; + }); + + this.initUploadButton(); +}; + +browser.initUploadButton = function() { + var btn = $('#toolbar a[href="kcact:upload"]'); + if (!this.access.files.upload) { + btn.css('display', 'none'); + return; + } + var top = btn.get(0).offsetTop; + var width = btn.outerWidth(); + var height = btn.outerHeight(); + $('#toolbar').prepend('
' + + '
' + + '' + + '' + + '
' + + '
'); + $('#upload input').css('margin-left', "-" + ($('#upload input').outerWidth() - width) + 'px'); + $('#upload').mouseover(function() { + $('#toolbar a[href="kcact:upload"]').addClass('hover'); + }); + $('#upload').mouseout(function() { + $('#toolbar a[href="kcact:upload"]').removeClass('hover'); + }); +}; + +browser.uploadFile = function(form) { + if (!this.dirWritable) { + browser.alert(this.label("Cannot write to upload folder.")); + $('#upload').detach(); + browser.initUploadButton(); + return; + } + form.elements[1].value = browser.dir; + $('').prependTo(document.body); + $('#loading').html(this.label("Uploading file...")); + $('#loading').css('display', 'inline'); + form.submit(); + $('#uploadResponse').load(function() { + var response = $(this).contents().find('body').html(); + $('#loading').css('display', 'none'); + response = response.split("\n"); + var selected = [], errors = []; + $.each(response, function(i, row) { + if (row.substr(0, 1) == '/') + selected[selected.length] = row.substr(1, row.length - 1) + else + errors[errors.length] = row; + }); + if (errors.length) + browser.alert(errors.join("\n")); + if (!selected.length) + selected = null + browser.refresh(selected); + $('#upload').detach(); + setTimeout(function() { + $('#uploadResponse').detach(); + }, 1); + browser.initUploadButton(); + }); +}; + +browser.maximize = function(button) { + if (window.opener) { + window.moveTo(0, 0); + width = screen.availWidth; + height = screen.availHeight; + if ($.browser.opera) + height -= 50; + window.resizeTo(width, height); + + } else if (browser.opener.TinyMCE) { + var win, ifr, id; + + $('iframe', window.parent.document).each(function() { + if (/^mce_\d+_ifr$/.test($(this).attr('id'))) { + id = parseInt($(this).attr('id').replace(/^mce_(\d+)_ifr$/, "$1")); + win = $('#mce_' + id, window.parent.document); + ifr = $('#mce_' + id + '_ifr', window.parent.document); + } + }); + + if ($(button).hasClass('selected')) { + $(button).removeClass('selected'); + win.css({ + left: browser.maximizeMCE.left + 'px', + top: browser.maximizeMCE.top + 'px', + width: browser.maximizeMCE.width + 'px', + height: browser.maximizeMCE.height + 'px' + }); + ifr.css({ + width: browser.maximizeMCE.width - browser.maximizeMCE.Hspace + 'px', + height: browser.maximizeMCE.height - browser.maximizeMCE.Vspace + 'px' + }); + + } else { + $(button).addClass('selected') + browser.maximizeMCE = { + width: _.nopx(win.css('width')), + height: _.nopx(win.css('height')), + left: win.position().left, + top: win.position().top, + Hspace: _.nopx(win.css('width')) - _.nopx(ifr.css('width')), + Vspace: _.nopx(win.css('height')) - _.nopx(ifr.css('height')) + }; + var width = $(window.parent).width(); + var height = $(window.parent).height(); + win.css({ + left: $(window.parent).scrollLeft() + 'px', + top: $(window.parent).scrollTop() + 'px', + width: width + 'px', + height: height + 'px' + }); + ifr.css({ + width: width - browser.maximizeMCE.Hspace + 'px', + height: height - browser.maximizeMCE.Vspace + 'px' + }); + } + + } else if ($('iframe', window.parent.document).get(0)) { + var ifrm = $('iframe[name="' + window.name + '"]', window.parent.document); + var parent = ifrm.parent(); + var width, height; + if ($(button).hasClass('selected')) { + $(button).removeClass('selected'); + if (browser.maximizeThread) { + clearInterval(browser.maximizeThread); + browser.maximizeThread = null; + } + if (browser.maximizeW) browser.maximizeW = null; + if (browser.maximizeH) browser.maximizeH = null; + $.each($('*', window.parent.document).get(), function(i, e) { + e.style.display = browser.maximizeDisplay[i]; + }); + ifrm.css({ + display: browser.maximizeCSS.display, + position: browser.maximizeCSS.position, + left: browser.maximizeCSS.left, + top: browser.maximizeCSS.top, + width: browser.maximizeCSS.width, + height: browser.maximizeCSS.height + }); + $(window.parent).scrollLeft(browser.maximizeLest); + $(window.parent).scrollTop(browser.maximizeTop); + + } else { + $(button).addClass('selected'); + browser.maximizeCSS = { + display: ifrm.css('display'), + position: ifrm.css('position'), + left: ifrm.css('left'), + top: ifrm.css('top'), + width: ifrm.outerWidth() + 'px', + height: ifrm.outerHeight() + 'px' + }; + browser.maximizeTop = $(window.parent).scrollTop(); + browser.maximizeLeft = $(window.parent).scrollLeft(); + browser.maximizeDisplay = []; + $.each($('*', window.parent.document).get(), function(i, e) { + browser.maximizeDisplay[i] = $(e).css('display'); + $(e).css('display', 'none'); + }); + + ifrm.css('display', 'block'); + ifrm.parents().css('display', 'block'); + var resize = function() { + width = $(window.parent).width(); + height = $(window.parent).height(); + if (!browser.maximizeW || (browser.maximizeW != width) || + !browser.maximizeH || (browser.maximizeH != height) + ) { + browser.maximizeW = width; + browser.maximizeH = height; + ifrm.css({ + width: width + 'px', + height: height + 'px' + }); + browser.resize(); + } + } + ifrm.css('position', 'absolute'); + if ((ifrm.offset().left == ifrm.position().left) && + (ifrm.offset().top == ifrm.position().top) + ) + ifrm.css({left: '0', top: '0'}); + else + ifrm.css({ + left: - ifrm.offset().left + 'px', + top: - ifrm.offset().top + 'px' + }); + + resize(); + browser.maximizeThread = setInterval(resize, 250); + } + } +}; + +browser.refresh = function(selected) { + this.fadeFiles(); + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('chDir'), + data: {dir:browser.dir}, + async: false, + success: function(data) { + if (browser.check4errors(data)) + return; + browser.dirWritable = data.dirWritable; + browser.files = data.files ? data.files : []; + browser.orderFiles(null, selected); + browser.statusDir(); + }, + error: function() { + $('#files > div').css({opacity:'', filter:''}); + $('#files').html(browser.label("Unknown error.")); + } + }); +}; +/** This file is part of KCFinder project + * + * @desc Settings panel functionality + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.initSettings = function() { + + if (!this.shows.length) { + var showInputs = $('#show input[type="checkbox"]').toArray(); + $.each(showInputs, function (i, input) { + browser.shows[i] = input.name; + }); + } + + var shows = this.shows; + + if (!_.kuki.isSet('showname')) { + _.kuki.set('showname', 'on'); + $.each(shows, function (i, val) { + if (val != "name") _.kuki.set('show' + val, 'off'); + }); + } + + $('#show input[type="checkbox"]').click(function() { + var kuki = $(this).get(0).checked ? 'on' : 'off'; + _.kuki.set('show' + $(this).get(0).name, kuki) + if ($(this).get(0).checked) + $('#files .file div.' + $(this).get(0).name).css('display', 'block'); + else + $('#files .file div.' + $(this).get(0).name).css('display', 'none'); + }); + + $.each(shows, function(i, val) { + var checked = (_.kuki.get('show' + val) == 'on') ? 'checked' : ''; + $('#show input[name="' + val + '"]').get(0).checked = checked; + }); + + if (!this.orders.length) { + var orderInputs = $('#order input[type="radio"]').toArray(); + $.each(orderInputs, function (i, input) { + browser.orders[i] = input.value; + }); + } + + var orders = this.orders; + + if (!_.kuki.isSet('order')) + _.kuki.set('order', 'name'); + + if (!_.kuki.isSet('orderDesc')) + _.kuki.set('orderDesc', 'off'); + + $('#order input[value="' + _.kuki.get('order') + '"]').get(0).checked = true; + $('#order input[name="desc"]').get(0).checked = (_.kuki.get('orderDesc') == 'on'); + + $('#order input[type="radio"]').click(function() { + _.kuki.set('order', $(this).get(0).value); + browser.orderFiles(); + }); + + $('#order input[name="desc"]').click(function() { + _.kuki.set('orderDesc', $(this).get(0).checked ? 'on' : 'off'); + browser.orderFiles(); + }); + + if (!_.kuki.isSet('view')) + _.kuki.set('view', 'thumbs'); + + if (_.kuki.get('view') == 'list') { + $('#show input').each(function() { this.checked = true; }); + $('#show input').each(function() { this.disabled = true; }); + } + + $('#view input[value="' + _.kuki.get('view') + '"]').get(0).checked = true; + + $('#view input').click(function() { + var view = $(this).attr('value'); + if (_.kuki.get('view') != view) { + _.kuki.set('view', view); + if (view == 'list') { + $('#show input').each(function() { this.checked = true; }); + $('#show input').each(function() { this.disabled = true; }); + } else { + $.each(browser.shows, function(i, val) { + $('#show input[name="' + val + '"]').get(0).checked = + (_.kuki.get('show' + val) == "on"); + }); + $('#show input').each(function() { this.disabled = false; }); + } + } + browser.refresh(); + }); +}; +/** This file is part of KCFinder project + * + * @desc File related functionality + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.initFiles = function() { + $(document).unbind('keydown'); + $(document).keydown(function(e) { + return !browser.selectAll(e); + }); + $('#files').unbind(); + $('#files').scroll(function() { + browser.hideDialog(); + }); + $('.file').unbind(); + $('.file').click(function(e) { + _.unselect(); + browser.selectFile($(this), e); + }); + $('.file').rightClick(function(e) { + _.unselect(); + browser.menuFile($(this), e); + }); + $('.file').dblclick(function() { + _.unselect(); + browser.returnFile($(this)); + }); + $('.file').mouseup(function() { + _.unselect(); + }); + $('.file').mouseout(function() { + _.unselect(); + }); + $.each(this.shows, function(i, val) { + var display = (_.kuki.get('show' + val) == 'off') + ? 'none' : 'block'; + $('#files .file div.' + val).css('display', display); + }); + this.statusDir(); +}; + +browser.showFiles = function(callBack, selected) { + this.fadeFiles(); + setTimeout(function() { + var html = ''; + $.each(browser.files, function(i, file) { + var stamp = []; + $.each(file, function(key, val) { + stamp[stamp.length] = key + "|" + val; + }); + stamp = _.md5(stamp.join('|')); + if (_.kuki.get('view') == 'list') { + if (!i) html += ''; + var icon = _.getFileExtension(file.name); + if (file.thumb) + icon = '.image'; + else if (!icon.length || !file.smallIcon) + icon = '.'; + icon = 'themes/' + browser.theme + '/img/files/small/' + icon + '.png'; + html += '' + + '' + + '' + + '' + + ''; + if (i == browser.files.length - 1) html += '
' + _.htmlData(file.name) + '' + file.date + '' + browser.humanSize(file.size) + '
'; + } else { + if (file.thumb) + var icon = browser.baseGetData('thumb') + '&file=' + encodeURIComponent(file.name) + '&dir=' + encodeURIComponent(browser.dir) + '&stamp=' + stamp; + else if (file.smallThumb) { + var icon = browser.uploadURL + '/' + browser.dir + '/' + file.name; + icon = _.escapeDirs(icon).replace(/\'/g, "%27"); + } else { + var icon = file.bigIcon ? _.getFileExtension(file.name) : '.'; + if (!icon.length) icon = '.'; + icon = 'themes/' + browser.theme + '/img/files/big/' + icon + '.png'; + } + html += '
' + + '
' + + '
' + _.htmlData(file.name) + '
' + + '
' + file.date + '
' + + '
' + browser.humanSize(file.size) + '
' + + '
'; + } + }); + $('#files').html('
' + html + '
'); + $.each(browser.files, function(i, file) { + var item = $('#files .file').get(i); + $(item).data(file); + if (_.inArray(file.name, selected) || + ((typeof selected != 'undefined') && !selected.push && (file.name == selected)) + ) + $(item).addClass('selected'); + }); + $('#files > div').css({opacity:'', filter:''}); + if (callBack) callBack(); + browser.initFiles(); + }, 200); +}; + +browser.selectFile = function(file, e) { + if (e.ctrlKey || e.metaKey) { + if (file.hasClass('selected')) + file.removeClass('selected'); + else + file.addClass('selected'); + var files = $('.file.selected').get(); + var size = 0; + if (!files.length) + this.statusDir(); + else { + $.each(files, function(i, cfile) { + size += parseInt($(cfile).data('size')); + }); + size = this.humanSize(size); + if (files.length > 1) + $('#fileinfo').html(files.length + ' ' + this.label("selected files") + ' (' + size + ')'); + else { + var data = $(files[0]).data(); + $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); + } + } + } else { + var data = file.data(); + $('.file').removeClass('selected'); + file.addClass('selected'); + $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); + } +}; + +browser.selectAll = function(e) { + if ((!e.ctrlKey && !e.metaKey) || ((e.keyCode != 65) && (e.keyCode != 97))) + return false; + var files = $('.file').get(); + if (files.length) { + var size = 0; + $.each(files, function(i, file) { + if (!$(file).hasClass('selected')) + $(file).addClass('selected'); + size += parseInt($(file).data('size')); + }); + size = this.humanSize(size); + $('#fileinfo').html(files.length + ' ' + this.label("selected files") + ' (' + size + ')'); + } + return true; +}; + +browser.returnFile = function(file) { + + var fileURL = file.substr + ? file : browser.uploadURL + '/' + browser.dir + '/' + file.data('name'); + fileURL = _.escapeDirs(fileURL); + + if (this.opener.CKEditor) { + this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum, fileURL, ''); + window.close(); + + } else if (this.opener.FCKeditor) { + window.opener.SetUrl(fileURL) ; + window.close() ; + + } else if (this.opener.TinyMCE) { + var win = tinyMCEPopup.getWindowArg('window'); + win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = fileURL; + if (win.getImageData) win.getImageData(); + if (typeof(win.ImageDialog) != "undefined") { + if (win.ImageDialog.getImageData) + win.ImageDialog.getImageData(); + if (win.ImageDialog.showPreviewImage) + win.ImageDialog.showPreviewImage(fileURL); + } + tinyMCEPopup.close(); + + } else if (this.opener.callBack) { + + if (window.opener && window.opener.KCFinder) { + this.opener.callBack(fileURL); + window.close(); + } + + if (window.parent && window.parent.KCFinder) { + var button = $('#toolbar a[href="kcact:maximize"]'); + if (button.hasClass('selected')) + this.maximize(button); + this.opener.callBack(fileURL); + } + + } else if (this.opener.callBackMultiple) { + if (window.opener && window.opener.KCFinder) { + this.opener.callBackMultiple([fileURL]); + window.close(); + } + + if (window.parent && window.parent.KCFinder) { + var button = $('#toolbar a[href="kcact:maximize"]'); + if (button.hasClass('selected')) + this.maximize(button); + this.opener.callBackMultiple([fileURL]); + } + + } +}; + +browser.returnFiles = function(files) { + if (this.opener.callBackMultiple && files.length) { + var rfiles = []; + $.each(files, function(i, file) { + rfiles[i] = browser.uploadURL + '/' + browser.dir + '/' + $(file).data('name'); + rfiles[i] = _.escapeDirs(rfiles[i]); + }); + this.opener.callBackMultiple(rfiles); + if (window.opener) window.close() + } +}; + +browser.returnThumbnails = function(files) { + if (this.opener.callBackMultiple) { + var rfiles = []; + var j = 0; + $.each(files, function(i, file) { + if ($(file).data('thumb')) { + rfiles[j] = browser.thumbsURL + '/' + browser.dir + '/' + $(file).data('name'); + rfiles[j] = _.escapeDirs(rfiles[j++]); + } + }); + this.opener.callBackMultiple(rfiles); + if (window.opener) window.close() + } +}; + +browser.menuFile = function(file, e) { + var data = file.data(); + var path = this.dir + '/' + data.name; + var files = $('.file.selected').get(); + var html = ''; + + if (file.hasClass('selected') && files.length && (files.length > 1)) { + var thumb = false; + var notWritable = 0; + var cdata; + $.each(files, function(i, cfile) { + cdata = $(cfile).data(); + if (cdata.thumb) thumb = true; + if (!data.writable) notWritable++; + }); + if (this.opener.callBackMultiple) { + html += '' + this.label("Select") + ''; + if (thumb) html += + '' + this.label("Select Thumbnails") + ''; + } + if (data.thumb || data.smallThumb || this.support.zip) { + html += (html.length ? '
' : ''); + if (data.thumb || data.smallThumb) + html +='' + this.label("View") + ''; + if (this.support.zip) html += (html.length ? '
' : '') + + '' + this.label("Download") + ''; + } + + if (this.access.files.copy || this.access.files.move) + html += (html.length ? '
' : '') + + '' + this.label("Add to Clipboard") + ''; + if (this.access.files['delete']) + html += (html.length ? '
' : '') + + '' + this.label("Delete") + ''; + + if (html.length) { + html = ''; + $('#dialog').html(html); + this.showMenu(e); + } else + return; + + $('.menu a[href="kcact:pick"]').click(function() { + browser.returnFiles(files); + browser.hideDialog(); + return false; + }); + + $('.menu a[href="kcact:pick_thumb"]').click(function() { + browser.returnThumbnails(files); + browser.hideDialog(); + return false; + }); + + $('.menu a[href="kcact:download"]').click(function() { + browser.hideDialog(); + var pfiles = []; + $.each(files, function(i, cfile) { + pfiles[i] = $(cfile).data('name'); + }); + browser.post(browser.baseGetData('downloadSelected'), {dir:browser.dir, files:pfiles}); + return false; + }); + + $('.menu a[href="kcact:clpbrdadd"]').click(function() { + browser.hideDialog(); + var msg = ''; + $.each(files, function(i, cfile) { + var cdata = $(cfile).data(); + var failed = false; + for (i = 0; i < browser.clipboard.length; i++) + if ((browser.clipboard[i].name == cdata.name) && + (browser.clipboard[i].dir == browser.dir) + ) { + failed = true + msg += cdata.name + ": " + browser.label("This file is already added to the Clipboard.") + "\n"; + break; + } + + if (!failed) { + cdata.dir = browser.dir; + browser.clipboard[browser.clipboard.length] = cdata; + } + }); + browser.initClipboard(); + if (msg.length) browser.alert(msg.substr(0, msg.length - 1)); + return false; + }); + + $('.menu a[href="kcact:rm"]').click(function() { + if ($(this).hasClass('denied')) return false; + browser.hideDialog(); + var failed = 0; + var dfiles = []; + $.each(files, function(i, cfile) { + var cdata = $(cfile).data(); + if (!cdata.writable) + failed++; + else + dfiles[dfiles.length] = browser.dir + "/" + cdata.name; + }); + if (failed == files.length) { + browser.alert(browser.label("The selected files are not removable.")); + return false; + } + + var go = function(callBack) { + browser.fadeFiles(); + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('rm_cbd'), + data: {files:dfiles}, + async: false, + success: function(data) { + if (callBack) callBack(); + browser.check4errors(data); + browser.refresh(); + }, + error: function() { + if (callBack) callBack(); + $('#files > div').css({ + opacity: '', + filter: '' + }); + browser.alert(browser.label("Unknown error.")); + } + }); + }; + + if (failed) + browser.confirm( + browser.label("{count} selected files are not removable. Do you want to delete the rest?", {count:failed}), + go + ) + + else + browser.confirm( + browser.label("Are you sure you want to delete all selected files?"), + go + ); + + return false; + }); + + } else { + html += ''; + + $('#dialog').html(html); + this.showMenu(e); + + $('.menu a[href="kcact:pick"]').click(function() { + browser.returnFile(file); + browser.hideDialog(); + return false; + }); + + $('.menu a[href="kcact:pick_thumb"]').click(function() { + var path = browser.thumbsURL + '/' + browser.dir + '/' + data.name; + browser.returnFile(path); + browser.hideDialog(); + return false; + }); + + $('.menu a[href="kcact:download"]').click(function() { + var html = '
' + + '' + + '' + + '
'; + $('#dialog').html(html); + $('#downloadForm input').get(0).value = browser.dir; + $('#downloadForm input').get(1).value = data.name; + $('#downloadForm').submit(); + return false; + }); + + $('.menu a[href="kcact:clpbrdadd"]').click(function() { + for (i = 0; i < browser.clipboard.length; i++) + if ((browser.clipboard[i].name == data.name) && + (browser.clipboard[i].dir == browser.dir) + ) { + browser.hideDialog(); + browser.alert(browser.label("This file is already added to the Clipboard.")); + return false; + } + var cdata = data; + cdata.dir = browser.dir; + browser.clipboard[browser.clipboard.length] = cdata; + browser.initClipboard(); + browser.hideDialog(); + return false; + }); + + $('.menu a[href="kcact:mv"]').click(function(e) { + if (!data.writable) return false; + browser.fileNameDialog( + e, {dir: browser.dir, file: data.name}, + 'newName', data.name, browser.baseGetData('rename'), { + title: "New file name:", + errEmpty: "Please enter new file name.", + errSlash: "Unallowable characters in file name.", + errDot: "File name shouldn't begins with '.'" + }, + function() { + browser.refresh(); + } + ); + return false; + }); + + $('.menu a[href="kcact:rm"]').click(function() { + if (!data.writable) return false; + browser.hideDialog(); + browser.confirm(browser.label("Are you sure you want to delete this file?"), + function(callBack) { + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('delete'), + data: {dir:browser.dir, file:data.name}, + async: false, + success: function(data) { + if (callBack) callBack(); + browser.clearClipboard(); + if (browser.check4errors(data)) + return; + browser.refresh(); + }, + error: function() { + if (callBack) callBack(); + browser.alert(browser.label("Unknown error.")); + } + }); + } + ); + return false; + }); + } + + $('.menu a[href="kcact:view"]').click(function() { + browser.hideDialog(); + var ts = new Date().getTime(); + var showImage = function(data) { + url = _.escapeDirs(browser.uploadURL + '/' + browser.dir + '/' + data.name) + '?ts=' + ts, + $('#loading').html(browser.label("Loading image...")); + $('#loading').css('display', 'inline'); + var img = new Image(); + img.src = url; + img.onerror = function() { + browser.lock = false; + $('#loading').css('display', 'none'); + browser.alert(browser.label("Unknown error.")); + $(document).unbind('keydown'); + $(document).keydown(function(e) { + return !browser.selectAll(e); + }); + browser.refresh(); + }; + var onImgLoad = function() { + browser.lock = false; + $('#files .file').each(function() { + if ($(this).data('name') == data.name) + browser.ssImage = this; + }); + $('#loading').css('display', 'none'); + $('#dialog').html('
'); + $('#dialog img').attr({ + src: url, + title: data.name + }).fadeIn('fast', function() { + var o_w = $('#dialog').outerWidth(); + var o_h = $('#dialog').outerHeight(); + var f_w = $(window).width() - 30; + var f_h = $(window).height() - 30; + if ((o_w > f_w) || (o_h > f_h)) { + if ((f_w / f_h) > (o_w / o_h)) + f_w = parseInt((o_w * f_h) / o_h); + else if ((f_w / f_h) < (o_w / o_h)) + f_h = parseInt((o_h * f_w) / o_w); + $('#dialog img').attr({ + width: f_w, + height: f_h + }); + } + $('#dialog').unbind('click'); + $('#dialog').click(function(e) { + browser.hideDialog(); + $(document).unbind('keydown'); + $(document).keydown(function(e) { + return !browser.selectAll(e); + }); + if (browser.ssImage) { + browser.selectFile($(browser.ssImage), e); + } + }); + browser.showDialog(); + var images = []; + $.each(browser.files, function(i, file) { + if (file.thumb || file.smallThumb) + images[images.length] = file; + }); + if (images.length) + $.each(images, function(i, image) { + if (image.name == data.name) { + $(document).unbind('keydown'); + $(document).keydown(function(e) { + if (images.length > 1) { + if (!browser.lock && (e.keyCode == 37)) { + var nimg = i + ? images[i - 1] + : images[images.length - 1]; + browser.lock = true; + showImage(nimg); + } + if (!browser.lock && (e.keyCode == 39)) { + var nimg = (i >= images.length - 1) + ? images[0] + : images[i + 1]; + browser.lock = true; + showImage(nimg); + } + } + if (e.keyCode == 27) { + browser.hideDialog(); + $(document).unbind('keydown'); + $(document).keydown(function(e) { + return !browser.selectAll(e); + }); + } + }); + } + }); + }); + }; + if (img.complete) + onImgLoad(); + else + img.onload = onImgLoad; + }; + showImage(data); + return false; + }); +}; +/** This file is part of KCFinder project + * + * @desc Folder related functionality + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.initFolders = function() { + $('#folders').scroll(function() { + browser.hideDialog(); + }); + $('div.folder > a').unbind(); + $('div.folder > a').bind('click', function() { + browser.hideDialog(); + return false; + }); + $('div.folder > a > span.brace').unbind(); + $('div.folder > a > span.brace').click(function() { + if ($(this).hasClass('opened') || $(this).hasClass('closed')) + browser.expandDir($(this).parent()); + }); + $('div.folder > a > span.folder').unbind(); + $('div.folder > a > span.folder').click(function() { + browser.changeDir($(this).parent()); + }); + $('div.folder > a > span.folder').rightClick(function(e) { + _.unselect(); + browser.menuDir($(this).parent(), e); + }); + + if ($.browser.msie && $.browser.version && + (parseInt($.browser.version.substr(0, 1)) < 8) + ) { + var fls = $('div.folder').get(); + var body = $('body').get(0); + var div; + $.each(fls, function(i, folder) { + div = document.createElement('div'); + div.style.display = 'inline'; + div.style.margin = div.style.border = div.style.padding = '0'; + div.innerHTML='
' + $(folder).html() + "
"; + body.appendChild(div); + $(folder).css('width', $(div).innerWidth() + 'px'); + body.removeChild(div); + }); + } +}; + +browser.setTreeData = function(data, path) { + if (!path) + path = ''; + else if (path.length && (path.substr(path.length - 1, 1) != '/')) + path += '/'; + path += data.name; + var selector = '#folders a[href="kcdir:/' + _.escapeDirs(path) + '"]'; + $(selector).data({ + name: data.name, + path: path, + readable: data.readable, + writable: data.writable, + removable: data.removable, + hasDirs: data.hasDirs + }); + $(selector + ' span.folder').addClass(data.current ? 'current' : 'regular'); + if (data.dirs && data.dirs.length) { + $(selector + ' span.brace').addClass('opened'); + $.each(data.dirs, function(i, cdir) { + browser.setTreeData(cdir, path + '/'); + }); + } else if (data.hasDirs) + $(selector + ' span.brace').addClass('closed'); +}; + +browser.buildTree = function(root, path) { + if (!path) path = ""; + path += root.name; + var html = '
 ' + _.htmlData(root.name) + ''; + if (root.dirs) { + html += '
'; + for (var i = 0; i < root.dirs.length; i++) { + cdir = root.dirs[i]; + html += browser.buildTree(cdir, path + '/'); + } + html += '
'; + } + html += '
'; + return html; +}; + +browser.expandDir = function(dir) { + var path = dir.data('path'); + if (dir.children('.brace').hasClass('opened')) { + dir.parent().children('.folders').hide(500, function() { + if (path == browser.dir.substr(0, path.length)) + browser.changeDir(dir); + }); + dir.children('.brace').removeClass('opened'); + dir.children('.brace').addClass('closed'); + } else { + if (dir.parent().children('.folders').get(0)) { + dir.parent().children('.folders').show(500); + dir.children('.brace').removeClass('closed'); + dir.children('.brace').addClass('opened'); + } else if (!$('#loadingDirs').get(0)) { + dir.parent().append('
' + this.label("Loading folders...") + '
'); + $('#loadingDirs').css('display', 'none'); + $('#loadingDirs').show(200, function() { + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('expand'), + data: {dir:path}, + async: false, + success: function(data) { + $('#loadingDirs').hide(200, function() { + $('#loadingDirs').detach(); + }); + if (browser.check4errors(data)) + return; + + var html = ''; + $.each(data.dirs, function(i, cdir) { + html += ''; + }); + if (html.length) { + dir.parent().append('
' + html + '
'); + var folders = $(dir.parent().children('.folders').first()); + folders.css('display', 'none'); + $(folders).show(500); + $.each(data.dirs, function(i, cdir) { + browser.setTreeData(cdir, path); + }); + } + if (data.dirs.length) { + dir.children('.brace').removeClass('closed'); + dir.children('.brace').addClass('opened'); + } else { + dir.children('.brace').removeClass('opened'); + dir.children('.brace').removeClass('closed'); + } + browser.initFolders(); + browser.initDropUpload(); + }, + error: function() { + $('#loadingDirs').detach(); + browser.alert(browser.label("Unknown error.")); + } + }); + }); + } + } +}; + +browser.changeDir = function(dir) { + if (dir.children('span.folder').hasClass('regular')) { + $('div.folder > a > span.folder').removeClass('current'); + $('div.folder > a > span.folder').removeClass('regular'); + $('div.folder > a > span.folder').addClass('regular'); + dir.children('span.folder').removeClass('regular'); + dir.children('span.folder').addClass('current'); + $('#files').html(browser.label("Loading files...")); + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('chDir'), + data: {dir:dir.data('path')}, + async: false, + success: function(data) { + if (browser.check4errors(data)) + return; + browser.files = data.files; + browser.orderFiles(); + browser.dir = dir.data('path'); + browser.dirWritable = data.dirWritable; + var title = "KCFinder: /" + browser.dir; + document.title = title; + if (browser.opener.TinyMCE) + tinyMCEPopup.editor.windowManager.setTitle(window, title); + browser.statusDir(); + }, + error: function() { + $('#files').html(browser.label("Unknown error.")); + } + }); + } +}; + +browser.statusDir = function() { + for (var i = 0, size = 0; i < this.files.length; i++) + size += parseInt(this.files[i].size); + size = this.humanSize(size); + $('#fileinfo').html(this.files.length + ' ' + this.label("files") + ' (' + size + ')'); +}; + +browser.menuDir = function(dir, e) { + var data = dir.data(); + var html = ''; + + $('#dialog').html(html); + this.showMenu(e); + $('div.folder > a > span.folder').removeClass('context'); + if (dir.children('span.folder').hasClass('regular')) + dir.children('span.folder').addClass('context'); + + if (this.clipboard && this.clipboard.length && data.writable) { + + $('.menu a[href="kcact:cpcbd"]').click(function() { + browser.hideDialog(); + browser.copyClipboard(data.path); + return false; + }); + + $('.menu a[href="kcact:mvcbd"]').click(function() { + browser.hideDialog(); + browser.moveClipboard(data.path); + return false; + }); + } + + $('.menu a[href="kcact:refresh"]').click(function() { + browser.hideDialog(); + browser.refreshDir(dir); + return false; + }); + + $('.menu a[href="kcact:download"]').click(function() { + browser.hideDialog(); + browser.post(browser.baseGetData('downloadDir'), {dir:data.path}); + return false; + }); + + $('.menu a[href="kcact:mkdir"]').click(function(e) { + if (!data.writable) return false; + browser.hideDialog(); + browser.fileNameDialog( + e, {dir: data.path}, + 'newDir', '', browser.baseGetData('newDir'), { + title: "New folder name:", + errEmpty: "Please enter new folder name.", + errSlash: "Unallowable characters in folder name.", + errDot: "Folder name shouldn't begins with '.'" + }, function() { + browser.refreshDir(dir); + browser.initDropUpload(); + if (!data.hasDirs) { + dir.data('hasDirs', true); + dir.children('span.brace').addClass('closed'); + } + } + ); + return false; + }); + + $('.menu a[href="kcact:mvdir"]').click(function(e) { + if (!data.removable) return false; + browser.hideDialog(); + browser.fileNameDialog( + e, {dir: data.path}, + 'newName', data.name, browser.baseGetData('renameDir'), { + title: "New folder name:", + errEmpty: "Please enter new folder name.", + errSlash: "Unallowable characters in folder name.", + errDot: "Folder name shouldn't begins with '.'" + }, function(dt) { + if (!dt.name) { + browser.alert(browser.label("Unknown error.")); + return; + } + var currentDir = (data.path == browser.dir); + dir.children('span.folder').html(_.htmlData(dt.name)); + dir.data('name', dt.name); + dir.data('path', _.dirname(data.path) + '/' + dt.name); + if (currentDir) + browser.dir = dir.data('path'); + browser.initDropUpload(); + }, + true + ); + return false; + }); + + $('.menu a[href="kcact:rmdir"]').click(function() { + if (!data.removable) return false; + browser.hideDialog(); + browser.confirm( + "Are you sure you want to delete this folder and all its content?", + function(callBack) { + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('deleteDir'), + data: {dir: data.path}, + async: false, + success: function(data) { + if (callBack) callBack(); + if (browser.check4errors(data)) + return; + dir.parent().hide(500, function() { + var folders = dir.parent().parent(); + var pDir = folders.parent().children('a').first(); + dir.parent().detach(); + if (!folders.children('div.folder').get(0)) { + pDir.children('span.brace').first().removeClass('opened'); + pDir.children('span.brace').first().removeClass('closed'); + pDir.parent().children('.folders').detach(); + pDir.data('hasDirs', false); + } + if (pDir.data('path') == browser.dir.substr(0, pDir.data('path').length)) + browser.changeDir(pDir); + browser.initDropUpload(); + }); + }, + error: function() { + if (callBack) callBack(); + browser.alert(browser.label("Unknown error.")); + } + }); + } + ); + return false; + }); +}; + +browser.refreshDir = function(dir) { + var path = dir.data('path'); + if (dir.children('.brace').hasClass('opened') || dir.children('.brace').hasClass('closed')) { + dir.children('.brace').removeClass('opened'); + dir.children('.brace').addClass('closed'); + } + dir.parent().children('.folders').first().detach(); + if (path == browser.dir.substr(0, path.length)) + browser.changeDir(dir); + browser.expandDir(dir); + return true; +}; +/** This file is part of KCFinder project + * + * @desc Clipboard functionality + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.initClipboard = function() { + if (!this.clipboard || !this.clipboard.length) return; + var size = 0; + $.each(this.clipboard, function(i, val) { + size += parseInt(val.size); + }); + size = this.humanSize(size); + $('#clipboard').html('
'); + var resize = function() { + $('#clipboard').css({ + left: $(window).width() - $('#clipboard').outerWidth() + 'px', + top: $(window).height() - $('#clipboard').outerHeight() + 'px' + }); + }; + resize(); + $('#clipboard').css('display', 'block'); + $(window).unbind(); + $(window).resize(function() { + browser.resize(); + resize(); + }); +}; + +browser.openClipboard = function() { + if (!this.clipboard || !this.clipboard.length) return; + if ($('.menu a[href="kcact:cpcbd"]').html()) { + $('#clipboard').removeClass('selected'); + this.hideDialog(); + return; + } + var html = ''; + + setTimeout(function() { + $('#clipboard').addClass('selected'); + $('#dialog').html(html); + $('.menu a[href="kcact:download"]').click(function() { + browser.hideDialog(); + browser.downloadClipboard(); + return false; + }); + $('.menu a[href="kcact:cpcbd"]').click(function() { + if (!browser.dirWritable) return false; + browser.hideDialog(); + browser.copyClipboard(browser.dir); + return false; + }); + $('.menu a[href="kcact:mvcbd"]').click(function() { + if (!browser.dirWritable) return false; + browser.hideDialog(); + browser.moveClipboard(browser.dir); + return false; + }); + $('.menu a[href="kcact:rmcbd"]').click(function() { + browser.hideDialog(); + browser.confirm( + browser.label("Are you sure you want to delete all files in the Clipboard?"), + function(callBack) { + if (callBack) callBack(); + browser.deleteClipboard(); + } + ); + return false; + }); + $('.menu a[href="kcact:clrcbd"]').click(function() { + browser.hideDialog(); + browser.clearClipboard(); + return false; + }); + + var left = $(window).width() - $('#dialog').outerWidth(); + var top = $(window).height() - $('#dialog').outerHeight() - $('#clipboard').outerHeight(); + var lheight = top + _.outerTopSpace('#dialog'); + $('.menu .list').css('max-height', lheight + 'px'); + var top = $(window).height() - $('#dialog').outerHeight() - $('#clipboard').outerHeight(); + $('#dialog').css({ + left: (left - 4) + 'px', + top: top + 'px' + }); + $('#dialog').fadeIn(); + }, 1); +}; + +browser.removeFromClipboard = function(i) { + if (!this.clipboard || !this.clipboard[i]) return false; + if (this.clipboard.length == 1) { + this.clearClipboard(); + this.hideDialog(); + return; + } + + if (i < this.clipboard.length - 1) { + var last = this.clipboard.slice(i + 1); + this.clipboard = this.clipboard.slice(0, i); + this.clipboard = this.clipboard.concat(last); + } else + this.clipboard.pop(); + + this.initClipboard(); + this.hideDialog(); + this.openClipboard(); + return true; +}; + +browser.copyClipboard = function(dir) { + if (!this.clipboard || !this.clipboard.length) return; + var files = []; + var failed = 0; + for (i = 0; i < this.clipboard.length; i++) + if (this.clipboard[i].readable) + files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; + else + failed++; + if (this.clipboard.length == failed) { + browser.alert(this.label("The files in the Clipboard are not readable.")); + return; + } + var go = function(callBack) { + if (dir == browser.dir) + browser.fadeFiles(); + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('cp_cbd'), + data: {dir: dir, files: files}, + async: false, + success: function(data) { + if (callBack) callBack(); + browser.check4errors(data); + browser.clearClipboard(); + if (dir == browser.dir) + browser.refresh(); + }, + error: function() { + if (callBack) callBack(); + $('#files > div').css({ + opacity: '', + filter: '' + }); + browser.alert(browser.label("Unknown error.")); + } + }); + }; + + if (failed) + browser.confirm( + browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?", {count:failed}), + go + ) + else + go(); + +}; + +browser.moveClipboard = function(dir) { + if (!this.clipboard || !this.clipboard.length) return; + var files = []; + var failed = 0; + for (i = 0; i < this.clipboard.length; i++) + if (this.clipboard[i].readable && this.clipboard[i].writable) + files[i] = this.clipboard[i].dir + "/" + this.clipboard[i].name; + else + failed++; + if (this.clipboard.length == failed) { + browser.alert(this.label("The files in the Clipboard are not movable.")) + return; + } + + var go = function(callBack) { + browser.fadeFiles(); + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('mv_cbd'), + data: {dir: dir, files: files}, + async: false, + success: function(data) { + if (callBack) callBack(); + browser.check4errors(data); + browser.clearClipboard(); + browser.refresh(); + }, + error: function() { + if (callBack) callBack(); + $('#files > div').css({ + opacity: '', + filter: '' + }); + browser.alert(browser.label("Unknown error.")); + } + }); + }; + + if (failed) + browser.confirm( + browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?", {count: failed}), + go + ); + else + go(); +}; + +browser.deleteClipboard = function() { + if (!this.clipboard || !this.clipboard.length) return; + var files = []; + var failed = 0; + for (i = 0; i < this.clipboard.length; i++) + if (this.clipboard[i].readable && this.clipboard[i].writable) + files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; + else + failed++; + if (this.clipboard.length == failed) { + browser.alert(this.label("The files in the Clipboard are not removable.")) + return; + } + var go = function(callBack) { + browser.fadeFiles(); + $.ajax({ + type: 'POST', + dataType: 'json', + url: browser.baseGetData('rm_cbd'), + data: {files:files}, + async: false, + success: function(data) { + if (callBack) callBack(); + browser.check4errors(data); + browser.clearClipboard(); + browser.refresh(); + }, + error: function() { + if (callBack) callBack(); + $('#files > div').css({ + opacity: '', + filter:'' + }); + browser.alert(browser.label("Unknown error.")); + } + }); + }; + if (failed) + browser.confirm( + browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?", {count: failed}), + go + ); + else + go(); +}; + +browser.downloadClipboard = function() { + if (!this.clipboard || !this.clipboard.length) return; + var files = []; + for (i = 0; i < this.clipboard.length; i++) + if (this.clipboard[i].readable) + files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; + if (files.length) + this.post(this.baseGetData('downloadClipboard'), {files:files}); +}; + +browser.clearClipboard = function() { + $('#clipboard').html(''); + this.clipboard = []; +}; +/** This file is part of KCFinder project + * + * @desc Upload files using drag and drop + * @package KCFinder + * @version 3.0-dev + * @author Forum user (updated by Pavel Tzonkov) + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.initDropUpload = function() { + if ((typeof(XMLHttpRequest) == 'undefined') || + (typeof(document.addEventListener) == 'undefined') || + (typeof(File) == 'undefined') || + (typeof(FileReader) == 'undefined') + ) + return; + + if (!XMLHttpRequest.prototype.sendAsBinary) { + XMLHttpRequest.prototype.sendAsBinary = function(datastr) { + var ords = Array.prototype.map.call(datastr, function(x) { + return x.charCodeAt(0) & 0xff; + }); + var ui8a = new Uint8Array(ords); + this.send(ui8a.buffer); + } + } + + var uploadQueue = [], + uploadInProgress = false, + filesCount = 0, + errors = [], + files = $('#files'), + folders = $('div.folder > a'), + boundary = '------multipartdropuploadboundary' + (new Date).getTime(), + currentFile, + + filesDragOver = function(e) { + if (e.preventDefault) e.preventDefault(); + $('#files').addClass('drag'); + return false; + }, + + filesDragEnter = function(e) { + if (e.preventDefault) e.preventDefault(); + return false; + }, + + filesDragLeave = function(e) { + if (e.preventDefault) e.preventDefault(); + $('#files').removeClass('drag'); + return false; + }, + + filesDrop = function(e) { + if (e.preventDefault) e.preventDefault(); + if (e.stopPropagation) e.stopPropagation(); + $('#files').removeClass('drag'); + if (!$('#folders span.current').first().parent().data('writable')) { + browser.alert("Cannot write to upload folder."); + return false; + } + filesCount += e.dataTransfer.files.length + for (var i = 0; i < e.dataTransfer.files.length; i++) { + var file = e.dataTransfer.files[i]; + file.thisTargetDir = browser.dir; + uploadQueue.push(file); + } + processUploadQueue(); + return false; + }, + + folderDrag = function(e) { + if (e.preventDefault) e.preventDefault(); + return false; + }, + + folderDrop = function(e, dir) { + if (e.preventDefault) e.preventDefault(); + if (e.stopPropagation) e.stopPropagation(); + if (!$(dir).data('writable')) { + browser.alert("Cannot write to upload folder."); + return false; + } + filesCount += e.dataTransfer.files.length + for (var i = 0; i < e.dataTransfer.files.length; i++) { + var file = e.dataTransfer.files[i]; + file.thisTargetDir = $(dir).data('path'); + uploadQueue.push(file); + } + processUploadQueue(); + return false; + }; + + files.get(0).removeEventListener('dragover', filesDragOver, false); + files.get(0).removeEventListener('dragenter', filesDragEnter, false); + files.get(0).removeEventListener('dragleave', filesDragLeave, false); + files.get(0).removeEventListener('drop', filesDrop, false); + + files.get(0).addEventListener('dragover', filesDragOver, false); + files.get(0).addEventListener('dragenter', filesDragEnter, false); + files.get(0).addEventListener('dragleave', filesDragLeave, false); + files.get(0).addEventListener('drop', filesDrop, false); + + folders.each(function() { + var folder = this, + + dragOver = function(e) { + $(folder).children('span.folder').addClass('context'); + return folderDrag(e); + }, + + dragLeave = function(e) { + $(folder).children('span.folder').removeClass('context'); + return folderDrag(e); + }, + + drop = function(e) { + $(folder).children('span.folder').removeClass('context'); + return folderDrop(e, folder); + }; + + this.removeEventListener('dragover', dragOver, false); + this.removeEventListener('dragenter', folderDrag, false); + this.removeEventListener('dragleave', dragLeave, false); + this.removeEventListener('drop', drop, false); + + this.addEventListener('dragover', dragOver, false); + this.addEventListener('dragenter', folderDrag, false); + this.addEventListener('dragleave', dragLeave, false); + this.addEventListener('drop', drop, false); + }); + + function updateProgress(evt) { + var progress = evt.lengthComputable + ? Math.round((evt.loaded * 100) / evt.total) + '%' + : Math.round(evt.loaded / 1024) + " KB"; + $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { + number: filesCount - uploadQueue.length, + count: filesCount, + progress: progress + })); + } + + function processUploadQueue() { + if (uploadInProgress) + return false; + + if (uploadQueue && uploadQueue.length) { + var file = uploadQueue.shift(); + currentFile = file; + $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { + number: filesCount - uploadQueue.length, + count: filesCount, + progress: "" + })); + $('#loading').css('display', 'inline'); + + var reader = new FileReader(); + reader.thisFileName = file.name; + reader.thisFileType = file.type; + reader.thisFileSize = file.size; + reader.thisTargetDir = file.thisTargetDir; + + reader.onload = function(evt) { + uploadInProgress = true; + + var postbody = '--' + boundary + '\r\nContent-Disposition: form-data; name="upload[]"'; + if (evt.target.thisFileName) + postbody += '; filename="' + _.utf8encode(evt.target.thisFileName) + '"'; + postbody += '\r\n'; + if (evt.target.thisFileSize) + postbody += 'Content-Length: ' + evt.target.thisFileSize + '\r\n'; + postbody += 'Content-Type: ' + evt.target.thisFileType + '\r\n\r\n' + evt.target.result + '\r\n--' + boundary + '\r\nContent-Disposition: form-data; name="dir"\r\n\r\n' + _.utf8encode(evt.target.thisTargetDir) + '\r\n--' + boundary + '\r\n--' + boundary + '--\r\n'; + + var xhr = new XMLHttpRequest(); + xhr.thisFileName = evt.target.thisFileName; + + if (xhr.upload) { + xhr.upload.thisFileName = evt.target.thisFileName; + xhr.upload.addEventListener("progress", updateProgress, false); + } + xhr.open('POST', browser.baseGetData('upload'), true); + xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); + xhr.setRequestHeader('Content-Length', postbody.length); + + xhr.onload = function(e) { + $('#loading').css('display', 'none'); + if (browser.dir == reader.thisTargetDir) + browser.fadeFiles(); + uploadInProgress = false; + processUploadQueue(); + if (xhr.responseText.substr(0, 1) != '/') + errors[errors.length] = xhr.responseText; + } + + xhr.sendAsBinary(postbody); + }; + + reader.onerror = function(evt) { + $('#loading').css('display', 'none'); + uploadInProgress = false; + processUploadQueue(); + errors[errors.length] = browser.label("Failed to upload {filename}!", { + filename: evt.target.thisFileName + }); + }; + + reader.readAsBinaryString(file); + + } else { + filesCount = 0; + var loop = setInterval(function() { + if (uploadInProgress) return; + boundary = '------multipartdropuploadboundary' + (new Date).getTime(); + uploadQueue = []; + clearInterval(loop); + if (currentFile.thisTargetDir == browser.dir) + browser.refresh(); + if (errors.length) { + browser.alert(errors.join('\n')); + errors = []; + } + }, 333); + } + } +}; +/** This file is part of KCFinder project + * + * @desc Miscellaneous functionality + * @package KCFinder + * @version 3.0-dev + * @author Pavel Tzonkov + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + */ + +browser.drag = function(ev, dd) { + var top = dd.offsetY, + left = dd.offsetX; + if (top < 0) top = 0; + if (left < 0) left = 0; + if (top + $(this).outerHeight() > $(window).height()) + top = $(window).height() - $(this).outerHeight(); + if (left + $(this).outerWidth() > $(window).width()) + left = $(window).width() - $(this).outerWidth(); + $(this).css({ + top: top, + left: left + }); +}; + +browser.showDialog = function(e) { + $('#dialog').css({left: 0, top: 0}); + this.shadow(); + if ($('#dialog div.box') && !$('#dialog div.title').get(0)) { + var html = $('#dialog div.box').html(); + var title = $('#dialog').data('title') ? $('#dialog').data('title') : ""; + html = '
' + title + '
' + html; + $('#dialog div.box').html(html); + $('#dialog div.title span.close').mousedown(function() { + $(this).addClass('clicked'); + }); + $('#dialog div.title span.close').mouseup(function() { + $(this).removeClass('clicked'); + }); + $('#dialog div.title span.close').click(function() { + browser.hideDialog(); + browser.hideAlert(); + }); + } + $('#dialog').drag(browser.drag, {handle: '#dialog div.title'}); + $('#dialog').css('display', 'block'); + + if (e) { + var left = e.pageX - parseInt($('#dialog').outerWidth() / 2); + var top = e.pageY - parseInt($('#dialog').outerHeight() / 2); + if (left < 0) left = 0; + if (top < 0) top = 0; + if (($('#dialog').outerWidth() + left) > $(window).width()) + left = $(window).width() - $('#dialog').outerWidth(); + if (($('#dialog').outerHeight() + top) > $(window).height()) + top = $(window).height() - $('#dialog').outerHeight(); + $('#dialog').css({ + left: left + 'px', + top: top + 'px' + }); + } else + $('#dialog').css({ + left: parseInt(($(window).width() - $('#dialog').outerWidth()) / 2) + 'px', + top: parseInt(($(window).height() - $('#dialog').outerHeight()) / 2) + 'px' + }); + $(document).unbind('keydown'); + $(document).keydown(function(e) { + if (e.keyCode == 27) + browser.hideDialog(); + }); +}; + +browser.hideDialog = function() { + this.unshadow(); + if ($('#clipboard').hasClass('selected')) + $('#clipboard').removeClass('selected'); + $('#dialog').css('display', 'none'); + $('div.folder > a > span.folder').removeClass('context'); + $('#dialog').html(''); + $('#dialog').data('title', null); + $('#dialog').unbind(); + $('#dialog').click(function() { + return false; + }); + $(document).unbind('keydown'); + $(document).keydown(function(e) { + return !browser.selectAll(e); + }); + browser.hideAlert(); +}; + +browser.showAlert = function(shadow) { + $('#alert').css({left: 0, top: 0}); + if (typeof shadow == 'undefined') + shadow = true; + if (shadow) + this.shadow(); + var left = parseInt(($(window).width() - $('#alert').outerWidth()) / 2), + top = parseInt(($(window).height() - $('#alert').outerHeight()) / 2); + var wheight = $(window).height(); + if (top < 0) + top = 0; + $('#alert').css({ + left: left + 'px', + top: top + 'px', + display: 'block' + }); + if ($('#alert').outerHeight() > wheight) { + $('#alert div.message').css({ + height: wheight - $('#alert div.title').outerHeight() - $('#alert div.ok').outerHeight() - 20 + 'px' + }); + } + $(document).unbind('keydown'); + $(document).keydown(function(e) { + if (e.keyCode == 27) { + browser.hideDialog(); + browser.hideAlert(); + $(document).unbind('keydown'); + $(document).keydown(function(e) { + return !browser.selectAll(e); + }); + } + }); +}; + +browser.hideAlert = function(shadow) { + if (typeof shadow == 'undefined') + shadow = true; + if (shadow) + this.unshadow(); + $('#alert').css('display', 'none'); + $('#alert').html(''); + $('#alert').data('title', null); +}; + +browser.alert = function(msg, shadow) { + msg = msg.replace(/\r?\n/g, "
"); + var title = $('#alert').data('title') ? $('#alert').data('title') : browser.label("Attention"); + $('#alert').html('
' + title + '
' + msg + '
'); + $('#alert div.ok button').click(function() { + browser.hideAlert(shadow); + }); + $('#alert div.title span.close').mousedown(function() { + $(this).addClass('clicked'); + }); + $('#alert div.title span.close').mouseup(function() { + $(this).removeClass('clicked'); + }); + $('#alert div.title span.close').click(function() { + browser.hideAlert(shadow); + }); + $('#alert').drag(browser.drag, {handle: "#alert div.title"}); + browser.showAlert(shadow); +}; + +browser.confirm = function(question, callBack) { + $('#dialog').data('title', browser.label("Question")); + $('#dialog').html('
' + browser.label(question) + '
'); + browser.showDialog(); + $('#dialog div.buttons button').first().click(function() { + browser.hideDialog(); + }); + $('#dialog div.buttons button').last().click(function() { + if (callBack) + callBack(function() { + browser.hideDialog(); + }); + else + browser.hideDialog(); + }); + $('#dialog div.buttons button').get(1).focus(); +}; + +browser.shadow = function() { + $('#shadow').css('display', 'block'); +}; + +browser.unshadow = function() { + $('#shadow').css('display', 'none'); +}; + +browser.showMenu = function(e) { + var left = e.pageX; + var top = e.pageY; + if (($('#dialog').outerWidth() + left) > $(window).width()) + left = $(window).width() - $('#dialog').outerWidth(); + if (($('#dialog').outerHeight() + top) > $(window).height()) + top = $(window).height() - $('#dialog').outerHeight(); + $('#dialog').css({ + left: left + 'px', + top: top + 'px', + display: 'none' + }); + $('#dialog').fadeIn(); +}; + +browser.fileNameDialog = function(e, post, inputName, inputValue, url, labels, callBack, selectAll) { + var html = '
' + + '
' + + '
' + + '
' + + ' ' + + '' + + '
'; + $('#dialog').html(html); + $('#dialog').data('title', this.label(labels.title)); + $('#dialog input[name="' + inputName + '"]').attr('value', inputValue); + $('#dialog').unbind(); + $('#dialog').click(function() { + return false; + }); + $('#dialog form').submit(function() { + var name = this.elements[0]; + name.value = $.trim(name.value); + if (name.value == '') { + browser.alert(browser.label(labels.errEmpty), false); + name.focus(); + return; + } else if (/[\/\\]/g.test(name.value)) { + browser.alert(browser.label(labels.errSlash), false); + name.focus(); + return; + } else if (name.value.substr(0, 1) == ".") { + browser.alert(browser.label(labels.errDot), false); + name.focus(); + return; + } + eval('post.' + inputName + ' = name.value;'); + $.ajax({ + type: 'POST', + dataType: 'json', + url: url, + data: post, + async: false, + success: function(data) { + if (browser.check4errors(data, false)) + return; + if (callBack) callBack(data); + browser.hideDialog(); + }, + error: function() { + browser.alert(browser.label("Unknown error."), false); + } + }); + return false; + }); + browser.showDialog(e); + $('#dialog').css('display', 'block'); + $('#dialog input[type="submit"]').click(function() { + return $('#dialog form').submit(); + }); + var field = $('#dialog input[type="text"]'); + var value = field.attr('value'); + if (!selectAll && /^(.+)\.[^\.]+$/ .test(value)) { + value = value.replace(/^(.+)\.[^\.]+$/, "$1"); + _.selection(field.get(0), 0, value.length); + } else { + field.get(0).focus(); + field.get(0).select(); + } +}; + +browser.orderFiles = function(callBack, selected) { + var order = _.kuki.get('order'); + var desc = (_.kuki.get('orderDesc') == 'on'); + + if (!browser.files || !browser.files.sort) + browser.files = []; + + browser.files = browser.files.sort(function(a, b) { + var a1, b1, arr; + if (!order) order = 'name'; + + if (order == 'date') { + a1 = a.mtime; + b1 = b.mtime; + } else if (order == 'type') { + a1 = _.getFileExtension(a.name); + b1 = _.getFileExtension(b.name); + } else if (order == 'size') { + a1 = a.size; + b1 = b.size; + } else + eval('a1 = a.' + order + '.toLowerCase(); b1 = b.' + order + '.toLowerCase();'); + + if ((order == 'size') || (order == 'date')) { + if (a1 < b1) return desc ? 1 : -1; + if (a1 > b1) return desc ? -1 : 1; + } + + if (a1 == b1) { + a1 = a.name.toLowerCase(); + b1 = b.name.toLowerCase(); + arr = [a1, b1]; + arr = arr.sort(); + return (arr[0] == a1) ? -1 : 1; + } + + arr = [a1, b1]; + arr = arr.sort(); + if (arr[0] == a1) return desc ? 1 : -1; + return desc ? -1 : 1; + }); + + browser.showFiles(callBack, selected); + browser.initFiles(); +}; + +browser.humanSize = function(size) { + if (size < 1024) { + size = size.toString() + ' B'; + } else if (size < 1048576) { + size /= 1024; + size = parseInt(size).toString() + ' KB'; + } else if (size < 1073741824) { + size /= 1048576; + size = parseInt(size).toString() + ' MB'; + } else if (size < 1099511627776) { + size /= 1073741824; + size = parseInt(size).toString() + ' GB'; + } else { + size /= 1099511627776; + size = parseInt(size).toString() + ' TB'; + } + return size; +}; + +browser.baseGetData = function(act) { + var data = 'browse.php?type=' + encodeURIComponent(this.type) + '&lng=' + this.lang; + if (act) + data += "&act=" + act; + if (this.cms) + data += "&cms=" + this.cms; + return data; +}; + +browser.label = function(index, data) { + var label = this.labels[index] ? this.labels[index] : index; + if (data) + $.each(data, function(key, val) { + label = label.replace('{' + key + '}', val); + }); + return label; +}; + +browser.check4errors = function(data, shadow) { + if (!data.error) + return false; + var msg; + if (data.error.join) + msg = data.error.join("\n"); + else + msg = data.error; + browser.alert(msg, shadow); + return true; +}; + +browser.post = function(url, data) { + var html = '
'; + $.each(data, function(key, val) { + if ($.isArray(val)) + $.each(val, function(i, aval) { + html += ''; + }); + else + html += ''; + }); + html += '
'; + $('#dialog').html(html); + $('#dialog').css('display', 'block'); + $('#postForm').get(0).submit(); +}; + +browser.fadeFiles = function() { + $('#files > div').css({ + opacity: '0.4', + filter: 'alpha(opacity:40)' + }); +}; diff --git a/cache/theme_dark.css b/cache/theme_dark.css new file mode 100644 index 0000000..9538190 --- /dev/null +++ b/cache/theme_dark.css @@ -0,0 +1 @@ +body{background:#3b4148;color:#fff}input{margin:0}input[type="radio"],input[type="checkbox"],label{cursor:pointer}input[type="text"]{border:1px solid #3b4148;background:#fff;padding:2px;margin:0;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;outline-width:0}input[type="text"]:hover{border-color:#69727b}input[type="text"]:focus{border-color:#69727b;box-shadow:0 0 3px rgba(0,0,0,1);-moz-box-shadow:0 0 3px rgba(0,0,0,1);-webkit-box-shadow:0 0 3px rgba(0,0,0,1)}input[type="button"],input[type="submit"],input[type="reset"],button{outline-width:0;background:#edeceb;border:1px solid #fff;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;box-shadow:0 1px 1px rgba(0,0,0,0.6);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.6);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.6);color:#222}input[type="button"]:hover,input[type="submit"]:hover,input[type="reset"]:hover,button:hover{box-shadow:0 0 1px rgba(0,0,0,0.6);-moz-box-shadow:0 0 1px rgba(0,0,0,0.6);-webkit-box-shadow:0 0 1px rgba(0,0,0,0.6)}input[type="button"]:focus,input[type="submit"]:focus,input[type="reset"]:focus,button:focus{box-shadow:0 0 2px rgba(54,135,226,1);-moz-box-shadow:0 0 2px rgba(255,255,255,1);-webkit-box-shadow:0 0 2px rgba(54,135,226,1)}fieldset{margin:0 5px 5px 0;padding:5px;border:1px solid #69727b;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;cursor:default}fieldset td{white-space:nowrap}legend{margin:0;padding:0 3px;font-weight:bold}#folders{margin:4px 4px 0 4px;background:#566068;border:1px solid #69727b;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px}#files{float:left;margin:0 4px 0 0;background:#566068;border:1px solid #69727b;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px}#files.drag{background:#69727b}#topic{padding-left:12px}div.folder{padding-top:2px;margin-top:4px;white-space:nowrap}div.folder a{text-decoration:none;cursor:default;outline:0;color:#fff}span.folder{padding:2px 3px 2px 23px;outline:0;background:no-repeat 3px center;cursor:pointer;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #566068}span.brace{width:16px;height:16px;outline:0}span.current{background-image:url(img/tree/folder_current.png);background-color:#454c55;border-color:#3b4148;color:#fff}span.regular{background-image:url(img/tree/folder.png);background-color:#69727b}span.regular:hover,span.context{background-color:#9199a1;border-color:#69727b}span.opened{background-image:url(img/tree/minus.png)}span.closed{background-image:url(img/tree/plus.png)}span.denied{background-image:url(img/tree/denied.png)}div.file{padding:4px;margin:3px;border:1px solid #3b4148;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;background:#69727b;color:#000}div.file:hover{background:#9199a1;border-color:#3b4148}div.file .name{margin-top:4px;font-weight:normal;height:16px;overflow:hidden}div.file .time{font-size:10px}div.file .size{font-size:10px}#files div.selected,#files div.selected:hover{background-color:#3b4148;border-color:#69727b;color:#fff}tr.file>td{padding:3px 4px;background-color:#69727b}tr.file:hover>td{background-color:#9199a1}tr.selected>td,tr.selected:hover>td{background-color:#3b4148;color:#fff}#toolbar{padding:5px 0;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}#toolbar a{color:#fff;padding:4px 4px 4px 24px;margin-right:5px;border:1px solid transparent;background:no-repeat 2px center;outline:0;display:block;float:left;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}#toolbar a:hover,#toolbar a.hover{background-color:#566068;border-color:#69727b;color:#fff}#toolbar a.selected{background-color:#566068;border-color:#69727b}#toolbar a[href="kcact:upload"]{background-image:url(img/icons/upload.png)}#toolbar a[href="kcact:refresh"]{background-image:url(img/icons/refresh.png)}#toolbar a[href="kcact:settings"]{background-image:url(img/icons/settings.png)}#toolbar a[href="kcact:about"]{background-image:url(img/icons/about.png)}#toolbar a[href="kcact:maximize"]{background-image:url(img/icons/maximize.png)}.box,#loading,#alert{padding:5px;border:1px solid #69727b;background:#566068;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}.box,#alert{padding:8px;border-color:#69727b;-moz-box-shadow:0 0 8px rgba(0,0,0,1);-webkit-box-shadow:0 0 8px rgba(0,0,0,1);box-shadow:0 0 8px rgba(0,0,0,1)}#loading{background-image:url(img/loading.gif);font-weight:normal;margin-right:4px;color:#fff}#alert div.message{padding:0 0 0 40px}#alert{background:#566068 url(img/cross.png) no-repeat 8px 29px}#dialog div.question{padding:0 0 0 40px;background:transparent url(img/question.png) no-repeat 0 0}#alert div.ok,#dialog div.buttons{padding-top:5px;text-align:right}.menu{padding:2px;border:1px solid #69727b;background:#3b4148;opacity:.95}.menu a{text-decoration:none;padding:3px 3px 3px 22px;background:no-repeat 2px center;color:#fff;margin:0;background-color:#3b4148;outline:0;border:1px solid transparent;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}.menu .delimiter{border-top:1px solid #69727b;padding-bottom:3px;margin:3px 2px 0 2px}.menu a:hover{background-color:#566068;border-color:#69727b}.menu a[href="kcact:refresh"]{background-image:url(img/icons/refresh.png)}.menu a[href="kcact:mkdir"]{background-image:url(img/icons/folder-new.png)}.menu a[href="kcact:mvdir"],.menu a[href="kcact:mv"]{background-image:url(img/icons/rename.png)}.menu a[href="kcact:rmdir"],.menu a[href="kcact:rm"],.menu a[href="kcact:rmcbd"]{background-image:url(img/icons/delete.png)}.menu a[href="kcact:clpbrdadd"]{background-image:url(img/icons/clipboard-add.png)}.menu a[href="kcact:pick"],.menu a[href="kcact:pick_thumb"]{background-image:url(img/icons/select.png)}.menu a[href="kcact:download"]{background-image:url(img/icons/download.png)}.menu a[href="kcact:view"]{background-image:url(img/icons/view.png)}.menu a[href="kcact:cpcbd"]{background-image:url(img/icons/copy.png)}.menu a[href="kcact:mvcbd"]{background-image:url(img/icons/move.png)}.menu a[href="kcact:clrcbd"]{background-image:url(img/icons/clipboard-clear.png)}a.denied{color:#666;opacity:.5;filter:alpha(opacity:50);cursor:default}a.denied:hover{background-color:#e4e3e2;border-color:transparent}#dialog{-moz-box-shadow:0 0 5px rgba(0,0,0,0.5);-webkit-box-shadow:0 0 5px rgba(0,0,0,0.5);box-shadow:0 0 5px rgba(0,0,0,0.5)}#dialog input[type="text"]{margin:5px 0;width:200px}#dialog div.slideshow{border:1px solid #000;padding:5px 5px 3px 5px;background:#000;-moz-box-shadow:0 0 8px rgba(0,0,0,1);-webkit-box-shadow:0 0 8px rgba(0,0,0,1);box-shadow:0 0 8px rgba(0,0,0,1)}#dialog img{border:1px solid #3687e2;background:url(img/bg_transparent.png)}#loadingDirs{padding:5px 0 1px 24px}.about{text-align:center;padding:6px}.about div.head{font-weight:bold;font-size:12px;padding:3px 0 8px 0}.about div.head a{background:url(img/kcf_logo.png) no-repeat left center;padding:0 0 0 27px;font-size:17px}.about a{text-decoration:none;color:#fff}.about a:hover{text-decoration:underline}.about button{margin-top:8px}#clipboard{padding:0 4px 1px 0}#clipboard div{background:url(img/icons/clipboard.png) no-repeat center center;border:1px solid transparent;padding:1px;cursor:pointer;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}#clipboard div:hover{background-color:#bfbdbb;border-color:#a9a59f}#clipboard.selected div,#clipboard.selected div:hover{background-color:#c9c7c4;border-color:#3687e2}#shadow{background:#000}button,input[type="submit"],input[type="button"]{color:#fff;background:#3b4148;border:1px solid #69727b;padding:3px 5px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}#checkver{padding-bottom:8px}#checkver>span{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}#checkver>span.loading{background:url(img/loading.gif)}#checkver span{padding:2px}#checkver a{font-weight:normal;padding:3px 3px 3px 20px;background:url(img/icons/download.png) no-repeat left center}div.title{background:#1a1d1f;overflow:auto;text-align:center;margin:-5px -5px 5px -5px;padding-left:19px;padding-bottom:2px;padding-top:2px;font-weight:bold;cursor:move;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;box-shadow:0 0 1px rgba(0,0,0,0.6);-moz-box-shadow:0 0 1px rgba(0,0,0,0.6);-webkit-box-shadow:0 0 1px rgba(0,0,0,0.6)}.about div.title{cursor:default}span.close,span.clicked{float:right;width:19px;height:20px;background:url(img/icons/close.png) no-repeat left 2px;margin-top:-3px;cursor:default}span.close:hover{background-image:url(img/icons/close-hover.png)}span.clicked:hover{background-image:url(img/icons/close-clicked.png)} \ No newline at end of file diff --git a/cache/theme_dark.js b/cache/theme_dark.js new file mode 100644 index 0000000..d6f32ba --- /dev/null +++ b/cache/theme_dark.js @@ -0,0 +1 @@ +new Image().src="themes/dark/img/loading.gif"; \ No newline at end of file diff --git a/cache/theme_oxygen.css b/cache/theme_oxygen.css new file mode 100644 index 0000000..d5c74de --- /dev/null +++ b/cache/theme_oxygen.css @@ -0,0 +1,566 @@ +body { + background: #e0dfde; +} + +input { + margin: 0; +} + +input[type="radio"], input[type="checkbox"], label { + cursor: pointer; +} + +input[type="text"] { + border: 1px solid #d3d3d3; + background: #fff; + padding: 2px; + margin: 0; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + box-shadow: 0 -1px 0 rgba(0,0,0,0.5); + -moz-box-shadow: 0 -1px 0 rgba(0,0,0,0.5); + -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.5); + outline-width: 0; +} + +input[type="text"]:hover { + box-shadow: 0 -1px 0 rgba(0,0,0,0.2); + -moz-box-shadow: 0 -1px 0 rgba(0,0,0,0.2); + -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.2); +} + +input[type="text"]:focus { + border-color: #3687e2; + box-shadow: 0 0 3px rgba(54,135,226,1); + -moz-box-shadow: 0 0 3px rgba(54,135,226,1); + -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); +} + +input[type="button"], input[type="submit"], input[type="reset"], button { + outline-width: 0; + background: #edeceb; + border: 1px solid #fff; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 0 1px 1px rgba(0,0,0,0.6); + -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.6); + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.6); + color: #222; +} + +input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:hover { + box-shadow: 0 0 1px rgba(0,0,0,0.6); + -moz-box-shadow: 0 0 1px rgba(0,0,0,0.6); + -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.6); +} + +input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus, button:focus { + box-shadow: 0 0 5px rgba(54,135,226,1); + -moz-box-shadow: 0 0 5px rgba(54,135,226,1); + -webkit-box-shadow: 0 0 5px rgba(54,135,226,1); +} + +fieldset { + margin: 0 5px 5px 0px; + padding: 5px; + border: 1px solid #afadaa; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + cursor: default; +} + +fieldset td { + white-space: nowrap; +} + +legend { + margin: 0; + padding:0 3px; + font-weight: bold; +} + +#folders { + margin: 4px 4px 0 4px; + background: #f8f7f6; + border: 1px solid #adaba9; + border-radius: 6px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; +} + +#files { + float: left; + margin: 0 4px 0 0; + background: #f8f7f6; + border: 1px solid #adaba9; + border-radius: 6px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; +} + +#files.drag { + background: #ddebf8; +} + +#topic { + padding-left: 12px; +} + + +div.folder { + padding-top: 2px; + margin-top: 4px; + white-space: nowrap; +} + +div.folder a { + text-decoration: none; + cursor: default; + outline: none; + color: #000; +} + +span.folder { + padding: 2px 3px 2px 23px; + outline: none; + background: no-repeat 3px center; + cursor: pointer; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border: 1px solid transparent; +} + +span.brace { + width: 16px; + height: 16px; + outline: none; +} + +span.current { + background-image: url(img/tree/folder_current.png); + background-color: #5b9bda; + border-color: #2973bd; + color: #fff; +} + +span.regular { + background-image: url(img/tree/folder.png); + background-color: #f8f7f6; +} + +span.regular:hover, span.context { + background-color: #ddebf8; + border-color: #cee0f4; + color: #000; +} + +span.opened { + background-image: url(img/tree/minus.png); +} + +span.closed { + background-image: url(img/tree/plus.png); +} + +span.denied { + background-image: url(img/tree/denied.png); +} + +div.file { + padding: 4px; + margin: 3px; + border: 1px solid #aaa; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + background: #fff; +} + +div.file:hover { + background: #ddebf8; + border-color: #a7bed7; +} + +div.file .name { + margin-top: 4px; + font-weight: bold; + height: 16px; + overflow: hidden; +} + +div.file .time { + font-size: 10px; +} + +div.file .size { + font-size: 10px; +} + +#files div.selected, +#files div.selected:hover { + background-color: #5b9bda; + border-color: #2973bd; + color: #fff; +} + +tr.file > td { + padding: 3px 4px; + background-color: #f8f7f6 +} + +tr.file:hover > td { + background-color: #ddebf8; +} + +tr.selected > td, +tr.selected:hover > td { + background-color: #5b9bda; + color: #fff; +} + +#toolbar { + padding: 5px 0; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + +#toolbar a { + color: #000; + padding: 4px 4px 4px 24px; + margin-right: 5px; + border: 1px solid transparent; + background: no-repeat 2px center; + outline: none; + display: block; + float: left; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; +} + +#toolbar a:hover, +#toolbar a.hover { + background-color: #cfcfcf; + border-color: #afadaa; + box-shadow: inset 0 0 3px rgba(175,173,170,1); + -moz-box-shadow: inset 0 0 3px rgba(175,173,170,1); + -webkit-box-shadow: inset 0 0 3px rgba(175,173,170,1); +} + +#toolbar a.selected { + background-color: #eeeeff; + border-color: #3687e2; + box-shadow: inset 0 0 3px rgba(54,135,226,1); + -moz-box-shadow: inset 0 0 3px rgba(54,135,226,1); + -webkit-box-shadow: inset 0 0 3px rgba(54,135,226,1); +} + +#toolbar a[href="kcact:upload"] { + background-image: url(img/icons/upload.png); +} + +#toolbar a[href="kcact:refresh"] { + background-image: url(img/icons/refresh.png); +} + +#toolbar a[href="kcact:settings"] { + background-image: url(img/icons/settings.png); +} + +#toolbar a[href="kcact:about"] { + background-image: url(img/icons/about.png); +} + +#toolbar a[href="kcact:maximize"] { + background-image: url(img/icons/maximize.png); +} + +#settings { + background: #e0dfde; +} + +.box, #loading, #alert { + padding: 5px; + border: 1px solid #3687e2; + background: #e0dfde; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.box, #alert { + padding: 8px; + border-color: #fff; + -moz-box-shadow: 0 0 8px rgba(255,255,255,1); + -webkit-box-shadow: 0 0 8px rgba(255,255,255,1); + box-shadow: 0 0 8px rgba(255,255,255,1); +} + +#loading { + background-image: url(img/loading.gif); + font-weight: bold; + margin-right: 4px; + box-shadow: 0 0 3px rgba(54,135,226,1); + -moz-box-shadow: 0 0 3px rgba(54,135,226,1); + -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); +} + +#alert div.message, #dialog div.question { + padding: 0 0 0 40px; +} + +#alert { + background: #e0dfde url(img/alert.png) no-repeat 8px 29px; +} + +#dialog div.question { + background: #e0dfde url(img/confirm.png) no-repeat 0 0; +} + +#alert div.ok, #dialog div.buttons { + padding-top: 5px; + text-align: right; +} + +.menu { + padding: 2px; + border: 1px solid #acaaa7; + background: #e4e3e2; + opacity: 0.95; +} + +.menu a { + text-decoration: none; + padding: 3px 3px 3px 22px; + background: no-repeat 2px center; + color: #000; + margin: 0; + background-color: #e4e3e2; + outline: none; + border: 1px solid transparent; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; +} + +.menu .delimiter { + border-top: 1px solid #acaaa7; + padding-bottom: 3px; + margin: 3px 2px 0 2px; +} + +.menu a:hover { + background-color: #cfcfcf; + border-color: #afadaa; + box-shadow: inset 0 0 3px rgba(175,173,170,1); + -moz-box-shadow: inset 0 0 3px rgba(175,173,170,1); + -webkit-box-shadow: inset 0 0 3px rgba(175,173,170,1); +} + +.menu a[href="kcact:refresh"] { + background-image: url(img/icons/refresh.png); +} + +.menu a[href="kcact:mkdir"] { + background-image: url(img/icons/folder-new.png); +} + +.menu a[href="kcact:mvdir"], .menu a[href="kcact:mv"] { + background-image: url(img/icons/rename.png); +} + +.menu a[href="kcact:rmdir"], .menu a[href="kcact:rm"], .menu a[href="kcact:rmcbd"] { + background-image: url(img/icons/delete.png); +} + +.menu a[href="kcact:clpbrdadd"] { + background-image: url(img/icons/clipboard-add.png); +} + +.menu a[href="kcact:pick"], .menu a[href="kcact:pick_thumb"] { + background-image: url(img/icons/select.png); +} + +.menu a[href="kcact:download"] { + background-image: url(img/icons/download.png); +} + +.menu a[href="kcact:view"] { + background-image: url(img/icons/view.png); +} + +.menu a[href="kcact:cpcbd"] { + background-image: url(img/icons/copy.png); +} + +.menu a[href="kcact:mvcbd"] { + background-image: url(img/icons/move.png); +} + +.menu a[href="kcact:clrcbd"] { + background-image: url(img/icons/clipboard-clear.png); +} + +a.denied { + color: #666; + opacity: 0.5; + filter: alpha(opacity:50); + cursor: default; +} + +a.denied:hover { + background-color: #e4e3e2; + border-color: transparent; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} + +#dialog { + -moz-box-shadow: 0 0 5px rgba(0,0,0,0.5); + -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.5); + box-shadow: 0 0 5px rgba(0,0,0,0.5); +} + +#dialog input[type="text"] { + margin: 5px 0; + width: 200px; +} + +#dialog div.slideshow { + border: 1px solid #000; + padding: 5px 5px 3px 5px; + background: #000; + -moz-box-shadow: 0 0 8px rgba(255,255,255,1); + -webkit-box-shadow: 0 0 8px rgba(255,255,255,1); + box-shadow: 0 0 8px rgba(255,255,255,1); +} + +#dialog img { + padding: 0; + margin: 0; + background: url(img/bg_transparent.png); +} + +#loadingDirs { + padding: 5px 0 1px 24px; +} + +.about { + text-align: center; +} + +.about div.head { + font-weight: bold; + font-size: 12px; + padding: 3px 0 8px 0; +} + +.about div.head a { + background: url(img/kcf_logo.png) no-repeat left center; + padding: 0 0 0 27px; + font-size: 17px; +} + +.about a { + text-decoration: none; + color: #0055ff; +} + +.about a:hover { + text-decoration: underline; +} + +.about button { + margin-top: 8px; +} + +#clipboard { + padding: 0 4px 1px 0; +} + +#clipboard div { + background: url(img/icons/clipboard.png) no-repeat center center; + border: 1px solid transparent; + padding: 1px; + cursor: pointer; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; +} + +#clipboard div:hover { + background-color: #bfbdbb; + border-color: #a9a59f; +} + +#clipboard.selected div, #clipboard.selected div:hover { + background-color: #c9c7c4; + border-color: #3687e2; +} + +#checkver { + padding-bottom: 8px; +} +#checkver > span { + padding: 2px; + border: 1px solid transparent; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +#checkver > span.loading { + background: url(img/loading.gif); + border: 1px solid #3687e2; + box-shadow: 0 0 3px rgba(54,135,226,1); + -moz-box-shadow: 0 0 3px rgba(54,135,226,1); + -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); +} + +#checkver span { + padding: 3px; +} + +#checkver a { + font-weight: normal; + padding: 3px 3px 3px 20px; + background: url(img/icons/download.png) no-repeat left center; +} + +div.title { + overflow: auto; + text-align: center; + margin: -3px -5px 5px -5px; + padding-left: 19px; + padding-bottom: 2px; + border-bottom: 1px solid #bbb; + font-weight: bold; + cursor: move; +} + +.about div.title { + cursor: default; +} + +span.close, span.clicked { + float: right; + width: 19px; + height: 19px; + background: url(img/icons/close.png); + margin-top: -3px; + cursor: default; +} + +span.close:hover { + background: url(img/icons/close-hover.png); +} + +span.clicked:hover { + background: url(img/icons/close-clicked.png); +} \ No newline at end of file diff --git a/cache/theme_oxygen.js b/cache/theme_oxygen.js new file mode 100644 index 0000000..ef325d0 --- /dev/null +++ b/cache/theme_oxygen.js @@ -0,0 +1,3 @@ +// If this file exists in theme directory, it will be loaded in section + +new Image().src = 'themes/oxygen/img/loading.gif'; // preload animated gif diff --git a/config.php b/config.php index 86a2e7a..408e115 100644 --- a/config.php +++ b/config.php @@ -16,6 +16,7 @@ // you are using session configuration. // See http://kcfinder.sunhater.com/install for setting descriptions + $_CONFIG = array( @@ -113,7 +114,7 @@ //'_jsMinCmd' => "java -jar /path/to/yuicompressor.jar --type js {file}", //'_tinyMCEPath' => "/tiny_mce", - '_sessionVar' => 'KCFINDER', + '_sessionVar' => "KCFINDER", //'_sessionLifetime' => 30, //'_sessionDir' => "/full/directory/path", diff --git a/core/autoload.php b/core/autoload.php index e185209..728f4ba 100644 --- a/core/autoload.php +++ b/core/autoload.php @@ -1,45 +1,5 @@ - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - * - * This file is the place you can put any code (at the end of the file), - * which will be executed before any other. Suitable for: - * 1. Set PHP ini settings using ini_set() - * 2. Custom session save handler with session_set_save_handler() - * 3. Any custom integration code. If you use any global variables - * here, they can be accessed in config.php via $GLOBALS array. - * It's recommended to use constants instead. - */ - - -// PHP VERSION CHECK -if (!preg_match('/^(\d+\.\d+)/', PHP_VERSION, $ver) || ($ver[1] < 5.3)) - die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5.3.0! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); - - -// SAFE MODE CHECK -if (ini_get("safe_mode")) - die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); - - -// CMS INTEGRATION -if (isset($_GET['cms']) && - (basename($_GET['cms']) == $_GET['cms']) && - is_file("integration/{$_GET['cms']}.php") -) - require "integration/{$_GET['cms']}.php"; - - -// REGISTER AUTOLOAD FUNCTION function kcfinder_autoload($path) { $path = explode("\\", $path); @@ -49,10 +9,14 @@ function kcfinder_autoload($path) { list($ns, $class) = $path; if ($ns == "kcfinder") { + if ($class == "uploader") - require "core/uploader.php"; + require "core/class/uploader.php"; elseif ($class == "browser") - require "core/browser.php"; + require "core/class/browser.php"; + elseif ($class == "minifier") + require "core/class/minifier.php"; + elseif (file_exists("core/types/$class.php")) require "core/types/$class.php"; elseif (file_exists("lib/class_$class.php")) @@ -63,140 +27,4 @@ function kcfinder_autoload($path) { } spl_autoload_register("kcfinder_autoload"); - -// json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING -if (!function_exists("json_encode")) { - - function json_encode($data) { - - if (is_array($data)) { - $ret = array(); - - // OBJECT - if (array_keys($data) !== range(0, count($data) - 1)) { - foreach ($data as $key => $val) - $ret[] = json_encode((string) $key) . ':' . json_encode($val); - return "{" . implode(",", $ret) . "}"; - - // ARRAY - } else { - foreach ($data as $val) - $ret[] = json_encode($val); - return "[" . implode(",", $ret) . "]"; - } - - // BOOLEAN OR NULL - } elseif (is_bool($data) || ($data === null)) - return ($data === null) - ? "null" - : ($data ? "true" : "false"); - - // FLOAT - elseif (is_float($data)) - return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); - - // INTEGER - elseif (is_int($data)) - return $data; - - // STRING - return '"' . - str_replace('/', "\\/", - str_replace("\t", "\\t", - str_replace("\r", "\\r", - str_replace("\n", "\\n", - str_replace('"', "\\\"", - str_replace("\\", "\\\\", - $data)))))) . '"'; - } -} - - -// CUSTOM SESSION SAVE HANDLER CLASS EXAMPLE -// -// Uncomment & edit it if the application you want to integrate with, have -// its own session save handler. It's not even needed to save instances of -// this class in variables. Just add a row: -// new SessionSaveHandler(); -// and your handler will rule the sessions ;-) - -/* -class SessionSaveHandler { - protected $savePath; - protected $sessionName; - - public function __construct() { - session_set_save_handler( - array($this, "open"), - array($this, "close"), - array($this, "read"), - array($this, "write"), - array($this, "destroy"), - array($this, "gc") - ); - } - - // Open function, this works like a constructor in classes and is - // executed when the session is being opened. The open function expects - // two parameters, where the first is the save path and the second is the - // session name. - public function open($savePath, $sessionName) { - $this->savePath = $savePath; - $this->sessionName = $sessionName; - return true; - } - - // Close function, this works like a destructor in classes and is - // executed when the session operation is done. - public function close() { - return true; - } - - // Read function must return string value always to make save handler - // work as expected. Return empty string if there is no data to read. - // Return values from other handlers are converted to boolean expression. - // TRUE for success, FALSE for failure. - public function read($id) { - $file = $this->savePath . "/sess_$id"; - return (string) @file_get_contents($file); - } - - // Write function that is called when session data is to be saved. This - // function expects two parameters: an identifier and the data associated - // with it. - public function write($id, $data) { - $file = $this->savePath . "/sess_$id"; - if (false !== ($fp = @fopen($file, "w"))) { - $return = fwrite($fp, $data); - fclose($fp); - return $return; - } else - return false; - } - - // The destroy handler, this is executed when a session is destroyed with - // session_destroy() and takes the session id as its only parameter. - public function destroy($id) { - $file = $this->savePath . "/sess_$id"; - return @unlink($file); - } - - // The garbage collector, this is executed when the session garbage - // collector is executed and takes the max session lifetime as its only - // parameter. - public function gc($maxlifetime) { - foreach (glob($this->savePath . "/sess_*") as $file) - if (filemtime($file) + $maxlifetime < time()) - @unlink($file); - return true; - } -} - -new SessionSaveHandler(); - -*/ - - -// PUT YOUR ADDITIONAL CODE HERE - ?> \ No newline at end of file diff --git a/core/bootstrap.php b/core/bootstrap.php new file mode 100644 index 0000000..760fd65 --- /dev/null +++ b/core/bootstrap.php @@ -0,0 +1,181 @@ + + * @copyright 2010-2014 KCFinder Project + * @license http://opensource.org/licenses/GPL-3.0 GPLv3 + * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 + * @link http://kcfinder.sunhater.com + * + * This file is the place you can put any code (at the end of the file), + * which will be executed before any other. Suitable for: + * 1. Set PHP ini settings using ini_set() + * 2. Custom session save handler with session_set_save_handler() + * 3. Any custom integration code. If you use any global variables + * here, they can be accessed in config.php via $GLOBALS array. + * It's recommended to use constants instead. + */ + + +// PHP VERSION CHECK +if (!preg_match('/^(\d+\.\d+)/', PHP_VERSION, $ver) || ($ver[1] < 5.3)) + die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5.3.0! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); + + +// SAFE MODE CHECK +if (ini_get("safe_mode")) + die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); + + +// CMS INTEGRATION +if (isset($_GET['cms']) && + (basename($_GET['cms']) == $_GET['cms']) && + is_file("integration/{$_GET['cms']}.php") +) + require "integration/{$_GET['cms']}.php"; + + +// REGISTER AUTOLOAD FUNCTION +require "core/autoload.php"; + + +// json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING +if (!function_exists("json_encode")) { + + function json_encode($data) { + + if (is_array($data)) { + $ret = array(); + + // OBJECT + if (array_keys($data) !== range(0, count($data) - 1)) { + foreach ($data as $key => $val) + $ret[] = json_encode((string) $key) . ':' . json_encode($val); + return "{" . implode(",", $ret) . "}"; + + // ARRAY + } else { + foreach ($data as $val) + $ret[] = json_encode($val); + return "[" . implode(",", $ret) . "]"; + } + + // BOOLEAN OR NULL + } elseif (is_bool($data) || ($data === null)) + return ($data === null) + ? "null" + : ($data ? "true" : "false"); + + // FLOAT + elseif (is_float($data)) + return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); + + // INTEGER + elseif (is_int($data)) + return $data; + + // STRING + return '"' . + str_replace('/', "\\/", + str_replace("\t", "\\t", + str_replace("\r", "\\r", + str_replace("\n", "\\n", + str_replace('"', "\\\"", + str_replace("\\", "\\\\", + $data)))))) . '"'; + } +} + + +// CUSTOM SESSION SAVE HANDLER CLASS EXAMPLE +// +// Uncomment & edit it if the application you want to integrate with, have +// its own session save handler. It's not even needed to save instances of +// this class in variables. Just add a row: +// new SessionSaveHandler(); +// and your handler will rule the sessions ;-) + +/* +class SessionSaveHandler { + protected $savePath; + protected $sessionName; + + public function __construct() { + session_set_save_handler( + array($this, "open"), + array($this, "close"), + array($this, "read"), + array($this, "write"), + array($this, "destroy"), + array($this, "gc") + ); + } + + // Open function, this works like a constructor in classes and is + // executed when the session is being opened. The open function expects + // two parameters, where the first is the save path and the second is the + // session name. + public function open($savePath, $sessionName) { + $this->savePath = $savePath; + $this->sessionName = $sessionName; + return true; + } + + // Close function, this works like a destructor in classes and is + // executed when the session operation is done. + public function close() { + return true; + } + + // Read function must return string value always to make save handler + // work as expected. Return empty string if there is no data to read. + // Return values from other handlers are converted to boolean expression. + // TRUE for success, FALSE for failure. + public function read($id) { + $file = $this->savePath . "/sess_$id"; + return (string) @file_get_contents($file); + } + + // Write function that is called when session data is to be saved. This + // function expects two parameters: an identifier and the data associated + // with it. + public function write($id, $data) { + $file = $this->savePath . "/sess_$id"; + if (false !== ($fp = @fopen($file, "w"))) { + $return = fwrite($fp, $data); + fclose($fp); + return $return; + } else + return false; + } + + // The destroy handler, this is executed when a session is destroyed with + // session_destroy() and takes the session id as its only parameter. + public function destroy($id) { + $file = $this->savePath . "/sess_$id"; + return @unlink($file); + } + + // The garbage collector, this is executed when the session garbage + // collector is executed and takes the max session lifetime as its only + // parameter. + public function gc($maxlifetime) { + foreach (glob($this->savePath . "/sess_*") as $file) + if (filemtime($file) + $maxlifetime < time()) + @unlink($file); + return true; + } +} + +new SessionSaveHandler(); + +*/ + + +// PUT YOUR ADDITIONAL CODE HERE + +?> \ No newline at end of file diff --git a/core/browser.php b/core/class/browser.php similarity index 100% rename from core/browser.php rename to core/class/browser.php diff --git a/core/class/minifier.php b/core/class/minifier.php new file mode 100644 index 0000000..2e12744 --- /dev/null +++ b/core/class/minifier.php @@ -0,0 +1,96 @@ +config = $_CONFIG; + $type = strtolower($type); + if (in_array($type, array("js", "css"))) + $this->type = $type; + if (isset($_CONFIG["_{$this->type}MinCmd"])) + $this->minCmd = $_CONFIG["_{$this->type}MinCmd"]; + } + + public function minify($cacheFile=null, $dir=null) { + if ($dir === null) + $dir = dirname($_SERVER['SCRIPT_FILENAME']); + + // MODIFICATION TIME FILES + $mtFiles = array( + __FILE__, + $_SERVER['SCRIPT_FILENAME'], + "config.php" + ); + + // GET SOURCE CODE FILES + $files = dir::content($dir, array( + 'types' => "file", + 'pattern' => '/^.*\.' . $this->type . '$/' + )); + + // GET NEWEST MODIFICATION TIME + $mtime = 0; + foreach (array_merge($mtFiles, $files) as $file) { + $fmtime = filemtime($file); + if ($fmtime > $mtime) + $mtime = $fmtime; + } + + // GET SOURCE CODE FROM CLIENT HTTP CACHE IF EXISTS + httpCache::checkMTime($mtime); + + // OUTPUT SOURCE CODE + header("Content-Type: text/{$this->type}; charset=utf-8"); + + // GET SOURCE CODE FROM SERVER-SIDE CACHE + if (($cacheFile !== null) && + file_exists($cacheFile) && + ( + (filemtime($cacheFile) >= $mtime) || + !is_writable($cacheFile) // if cache file cannot be modified + ) // the script will output it always + ) { // with its distribution content + readfile($cacheFile); + die; + } + + // MINIFY AND JOIN SOURCE CODE + $source = ""; + foreach ($files as $file) { + + if (strlen($this->minCmd) && (substr($file, 4, 1) != "_")) { + $cmd = str_replace("{file}", $file, $this->minCmd); + $source .= `$cmd`; + + } else + $source .= file_get_contents($file); + } + + // UPDATE SERVER-SIDE CACHE + if (($cacheFile !== null) && + ( + is_writable($cacheFile) || + ( + !file_exists($cacheFile) && + dir::isWritable(dirname($cacheFile)) + ) + ) + ) { + file_put_contents($cacheFile, $source); + touch($cacheFile, $mtime); + } + + // OUTPUT SOURCE CODE + echo $source; + + } +} + +?> \ No newline at end of file diff --git a/core/uploader.php b/core/class/uploader.php similarity index 99% rename from core/uploader.php rename to core/class/uploader.php index 94ece0b..3fa3a31 100644 --- a/core/uploader.php +++ b/core/class/uploader.php @@ -574,7 +574,7 @@ protected function imageResize($image, $file=null) { if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) try { $img->image->setImageProperty('exif:Orientation', "1"); - } catch (Exception $e) {} + } catch (\Exception $e) {} // WATERMARK if (isset($this->config['watermark']['file']) && diff --git a/css/000.base.css b/css/000.base.css new file mode 100644 index 0000000..25cfaa4 --- /dev/null +++ b/css/000.base.css @@ -0,0 +1,225 @@ +html, body { + overflow: hidden; +} + +body, form, th, td { + margin: 0; + padding: 0; +} + +a { + cursor:pointer; +} + +* { + font-family: Tahoma, Verdana, Arial, sans-serif; + font-size: 11px; +} + +table { + border-collapse: collapse; +} + +#left { + float: left; + display: block; + width: 25%; +} + +#right { + float: left; + display: block; + width: 75%; +} + +#settings { + display: none; + padding: 0; + float: left; + width: 100%; +} + +#settings > div { + float: left; +} + +#folders { + padding: 5px; + overflow: auto; +} + +#toolbar { + padding: 5px; +} + +#files { + padding: 5px; + overflow: auto; +} + +#status { + padding: 5px; + float: left; + overflow: hidden; +} + +#fileinfo { + float: left; +} + +#clipboard div { + width: 16px; + height: 16px; +} + +.folders { + margin-left: 16px; +} + +div.file { + overflow-x: hidden; + float: left; + text-align: center; + cursor: default; + white-space: nowrap; +} + +div.file .thumb { + background: no-repeat center center; +} + +#files table { + width: 100%; +} + +tr.file { + cursor: default; +} + +tr.file > td { + white-space: nowrap; +} + +tr.file > td.name { + background-repeat: no-repeat; + background-position: left center; + padding-left: 20px; + width: 100%; +} + +tr.file > td.time, +tr.file > td.size { + text-align: right; +} + +#toolbar { + cursor: default; + white-space: nowrap; +} + +#toolbar a { + padding-left: 20px; + text-decoration: none; + background: no-repeat left center; +} + +#toolbar a:hover, a[href="#upload"].uploadHover { + color: #000; +} + +#upload { + position: absolute; + overflow: hidden; + opacity: 0; + filter: alpha(opacity=0); +} + +#upload input { + cursor: pointer; +} + +#uploadResponse { + display: none; +} + +span.brace { + padding-left: 11px; + cursor: default; +} + +span.brace.opened, span.brace.closed { + cursor: pointer; +} + +#shadow { + position: absolute; + top: 0; + left: 0; + display: none; + background: #000; + z-index: 100; + opacity: 0.7; + filter: alpha(opacity=70); +} + +#dialog, #clipboard, #alert { + position: absolute; + display: none; + z-index: 101; + cursor: default; +} + +#dialog .box, #alert { + max-width: 350px; +} + +#alert { + z-index: 102; +} + +#alert div.message { + overflow-y: auto; + overflow-x: hidden; +} + +#clipboard { + z-index: 99; +} + +#loading { + display: none; + float: right; +} + +.menu { + background: #888; + white-space: nowrap; +} + +.menu a { + display: block; +} + +.menu .list { + max-height: 0; + overflow-y: auto; + overflow-x: hidden; + white-space: nowrap; +} + +.file .access, .file .hasThumb { + display: none; +} + +#dialog img { + cursor: pointer; +} + +#resizer { + position: absolute; + z-index: 98; + top: 0; + background: #000; + opacity: 0; + filter: alpha(opacity=0); +} \ No newline at end of file diff --git a/css/index.php b/css/index.php index b9d85c5..3330bdc 100644 --- a/css/index.php +++ b/css/index.php @@ -2,7 +2,7 @@ /** This file is part of KCFinder project * - * @desc Join all CSS files in current directory + * @desc Join all CSS files from current directory * @package KCFinder * @version 3.0-dev * @author Pavel Tzonkov @@ -15,67 +15,8 @@ namespace kcfinder; chdir(".."); - -require "config.php"; -require "lib/helper_httpCache.php"; -require "lib/helper_path.php"; -require "lib/helper_dir.php"; - -// CHECK MODIFICATION TIME FILES -$mtFiles = array( - __FILE__, - "config.php" -); - -// GET SOURCE FILES -$files = dir::content(dirname(__FILE__), array( - 'types' => "file", - 'pattern' => '/^.*\.css$/' -)); - -// GET NEWEST MODIFICATION TIME -$mtime = 0; -foreach (array_merge($mtFiles, $files) as $file) { - $fmtime = filemtime($file); - if ($fmtime > $mtime) - $mtime = $fmtime; -} - -// GET SOURCE FROM CLIENT HTTP CACHE IF EXISTS -httpCache::checkMTime($mtime); - -// OUTPUT SOURCE -header("Content-Type: text/css; charset=utf-8"); - -// GET SOURCE FROM SERVER-SIDE CACHE -$cacheFile = "cache/base.css"; -if (file_exists($cacheFile) && (filemtime($cacheFile) >= $mtime)) { - readfile($cacheFile); - die; -} - -// MINIFY AND OUTPUT SOURCE -$min = isset($_CONFIG['_cssMinCmd']); -$source = ""; - -foreach ($files as $file) { - $min = $min && (substr($file, 4, 1) != "_"); - - if ($min) { - $cmd = str_replace("{file}", $file, $_CONFIG['_cssMinCmd']); - $source .= `$cmd`; - - } else - $source .= file_get_contents($file); -} - -// IF CACHE DIR EXISTS AND CAN CREATE FILES THERE, THEN WRITE SERVER-SIDE CACHE -if (is_dir("cache") && dir::isWritable("cache")) { - file_put_contents($cacheFile, $source); - touch($cacheFile, $mtime); -} - -// OUTPUT SOURCE -echo $source; +require "core/autoload.php"; +$min = new minifier("css"); +$min->minify("cache/base.css"); ?> \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..e40e0472c89a507a67eb7e06c279796ba34da66a GIT binary patch literal 1406 zcmeHGTS(JU9RBuK^S-v}oNbnttDI?h$t>q3O`EsPrJFjZsdLWhG=s>YBfON5g*Plo zQ8X|gBC^CJypWoj7m{K1(nHWwQQ3=`CX$_bA*h#Ldh`%XnE92;Fc4minvleW(_O*;f3Ry9cvGGh~g|!9JaVf~h8~KC4E~ zlM;l!YeZO^5}psFxcjLe5uK@snyiA}*bVnzX3IhM;pM-=fHU^1?s*_2$(9zLWc&6Jq9>tIHO^{ z1&W~(FmxVoX2rI0>WP$Q8jV<`v zt^t&QX3&7b=gq(0bI0vW;J;0PC)`e*9mM5wlg%V5B3y1zfr23r1Za;qCh`OX3`Mjh zKRxHHCerCVkI&~@Mq7ua=R14*gwtH?g=uMF);1?tN~x_^id~#KMtESqO$gH=%7cCI z^dZiL;=_S^LV{I(zQ^SI^3Lo!Y3_EM7fjC-#>-_gnaV;OtBdfbyC#KhBKMU0(S#yb vh%&ao+wEyZ+7wX~b#AYSAXk+|{*cL~7H+rym#(h^CjKibXn={8Tlanec9YCQ literal 0 HcmV?d00001 diff --git a/index.php b/index.php new file mode 100644 index 0000000..6d49d5f --- /dev/null +++ b/index.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/js/040.browser.js b/js/040.browser.js new file mode 100644 index 0000000..e69de29 diff --git a/js/index.php b/js/index.php index 8f26a09..cb7dce3 100644 --- a/js/index.php +++ b/js/index.php @@ -2,7 +2,7 @@ /** This file is part of KCFinder project * - * @desc Join all JavaScript files in current directory + * @desc Join all JavaScript files from current directory * @package KCFinder * @version 3.0-dev * @author Pavel Tzonkov @@ -14,70 +14,9 @@ namespace kcfinder; -ini_set("display_errors", 1); -ini_set("error_reporting", E_ALL); - chdir(".."); -require "config.php"; -require "lib/helper_httpCache.php"; -require "lib/helper_path.php"; -require "lib/helper_dir.php"; - -// CHECK MODIFICATION TIME FILES -$mtFiles = array( - __FILE__, - "config.php" -); - -// GET SOURCE FILES -$files = dir::content(dirname(__FILE__), array( - 'types' => "file", - 'pattern' => '/^.*\.js$/' -)); - -// GET NEWEST MODIFICATION TIME -$mtime = 0; -foreach (array_merge($mtFiles, $files) as $file) { - $fmtime = filemtime($file); - if ($fmtime > $mtime) - $mtime = $fmtime; -} - -// GET SOURCE FROM CLIENT HTTP CACHE IF EXISTS -httpCache::checkMTime($mtime); - -// OUTPUT SOURCE -header("Content-Type: text/javascript; charset=utf-8"); - -// GET SOURCE FROM SERVER-SIDE CACHE -$cacheFile = "cache/source.js"; -if (file_exists($cacheFile) && (filemtime($cacheFile) >= $mtime)) { - readfile($cacheFile); - die; -} - -// MINIFY AND OUTPUT SOURCE -$min = isset($_CONFIG['_jsMinCmd']); -$source = ""; - -foreach ($files as $file) { - $min = $min && (substr($file, 4, 1) != "_"); - - if ($min) { - $cmd = str_replace("{file}", $file, $_CONFIG['_jsMinCmd']); - $source .= `$cmd`; - - } else - $source .= file_get_contents($file); -} - -// IF CACHE DIR EXISTS AND CAN CREATE FILES THERE, THEN WRITE SERVER-SIDE CACHE -if (is_dir("cache") && dir::isWritable("cache")) { - file_put_contents($cacheFile, $source); - touch($cacheFile, $mtime); -} - -// OUTPUT SOURCE -echo $source; +require "core/autoload.php"; +$min = new minifier("js"); +$min->minify("cache/base.js"); ?> \ No newline at end of file diff --git a/themes/dark/css.php b/themes/dark/css.php new file mode 100644 index 0000000..cdc007b --- /dev/null +++ b/themes/dark/css.php @@ -0,0 +1,11 @@ +minify("cache/theme_dark.css"); + +?> \ No newline at end of file diff --git a/themes/dark/init.js b/themes/dark/init.js index dc64b6d..7e3c50e 100644 --- a/themes/dark/init.js +++ b/themes/dark/init.js @@ -1,4 +1,3 @@ // If this file exists in theme directory, it will be loaded in section -var imgLoading = new Image(); -imgLoading.src = 'themes/dark/img/loading.gif'; +new Image().src = 'themes/dark/img/loading.gif'; diff --git a/themes/dark/js.php b/themes/dark/js.php new file mode 100644 index 0000000..123c1ef --- /dev/null +++ b/themes/dark/js.php @@ -0,0 +1,11 @@ +minify("cache/theme_dark.js"); + +?> \ No newline at end of file diff --git a/themes/oxygen/css.php b/themes/oxygen/css.php new file mode 100644 index 0000000..6a85d08 --- /dev/null +++ b/themes/oxygen/css.php @@ -0,0 +1,11 @@ +minify("cache/theme_oxygen.css"); + +?> \ No newline at end of file diff --git a/themes/oxygen/init.js b/themes/oxygen/init.js index a507231..ef325d0 100644 --- a/themes/oxygen/init.js +++ b/themes/oxygen/init.js @@ -1,4 +1,3 @@ // If this file exists in theme directory, it will be loaded in section -var imgLoading = new Image(); -imgLoading.src = 'themes/oxygen/img/loading.gif'; +new Image().src = 'themes/oxygen/img/loading.gif'; // preload animated gif diff --git a/themes/oxygen/js.php b/themes/oxygen/js.php new file mode 100644 index 0000000..8b96336 --- /dev/null +++ b/themes/oxygen/js.php @@ -0,0 +1,11 @@ +minify("cache/theme_oxygen.js"); + +?> \ No newline at end of file diff --git a/tpl/tpl_browser.php b/tpl/tpl_browser.php index 2838e4e..acc4221 100644 --- a/tpl/tpl_browser.php +++ b/tpl/tpl_browser.php @@ -2,6 +2,7 @@ KCFinder: /<?php echo $this->session['dir'] ?> + diff --git a/tpl/tpl_css.php b/tpl/tpl_css.php index 92df869..dfba7a5 100644 --- a/tpl/tpl_css.php +++ b/tpl/tpl_css.php @@ -3,4 +3,4 @@ div.file{width:config['thumbWidth'] ?>px;} div.file .thumb{width:config['thumbWidth'] ?>px;height:config['thumbHeight'] ?>px;} - + diff --git a/tpl/tpl_javascript.php b/tpl/tpl_javascript.php index bc89c25..fae9aec 100644 --- a/tpl/tpl_javascript.php +++ b/tpl/tpl_javascript.php @@ -10,9 +10,9 @@ config['theme']}/init.js")): + IF (file_exists("themes/{$this->config['theme']}/js.php")): ?> - + diff --git a/upload.php b/upload.php index 13832ad..bbdcb27 100644 --- a/upload.php +++ b/upload.php @@ -12,7 +12,7 @@ * @link http://kcfinder.sunhater.com */ -require "core/autoload.php"; +require "core/bootstrap.php"; $uploader = "kcfinder\\uploader"; // To execute core/autoload.php on older $uploader = new $uploader(); // PHP versions (even PHP 4) $uploader->upload(); From 41d8228602f2107aac1405201316298c306bb271 Mon Sep 17 00:00:00 2001 From: sunhater Date: Fri, 14 Feb 2014 22:13:11 +0200 Subject: [PATCH 008/125] 3.0-dev update 2.1 --- cache/base.css | 226 +-- cache/base.js | 2956 +--------------------------------------- cache/theme_oxygen.css | 567 +------- cache/theme_oxygen.js | 4 +- js/040.browser.js | 0 5 files changed, 6 insertions(+), 3747 deletions(-) delete mode 100644 js/040.browser.js diff --git a/cache/base.css b/cache/base.css index 25cfaa4..3556b05 100644 --- a/cache/base.css +++ b/cache/base.css @@ -1,225 +1 @@ -html, body { - overflow: hidden; -} - -body, form, th, td { - margin: 0; - padding: 0; -} - -a { - cursor:pointer; -} - -* { - font-family: Tahoma, Verdana, Arial, sans-serif; - font-size: 11px; -} - -table { - border-collapse: collapse; -} - -#left { - float: left; - display: block; - width: 25%; -} - -#right { - float: left; - display: block; - width: 75%; -} - -#settings { - display: none; - padding: 0; - float: left; - width: 100%; -} - -#settings > div { - float: left; -} - -#folders { - padding: 5px; - overflow: auto; -} - -#toolbar { - padding: 5px; -} - -#files { - padding: 5px; - overflow: auto; -} - -#status { - padding: 5px; - float: left; - overflow: hidden; -} - -#fileinfo { - float: left; -} - -#clipboard div { - width: 16px; - height: 16px; -} - -.folders { - margin-left: 16px; -} - -div.file { - overflow-x: hidden; - float: left; - text-align: center; - cursor: default; - white-space: nowrap; -} - -div.file .thumb { - background: no-repeat center center; -} - -#files table { - width: 100%; -} - -tr.file { - cursor: default; -} - -tr.file > td { - white-space: nowrap; -} - -tr.file > td.name { - background-repeat: no-repeat; - background-position: left center; - padding-left: 20px; - width: 100%; -} - -tr.file > td.time, -tr.file > td.size { - text-align: right; -} - -#toolbar { - cursor: default; - white-space: nowrap; -} - -#toolbar a { - padding-left: 20px; - text-decoration: none; - background: no-repeat left center; -} - -#toolbar a:hover, a[href="#upload"].uploadHover { - color: #000; -} - -#upload { - position: absolute; - overflow: hidden; - opacity: 0; - filter: alpha(opacity=0); -} - -#upload input { - cursor: pointer; -} - -#uploadResponse { - display: none; -} - -span.brace { - padding-left: 11px; - cursor: default; -} - -span.brace.opened, span.brace.closed { - cursor: pointer; -} - -#shadow { - position: absolute; - top: 0; - left: 0; - display: none; - background: #000; - z-index: 100; - opacity: 0.7; - filter: alpha(opacity=70); -} - -#dialog, #clipboard, #alert { - position: absolute; - display: none; - z-index: 101; - cursor: default; -} - -#dialog .box, #alert { - max-width: 350px; -} - -#alert { - z-index: 102; -} - -#alert div.message { - overflow-y: auto; - overflow-x: hidden; -} - -#clipboard { - z-index: 99; -} - -#loading { - display: none; - float: right; -} - -.menu { - background: #888; - white-space: nowrap; -} - -.menu a { - display: block; -} - -.menu .list { - max-height: 0; - overflow-y: auto; - overflow-x: hidden; - white-space: nowrap; -} - -.file .access, .file .hasThumb { - display: none; -} - -#dialog img { - cursor: pointer; -} - -#resizer { - position: absolute; - z-index: 98; - top: 0; - background: #000; - opacity: 0; - filter: alpha(opacity=0); -} \ No newline at end of file +html,body{overflow:hidden}body,form,th,td{margin:0;padding:0}a{cursor:pointer}*{font-family:Tahoma,Verdana,Arial,sans-serif;font-size:11px}table{border-collapse:collapse}#left{float:left;display:block;width:25%}#right{float:left;display:block;width:75%}#settings{display:none;padding:0;float:left;width:100%}#settings>div{float:left}#folders{padding:5px;overflow:auto}#toolbar{padding:5px}#files{padding:5px;overflow:auto}#status{padding:5px;float:left;overflow:hidden}#fileinfo{float:left}#clipboard div{width:16px;height:16px}.folders{margin-left:16px}div.file{overflow-x:hidden;float:left;text-align:center;cursor:default;white-space:nowrap}div.file .thumb{background:no-repeat center center}#files table{width:100%}tr.file{cursor:default}tr.file>td{white-space:nowrap}tr.file>td.name{background-repeat:no-repeat;background-position:left center;padding-left:20px;width:100%}tr.file>td.time,tr.file>td.size{text-align:right}#toolbar{cursor:default;white-space:nowrap}#toolbar a{padding-left:20px;text-decoration:none;background:no-repeat left center}#toolbar a:hover,a[href="#upload"].uploadHover{color:#000}#upload{position:absolute;overflow:hidden;opacity:0;filter:alpha(opacity=0)}#upload input{cursor:pointer}#uploadResponse{display:none}span.brace{padding-left:11px;cursor:default}span.brace.opened,span.brace.closed{cursor:pointer}#shadow{position:absolute;top:0;left:0;display:none;background:#000;z-index:100;opacity:.7;filter:alpha(opacity=70)}#dialog,#clipboard,#alert{position:absolute;display:none;z-index:101;cursor:default}#dialog .box,#alert{max-width:350px}#alert{z-index:102}#alert div.message{overflow-y:auto;overflow-x:hidden}#clipboard{z-index:99}#loading{display:none;float:right}.menu{background:#888;white-space:nowrap}.menu a{display:block}.menu .list{max-height:0;overflow-y:auto;overflow-x:hidden;white-space:nowrap}.file .access,.file .hasThumb{display:none}#dialog img{cursor:pointer}#resizer{position:absolute;z-index:98;top:0;background:#000;opacity:0;filter:alpha(opacity=0)} \ No newline at end of file diff --git a/cache/base.js b/cache/base.js index 795265a..4d84915 100644 --- a/cache/base.js +++ b/cache/base.js @@ -13,14 +13,12 @@ * * Date: Thu May 12 15:04:36 2011 -0400 */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,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=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,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=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};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=n.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.6.1",length:0,size:function(){return this.length},toArray:function(){return D.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)?C.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(),y.done(a);return this},eq:function(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(D.apply(this,arguments),"slice",D.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:C,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(;j0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=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=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.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}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0: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=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?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]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},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.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)}})),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 x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem -)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.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!!k(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 bc[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=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||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=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.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:[]}},l.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&&(l.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.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.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 k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-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||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());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(W(c[0])||W(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),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};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
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},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){return this.each(function(){f(this).wrapAll(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(arguments[0]);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(arguments[0]).toArray());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){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.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;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.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("
").append(c.replace(bO,"")).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||bP.test(this.nodeName)||bJ.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(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},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}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),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?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),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._Deferred(),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=bI.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.done,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(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.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]!=="*"?", */*; 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=b$(bV,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){status<2?w(-1,z):f.error(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(bE,"+")}}),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=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";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),m.text=h.responseText;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,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);/*! +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement){cl=(ck.contentWindow||ck.contentDocument).document,cl.write("")}b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,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=0===c})}function W(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic){break}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped()){break}}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return !0}function E(){return !1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a){if(b!=="toJSON"){return !1}}return !0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else{d=b}}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,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=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};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=n.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.6.1",length:0,size:function(){return this.length},toArray:function(){return D.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)?C.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(),y.done(a);return this},eq:function(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(D.apply(this,arguments),"slice",D.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:C,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(;j0){return}y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf")){return !1}var c;for(c in a){}return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m){l.style[q]=m[q]}l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent){for(q in {submit:1,change:1,focusin:1}){p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r}}return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b){return}l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c)}i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c]){return i[g]&&i[g].events}return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i]){return}if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j)){return}}}if(d){delete h[i][e];if(!l(h[i])){return}}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=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=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1){return !0}}return !1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d}return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0){return null}for(var h=g?c:0,i=g?c+1:e.length;h=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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2){return b}if(e&&c in f.attrFn){return f(a)[c](d)}if(!("getAttribute" in a)){return f.prop(a,c,d)}var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h}a.setAttribute(c,""+d);return d}if(i&&"get" in i&&j){return i.get(a,c)}h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.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}}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0: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=a.nodeType;if(!a||e===3||e===8||e===2){return b}var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?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]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button")){return v.get(a,b)}return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button")){return v.set(a,b,c)}a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},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.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)}})),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 x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=E}else{if(!d){return}}var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i){return}var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t){return}c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t){f.event.remove(a,h+c)}return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p){continue}if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e){c.preventDefault(),c.stopPropagation()}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8){return}c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e){return}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file"){return !1}for(var c in I){f.event.add(this,c+".specialChange",I[c])}return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e)}return this}if(arguments.length===2||d===!1){e=d,d=b}c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one"){this.one(a,d,e)}else{for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return f}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d)}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}}else{n=x=[]}}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n)}else{if(d&&d.nodeType===1){for(t=0;n[t]!=null;t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t])}}else{for(t=0;n[t]!=null;t++){n[t]&&n[t].nodeType===1&&f.push(j[t])}}}}else{p(n,f)}o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g){for(var b=1;b0},k.find=function(a,b,c){var d;if(!a){return[]}for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0])}a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c)}else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(l.match.POS.test(b[0])||l.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 !!k(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 bc[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=l.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||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=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f){return f(a,c,b,d)}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n))}var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.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:[]}},l.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&&(l.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.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f)}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return p([],f)}if(i.id===h[3]){return p([i],f)}}try{return p(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}}catch(s){}finally{n||m.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a)){try{if(e||!l.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 k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return !1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"")}a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0){for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k})}g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-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||typeof a=="string"){return f.inArray(this[0],a?f(a):this.parent().children())}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(W(c[0])||W(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),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};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
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},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){return this.each(function(){f(this).wrapAll(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(arguments[0]);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(arguments[0]).toArray());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){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null}if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h){bj(e[h],g[h])}}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h){bi(e[h],g[h])}}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!bb.test(k)){k=b.createTextNode(k)}else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.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;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView)){return b}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c))}return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT){return bT.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("
").append(c.replace(bO,"")).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||bP.test(this.nodeName)||bJ.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(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in {context:1,url:1}){c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c])}return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},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}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),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?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified")){f.lastModified[k]=x}if(y=v.getResponseHeader("Etag")){f.etag[k]=y}}if(a===304){c="notmodified",o=!0}else{try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}}else{u=c;if(!c||a){c="error",a<0&&(a=0)}}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),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._Deferred(),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=bI.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.done,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(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.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]!=="*"?", */*; 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=b$(bV,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){status<2?w(-1,z):f.error(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(bE,"+")}}),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=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";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),m.text=h.responseText;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,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cu("show",3),a,b,c)}for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1)}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i])}}e.complete.call(d)}return !1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null}g=cy(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);/*! * jquery.event.drag - v 2.0.0 * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com * Open Source MIT License - http://threedubmedia.com/code/license */ -(function(f){f.fn.drag=function(b,a,d){var e=typeof b=="string"?b:"",k=f.isFunction(b)?b:f.isFunction(a)?a:null;if(e.indexOf("drag")!==0)e="drag"+e;d=(b==k?a:d)||{};return k?this.bind(e,d,k):this.trigger(e)};var i=f.event,h=i.special,c=h.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",livekey:"livedrag",add:function(b){var a=f.data(this,c.datakey),d=b.data||{};a.related+=1;if(!a.live&&b.selector){a.live=true;i.add(this,"draginit."+ c.livekey,c.delegate)}f.each(c.defaults,function(e){if(d[e]!==undefined)a[e]=d[e]})},remove:function(){f.data(this,c.datakey).related-=1},setup:function(){if(!f.data(this,c.datakey)){var b=f.extend({related:0},c.defaults);f.data(this,c.datakey,b);i.add(this,"mousedown",c.init,b);this.attachEvent&&this.attachEvent("ondragstart",c.dontstart)}},teardown:function(){if(!f.data(this,c.datakey).related){f.removeData(this,c.datakey);i.remove(this,"mousedown",c.init);i.remove(this,"draginit",c.delegate);c.textselect(true); this.detachEvent&&this.detachEvent("ondragstart",c.dontstart)}},init:function(b){var a=b.data,d;if(!(a.which>0&&b.which!=a.which))if(!f(b.target).is(a.not))if(!(a.handle&&!f(b.target).closest(a.handle,b.currentTarget).length)){a.propagates=1;a.interactions=[c.interaction(this,a)];a.target=b.target;a.pageX=b.pageX;a.pageY=b.pageY;a.dragging=null;d=c.hijack(b,"draginit",a);if(a.propagates){if((d=c.flatten(d))&&d.length){a.interactions=[];f.each(d,function(){a.interactions.push(c.interaction(this,a))})}a.propagates= a.interactions.length;a.drop!==false&&h.drop&&h.drop.handler(b,a);c.textselect(false);i.add(document,"mousemove mouseup",c.handler,a);return false}}},interaction:function(b,a){return{drag:b,callback:new c.callback,droppable:[],offset:f(b)[a.relative?"position":"offset"]()||{top:0,left:0}}},handler:function(b){var a=b.data;switch(b.type){case !a.dragging&&"mousemove":if(Math.pow(b.pageX-a.pageX,2)+Math.pow(b.pageY-a.pageY,2)0&&c.which!=f.which)){if(!d(c.target).is(f.not)){if(!(f.handle&&!d(c.target).closest(f.handle,c.currentTarget).length)){f.propagates=1;f.interactions=[e.interaction(this,f)];f.target=c.target;f.pageX=c.pageX;f.pageY=c.pageY;f.dragging=null;g=e.hijack(c,"draginit",f);if(f.propagates){if((g=e.flatten(g))&&g.length){f.interactions=[];d.each(g,function(){f.interactions.push(e.interaction(this,f))})}f.propagates=f.interactions.length;f.drop!==false&&b.drop&&b.drop.handler(c,f);e.textselect(false);a.add(document,"mousemove mouseup",e.handler,f);return false}}}}},interaction:function(c,f){return{drag:c,callback:new e.callback,droppable:[],offset:d(c)[f.relative?"position":"offset"]()||{top:0,left:0}}},handler:function(c){var f=c.data;switch(c.type){case !f.dragging&&"mousemove":if(Math.pow(c.pageX-f.pageX,2)+Math.pow(c.pageY-f.pageY,2) - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -var _ = function(id) { - return document.getElementById(id); -}; - -_.nopx = function(val) { - return parseInt(val.replace(/^(\d+)px$/, "$1")); -}; - -_.unselect = function() { - if (document.selection && document.selection.empty) - document.selection.empty() ; - else if (window.getSelection) { - var sel = window.getSelection(); - if (sel && sel.removeAllRanges) - sel.removeAllRanges(); - } -}; - -_.selection = function(field, start, end) { - if (field.createTextRange) { - var selRange = field.createTextRange(); - selRange.collapse(true); - selRange.moveStart('character', start); - selRange.moveEnd('character', end-start); - selRange.select(); - } else if (field.setSelectionRange) { - field.setSelectionRange(start, end); - } else if (field.selectionStart) { - field.selectionStart = start; - field.selectionEnd = end; - } - field.focus(); -}; - -_.htmlValue = function(value) { - return value - .replace(/\&/g, "&") - .replace(/\"/g, """) - .replace(/\'/g, "'"); -}; - -_.htmlData = function(value) { - return value - .replace(/\&/g, "&") - .replace(/\/g, ">") - .replace(/\ /g, " "); -} - -_.jsValue = function(value) { - return value - .replace(/\\/g, "\\\\") - .replace(/\r?\n/, "\\\n") - .replace(/\"/g, "\\\"") - .replace(/\'/g, "\\'"); -}; - -_.basename = function(path) { - var expr = /^.*\/([^\/]+)\/?$/g; - return expr.test(path) - ? path.replace(expr, "$1") - : path; -}; - -_.dirname = function(path) { - var expr = /^(.*)\/[^\/]+\/?$/g; - return expr.test(path) - ? path.replace(expr, "$1") - : ''; -}; - -_.inArray = function(needle, arr) { - if ((typeof arr == 'undefined') || !arr.length || !arr.push) - return false; - for (var i = 0; i < arr.length; i++) - if (arr[i] == needle) - return true; - return false; -}; - -_.getFileExtension = function(filename, toLower) { - if (typeof(toLower) == 'undefined') toLower = true; - if (/^.*\.[^\.]*$/.test(filename)) { - var ext = filename.replace(/^.*\.([^\.]*)$/, "$1"); - return toLower ? ext.toLowerCase(ext) : ext; - } else - return ""; -}; - -_.escapeDirs = function(path) { - var fullDirExpr = /^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/, - prefix = ""; - if (fullDirExpr.test(path)) { - var port = path.replace(fullDirExpr, "$4"); - prefix = path.replace(fullDirExpr, "$1://$2") - if (port.length) - prefix += ":" + port; - prefix += "/"; - path = path.replace(fullDirExpr, "$5"); - } - - var dirs = path.split('/'); - var escapePath = ''; - for (var i = 0; i < dirs.length; i++) - escapePath += encodeURIComponent(dirs[i]) + '/'; - - return prefix + escapePath.substr(0, escapePath.length - 1); -}; - -_.outerSpace = function(selector, type, mbp) { - if (!mbp) mbp = "mbp"; - var r = 0; - if (/m/i.test(mbp)) { - var m = _.nopx($(selector).css('margin-' + type)); - if (m) r += m; - } - if (/b/i.test(mbp)) { - var b = _.nopx($(selector).css('border-' + type + '-width')); - if (b) r += b; - } - if (/p/i.test(mbp)) { - var p = _.nopx($(selector).css('padding-' + type)); - if (p) r += p; - } - return r; -}; - -_.outerLeftSpace = function(selector, mbp) { - return _.outerSpace(selector, 'left', mbp); -}; - -_.outerTopSpace = function(selector, mbp) { - return _.outerSpace(selector, 'top', mbp); -}; - -_.outerRightSpace = function(selector, mbp) { - return _.outerSpace(selector, 'right', mbp); -}; - -_.outerBottomSpace = function(selector, mbp) { - return _.outerSpace(selector, 'bottom', mbp); -}; - -_.outerHSpace = function(selector, mbp) { - return (_.outerLeftSpace(selector, mbp) + _.outerRightSpace(selector, mbp)); -}; - -_.outerVSpace = function(selector, mbp) { - return (_.outerTopSpace(selector, mbp) + _.outerBottomSpace(selector, mbp)); -}; - -_.kuki = { - prefix: '', - duration: 356, - domain: '', - path: '', - secure: false, - - set: function(name, value, duration, domain, path, secure) { - name = this.prefix + name; - if (duration == null) duration = this.duration; - if (secure == null) secure = this.secure; - if ((domain == null) && this.domain) domain = this.domain; - if ((path == null) && this.path) path = this.path; - secure = secure ? true : false; - - var date = new Date(); - date.setTime(date.getTime() + (duration * 86400000)); - var expires = date.toGMTString(); - - var str = name + '=' + value + '; expires=' + expires; - if (domain != null) str += '; domain=' + domain; - if (path != null) str += '; path=' + path; - if (secure) str += '; secure'; - - return (document.cookie = str) ? true : false; - }, - - get: function(name) { - name = this.prefix + name; - var nameEQ = name + '='; - var kukis = document.cookie.split(';'); - var kuki; - - for (var i = 0; i < kukis.length; i++) { - kuki = kukis[i]; - while (kuki.charAt(0) == ' ') - kuki = kuki.substring(1, kuki.length); - - if (kuki.indexOf(nameEQ) == 0) - return kuki.substring(nameEQ.length, kuki.length); - } - - return null; - }, - - del: function(name) { - return this.set(name, '', -1); - }, - - isSet: function(name) { - return (this.get(name) != null); - } -}; - -_.md5 = function(string) { - - var RotateLeft = function(lValue, iShiftBits) { - return (lValue<>>(32-iShiftBits)); - }; - - var AddUnsigned = function(lX,lY) { - var lX4, lY4, lX8, lY8, lResult; - lX8 = (lX & 0x80000000); - lY8 = (lY & 0x80000000); - lX4 = (lX & 0x40000000); - lY4 = (lY & 0x40000000); - lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); - if (lX4 & lY4) - return (lResult ^ 0x80000000 ^ lX8 ^ lY8); - if (lX4 | lY4) - return (lResult & 0x40000000) - ? (lResult ^ 0xC0000000 ^ lX8 ^ lY8) - : (lResult ^ 0x40000000 ^ lX8 ^ lY8); - else - return (lResult ^ lX8 ^ lY8); - }; - - var F = function(x, y, z) { return (x & y) | ((~x) & z); }; - var G = function(x, y, z) { return (x & z) | (y & (~z)); }; - var H = function(x, y, z) { return (x ^ y ^ z); }; - var I = function(x, y, z) { return (y ^ (x | (~z))); }; - - var FF = function(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - var GG = function(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - var HH = function(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - var II = function(a, b, c, d, x, s, ac) { - a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); - return AddUnsigned(RotateLeft(a, s), b); - }; - - var ConvertToWordArray = function(string) { - var lWordCount; - var lMessageLength = string.length; - var lNumberOfWords_temp1 = lMessageLength + 8; - var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; - var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; - var lWordArray = [lNumberOfWords - 1]; - var lBytePosition = 0; - var lByteCount = 0; - while (lByteCount < lMessageLength) { - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); - lByteCount++; - } - lWordCount = (lByteCount - (lByteCount % 4)) / 4; - lBytePosition = (lByteCount % 4) * 8; - lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); - lWordArray[lNumberOfWords - 2] = lMessageLength << 3; - lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; - return lWordArray; - }; - - var WordToHex = function(lValue) { - var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; - for (lCount = 0; lCount <= 3; lCount++) { - lByte = (lValue >>> (lCount * 8)) & 255; - WordToHexValue_temp = "0" + lByte.toString(16); - WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2,2); - } - return WordToHexValue; - }; - - var x = []; - var k, AA, BB, CC, DD, a, b, c, d; - var S11 = 7, S12 = 12, S13 = 17, S14 = 22; - var S21 = 5, S22 = 9, S23 = 14, S24 = 20; - var S31 = 4, S32 = 11, S33 = 16, S34 = 23; - var S41 = 6, S42 = 10, S43 = 15, S44 = 21; - - string = _.utf8encode(string); - - x = ConvertToWordArray(string); - - a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; - - for (k = 0; k < x.length; k += 16) { - AA = a; BB = b; CC = c; DD = d; - a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); - d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); - c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); - b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); - a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); - d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); - c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); - b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); - a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); - d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); - c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); - b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); - a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); - d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); - c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); - b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); - a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); - d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); - c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); - b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); - a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); - d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); - c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); - b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); - a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); - d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); - c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); - b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); - a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); - d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); - c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); - b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); - a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); - d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); - c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); - b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); - a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); - d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); - c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); - b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); - a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); - d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); - c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); - b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); - a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); - d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); - c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); - b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); - a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); - d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); - c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); - b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); - a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); - d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); - c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); - b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); - a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); - d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); - c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); - b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); - a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); - d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); - c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); - b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); - a = AddUnsigned(a, AA); - b = AddUnsigned(b, BB); - c = AddUnsigned(c, CC); - d = AddUnsigned(d, DD); - } - - var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); - - return temp.toLowerCase(); -}; - -_.utf8encode = function(string) { - string = string.replace(/\r\n/g,"\n"); - var utftext = ""; - - for (var n = 0; n < string.length; n++) { - - var c = string.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } else if((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - - } - - return utftext; -}; -/** This file is part of KCFinder project - * - * @desc Base JavaScript object properties - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -var browser = { - opener: {}, - support: {}, - files: [], - clipboard: [], - labels: [], - shows: [], - orders: [], - cms: "" -}; -/** This file is part of KCFinder project - * - * @desc Base JavaScript object properties - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -var browser = { - opener: {}, - support: {}, - files: [], - clipboard: [], - labels: [], - shows: [], - orders: [], - cms: "" -}; -/** This file is part of KCFinder project - * - * @desc Object initializations - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.init = function() { - if (!this.checkAgent()) return; - - $('body').click(function() { - browser.hideDialog(); - }); - $('#shadow').click(function() { - return false; - }); - $('#dialog').unbind(); - $('#dialog').click(function() { - return false; - }); - $('#alert').unbind(); - $('#alert').click(function() { - return false; - }); - this.initOpeners(); - this.initSettings(); - this.initContent(); - this.initToolbar(); - this.initResizer(); - this.initDropUpload(); -}; - -browser.checkAgent = function() { - if (!$.browser.version || - ($.browser.msie && (parseInt($.browser.version) < 7) && !this.support.chromeFrame) || - ($.browser.opera && (parseInt($.browser.version) < 10)) || - ($.browser.mozilla && (parseFloat($.browser.version.replace(/^(\d+(\.\d+)?)([^\d].*)?$/, "$1")) < 1.8)) - ) { - var html = '
Your browser is not capable to display KCFinder. Please update your browser or install another one: Mozilla Firefox, Apple Safari, Google Chrome, Opera.'; - if ($.browser.msie) - html += ' You may also install Google Chrome Frame ActiveX plugin to get Internet Explorer 6 working.'; - html += '
'; - $('body').html(html); - return false; - } - return true; -}; - -browser.initOpeners = function() { - if (this.opener.TinyMCE && (typeof(tinyMCEPopup) == 'undefined')) - this.opener.TinyMCE = null; - - if (this.opener.TinyMCE) - this.opener.callBack = true; - - if ((!this.opener.name || (this.opener.name == 'fckeditor')) && - window.opener && window.opener.SetUrl - ) { - this.opener.FCKeditor = true; - this.opener.callBack = true; - } - - if (this.opener.CKEditor) { - if (window.parent && window.parent.CKEDITOR) - this.opener.CKEditor.object = window.parent.CKEDITOR; - else if (window.opener && window.opener.CKEDITOR) { - this.opener.CKEditor.object = window.opener.CKEDITOR; - this.opener.callBack = true; - } else - this.opener.CKEditor = null; - } - - if (!this.opener.CKEditor && !this.opener.FCKEditor && !this.TinyMCE) { - if ((window.opener && window.opener.KCFinder && window.opener.KCFinder.callBack) || - (window.parent && window.parent.KCFinder && window.parent.KCFinder.callBack) - ) - this.opener.callBack = window.opener - ? window.opener.KCFinder.callBack - : window.parent.KCFinder.callBack; - - if (( - window.opener && - window.opener.KCFinder && - window.opener.KCFinder.callBackMultiple - ) || ( - window.parent && - window.parent.KCFinder && - window.parent.KCFinder.callBackMultiple - ) - ) - this.opener.callBackMultiple = window.opener - ? window.opener.KCFinder.callBackMultiple - : window.parent.KCFinder.callBackMultiple; - } -}; - -browser.initContent = function() { - $('div#folders').html(this.label("Loading folders...")); - $('div#files').html(this.label("Loading files...")); - $.ajax({ - type: 'GET', - dataType: 'json', - url: browser.baseGetData('init'), - async: false, - success: function(data) { - if (browser.check4errors(data)) - return; - browser.dirWritable = data.dirWritable; - $('#folders').html(browser.buildTree(data.tree)); - browser.setTreeData(data.tree); - browser.initFolders(); - browser.files = data.files ? data.files : []; - browser.orderFiles(); - }, - error: function() { - $('div#folders').html(browser.label("Unknown error.")); - $('div#files').html(browser.label("Unknown error.")); - } - }); -}; - -browser.initResizer = function() { - var cursor = ($.browser.opera) ? 'move' : 'col-resize'; - $('#resizer').css('cursor', cursor); - $('#resizer').drag('start', function() { - $(this).css({opacity:'0.4', filter:'alpha(opacity:40)'}); - $('#all').css('cursor', cursor); - }); - $('#resizer').drag(function(e) { - var left = e.pageX - parseInt(_.nopx($(this).css('width')) / 2); - left = (left >= 0) ? left : 0; - left = (left + _.nopx($(this).css('width')) < $(window).width()) - ? left : $(window).width() - _.nopx($(this).css('width')); - $(this).css('left', left); - }); - var end = function() { - $(this).css({opacity:'0', filter:'alpha(opacity:0)'}); - $('#all').css('cursor', ''); - var left = _.nopx($(this).css('left')) + _.nopx($(this).css('width')); - var right = $(window).width() - left; - $('#left').css('width', left + 'px'); - $('#right').css('width', right + 'px'); - _('files').style.width = $('#right').innerWidth() - _.outerHSpace('#files') + 'px'; - _('resizer').style.left = $('#left').outerWidth() - _.outerRightSpace('#folders', 'm') + 'px'; - _('resizer').style.width = _.outerRightSpace('#folders', 'm') + _.outerLeftSpace('#files', 'm') + 'px'; - browser.fixFilesHeight(); - }; - $('#resizer').drag('end', end); - $('#resizer').mouseup(end); -}; - -browser.resize = function() { - _('left').style.width = '25%'; - _('right').style.width = '75%'; - _('toolbar').style.height = $('#toolbar a').outerHeight() + "px"; - _('shadow').style.width = $(window).width() + 'px'; - _('shadow').style.height = _('resizer').style.height = $(window).height() + 'px'; - _('left').style.height = _('right').style.height = - $(window).height() - $('#status').outerHeight() + 'px'; - _('folders').style.height = - $('#left').outerHeight() - _.outerVSpace('#folders') + 'px'; - browser.fixFilesHeight(); - var width = $('#left').outerWidth() + $('#right').outerWidth(); - _('status').style.width = width + 'px'; - while ($('#status').outerWidth() > width) - _('status').style.width = _.nopx(_('status').style.width) - 1 + 'px'; - while ($('#status').outerWidth() < width) - _('status').style.width = _.nopx(_('status').style.width) + 1 + 'px'; - if ($.browser.msie && ($.browser.version.substr(0, 1) < 8)) - _('right').style.width = $(window).width() - $('#left').outerWidth() + 'px'; - _('files').style.width = $('#right').innerWidth() - _.outerHSpace('#files') + 'px'; - _('resizer').style.left = $('#left').outerWidth() - _.outerRightSpace('#folders', 'm') + 'px'; - _('resizer').style.width = _.outerRightSpace('#folders', 'm') + _.outerLeftSpace('#files', 'm') + 'px'; -}; - -browser.fixFilesHeight = function() { - _('files').style.height = - $('#left').outerHeight() - $('#toolbar').outerHeight() - _.outerVSpace('#files') - - (($('#settings').css('display') != "none") ? $('#settings').outerHeight() : 0) + 'px'; -}; -/** This file is part of KCFinder project - * - * @desc Toolbar functionality - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.initToolbar = function() { - $('#toolbar a').click(function() { - browser.hideDialog(); - }); - - if (!_.kuki.isSet('displaySettings')) - _.kuki.set('displaySettings', 'off'); - - if (_.kuki.get('displaySettings') == 'on') { - $('#toolbar a[href="kcact:settings"]').addClass('selected'); - $('#settings').css('display', 'block'); - browser.resize(); - } - - $('#toolbar a[href="kcact:settings"]').click(function () { - if ($('#settings').css('display') == 'none') { - $(this).addClass('selected'); - _.kuki.set('displaySettings', 'on'); - $('#settings').css('display', 'block'); - browser.fixFilesHeight(); - } else { - $(this).removeClass('selected'); - _.kuki.set('displaySettings', 'off'); - $('#settings').css('display', 'none'); - browser.fixFilesHeight(); - } - return false; - }); - - $('#toolbar a[href="kcact:refresh"]').click(function() { - browser.refresh(); - return false; - }); - - if (window.opener || this.opener.TinyMCE || $('iframe', window.parent.document).get(0)) - $('#toolbar a[href="kcact:maximize"]').click(function() { - browser.maximize(this); - return false; - }); - else - $('#toolbar a[href="kcact:maximize"]').css('display', 'none'); - - $('#toolbar a[href="kcact:about"]').click(function() { - var html = '
' + - '
KCFinder ' + browser.version + '
'; - if (browser.support.check4Update) - html += '
' + browser.label("Checking for new version...") + '
'; - html += - '
' + browser.label("Licenses:") + ' GPLv2 & LGPLv2
' + - '
Copyright ©2010-2014 Pavel Tzonkov
' + - '' + - '
'; - $('#dialog').html(html); - $('#dialog').data('title', browser.label("About")); - browser.showDialog(); - var close = function() { - browser.hideDialog(); - browser.unshadow(); - } - $('#dialog button').click(close); - var span = $('#checkver > span'); - setTimeout(function() { - $.ajax({ - dataType: 'json', - url: browser.baseGetData('check4Update'), - async: true, - success: function(data) { - if (!$('#dialog').html().length) - return; - span.removeClass('loading'); - if (!data.version) { - span.html(browser.label("Unable to connect!")); - browser.showDialog(); - return; - } - if (browser.version < data.version) - span.html('' + browser.label("Download version {version} now!", {version: data.version}) + ''); - else - span.html(browser.label("KCFinder is up to date!")); - browser.showDialog(); - }, - error: function() { - if (!$('#dialog').html().length) - return; - span.removeClass('loading'); - span.html(browser.label("Unable to connect!")); - browser.showDialog(); - } - }); - }, 1000); - $('#dialog').unbind(); - - return false; - }); - - this.initUploadButton(); -}; - -browser.initUploadButton = function() { - var btn = $('#toolbar a[href="kcact:upload"]'); - if (!this.access.files.upload) { - btn.css('display', 'none'); - return; - } - var top = btn.get(0).offsetTop; - var width = btn.outerWidth(); - var height = btn.outerHeight(); - $('#toolbar').prepend('
' + - '
' + - '' + - '' + - '
' + - '
'); - $('#upload input').css('margin-left', "-" + ($('#upload input').outerWidth() - width) + 'px'); - $('#upload').mouseover(function() { - $('#toolbar a[href="kcact:upload"]').addClass('hover'); - }); - $('#upload').mouseout(function() { - $('#toolbar a[href="kcact:upload"]').removeClass('hover'); - }); -}; - -browser.uploadFile = function(form) { - if (!this.dirWritable) { - browser.alert(this.label("Cannot write to upload folder.")); - $('#upload').detach(); - browser.initUploadButton(); - return; - } - form.elements[1].value = browser.dir; - $('').prependTo(document.body); - $('#loading').html(this.label("Uploading file...")); - $('#loading').css('display', 'inline'); - form.submit(); - $('#uploadResponse').load(function() { - var response = $(this).contents().find('body').html(); - $('#loading').css('display', 'none'); - response = response.split("\n"); - var selected = [], errors = []; - $.each(response, function(i, row) { - if (row.substr(0, 1) == '/') - selected[selected.length] = row.substr(1, row.length - 1) - else - errors[errors.length] = row; - }); - if (errors.length) - browser.alert(errors.join("\n")); - if (!selected.length) - selected = null - browser.refresh(selected); - $('#upload').detach(); - setTimeout(function() { - $('#uploadResponse').detach(); - }, 1); - browser.initUploadButton(); - }); -}; - -browser.maximize = function(button) { - if (window.opener) { - window.moveTo(0, 0); - width = screen.availWidth; - height = screen.availHeight; - if ($.browser.opera) - height -= 50; - window.resizeTo(width, height); - - } else if (browser.opener.TinyMCE) { - var win, ifr, id; - - $('iframe', window.parent.document).each(function() { - if (/^mce_\d+_ifr$/.test($(this).attr('id'))) { - id = parseInt($(this).attr('id').replace(/^mce_(\d+)_ifr$/, "$1")); - win = $('#mce_' + id, window.parent.document); - ifr = $('#mce_' + id + '_ifr', window.parent.document); - } - }); - - if ($(button).hasClass('selected')) { - $(button).removeClass('selected'); - win.css({ - left: browser.maximizeMCE.left + 'px', - top: browser.maximizeMCE.top + 'px', - width: browser.maximizeMCE.width + 'px', - height: browser.maximizeMCE.height + 'px' - }); - ifr.css({ - width: browser.maximizeMCE.width - browser.maximizeMCE.Hspace + 'px', - height: browser.maximizeMCE.height - browser.maximizeMCE.Vspace + 'px' - }); - - } else { - $(button).addClass('selected') - browser.maximizeMCE = { - width: _.nopx(win.css('width')), - height: _.nopx(win.css('height')), - left: win.position().left, - top: win.position().top, - Hspace: _.nopx(win.css('width')) - _.nopx(ifr.css('width')), - Vspace: _.nopx(win.css('height')) - _.nopx(ifr.css('height')) - }; - var width = $(window.parent).width(); - var height = $(window.parent).height(); - win.css({ - left: $(window.parent).scrollLeft() + 'px', - top: $(window.parent).scrollTop() + 'px', - width: width + 'px', - height: height + 'px' - }); - ifr.css({ - width: width - browser.maximizeMCE.Hspace + 'px', - height: height - browser.maximizeMCE.Vspace + 'px' - }); - } - - } else if ($('iframe', window.parent.document).get(0)) { - var ifrm = $('iframe[name="' + window.name + '"]', window.parent.document); - var parent = ifrm.parent(); - var width, height; - if ($(button).hasClass('selected')) { - $(button).removeClass('selected'); - if (browser.maximizeThread) { - clearInterval(browser.maximizeThread); - browser.maximizeThread = null; - } - if (browser.maximizeW) browser.maximizeW = null; - if (browser.maximizeH) browser.maximizeH = null; - $.each($('*', window.parent.document).get(), function(i, e) { - e.style.display = browser.maximizeDisplay[i]; - }); - ifrm.css({ - display: browser.maximizeCSS.display, - position: browser.maximizeCSS.position, - left: browser.maximizeCSS.left, - top: browser.maximizeCSS.top, - width: browser.maximizeCSS.width, - height: browser.maximizeCSS.height - }); - $(window.parent).scrollLeft(browser.maximizeLest); - $(window.parent).scrollTop(browser.maximizeTop); - - } else { - $(button).addClass('selected'); - browser.maximizeCSS = { - display: ifrm.css('display'), - position: ifrm.css('position'), - left: ifrm.css('left'), - top: ifrm.css('top'), - width: ifrm.outerWidth() + 'px', - height: ifrm.outerHeight() + 'px' - }; - browser.maximizeTop = $(window.parent).scrollTop(); - browser.maximizeLeft = $(window.parent).scrollLeft(); - browser.maximizeDisplay = []; - $.each($('*', window.parent.document).get(), function(i, e) { - browser.maximizeDisplay[i] = $(e).css('display'); - $(e).css('display', 'none'); - }); - - ifrm.css('display', 'block'); - ifrm.parents().css('display', 'block'); - var resize = function() { - width = $(window.parent).width(); - height = $(window.parent).height(); - if (!browser.maximizeW || (browser.maximizeW != width) || - !browser.maximizeH || (browser.maximizeH != height) - ) { - browser.maximizeW = width; - browser.maximizeH = height; - ifrm.css({ - width: width + 'px', - height: height + 'px' - }); - browser.resize(); - } - } - ifrm.css('position', 'absolute'); - if ((ifrm.offset().left == ifrm.position().left) && - (ifrm.offset().top == ifrm.position().top) - ) - ifrm.css({left: '0', top: '0'}); - else - ifrm.css({ - left: - ifrm.offset().left + 'px', - top: - ifrm.offset().top + 'px' - }); - - resize(); - browser.maximizeThread = setInterval(resize, 250); - } - } -}; - -browser.refresh = function(selected) { - this.fadeFiles(); - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('chDir'), - data: {dir:browser.dir}, - async: false, - success: function(data) { - if (browser.check4errors(data)) - return; - browser.dirWritable = data.dirWritable; - browser.files = data.files ? data.files : []; - browser.orderFiles(null, selected); - browser.statusDir(); - }, - error: function() { - $('#files > div').css({opacity:'', filter:''}); - $('#files').html(browser.label("Unknown error.")); - } - }); -}; -/** This file is part of KCFinder project - * - * @desc Settings panel functionality - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.initSettings = function() { - - if (!this.shows.length) { - var showInputs = $('#show input[type="checkbox"]').toArray(); - $.each(showInputs, function (i, input) { - browser.shows[i] = input.name; - }); - } - - var shows = this.shows; - - if (!_.kuki.isSet('showname')) { - _.kuki.set('showname', 'on'); - $.each(shows, function (i, val) { - if (val != "name") _.kuki.set('show' + val, 'off'); - }); - } - - $('#show input[type="checkbox"]').click(function() { - var kuki = $(this).get(0).checked ? 'on' : 'off'; - _.kuki.set('show' + $(this).get(0).name, kuki) - if ($(this).get(0).checked) - $('#files .file div.' + $(this).get(0).name).css('display', 'block'); - else - $('#files .file div.' + $(this).get(0).name).css('display', 'none'); - }); - - $.each(shows, function(i, val) { - var checked = (_.kuki.get('show' + val) == 'on') ? 'checked' : ''; - $('#show input[name="' + val + '"]').get(0).checked = checked; - }); - - if (!this.orders.length) { - var orderInputs = $('#order input[type="radio"]').toArray(); - $.each(orderInputs, function (i, input) { - browser.orders[i] = input.value; - }); - } - - var orders = this.orders; - - if (!_.kuki.isSet('order')) - _.kuki.set('order', 'name'); - - if (!_.kuki.isSet('orderDesc')) - _.kuki.set('orderDesc', 'off'); - - $('#order input[value="' + _.kuki.get('order') + '"]').get(0).checked = true; - $('#order input[name="desc"]').get(0).checked = (_.kuki.get('orderDesc') == 'on'); - - $('#order input[type="radio"]').click(function() { - _.kuki.set('order', $(this).get(0).value); - browser.orderFiles(); - }); - - $('#order input[name="desc"]').click(function() { - _.kuki.set('orderDesc', $(this).get(0).checked ? 'on' : 'off'); - browser.orderFiles(); - }); - - if (!_.kuki.isSet('view')) - _.kuki.set('view', 'thumbs'); - - if (_.kuki.get('view') == 'list') { - $('#show input').each(function() { this.checked = true; }); - $('#show input').each(function() { this.disabled = true; }); - } - - $('#view input[value="' + _.kuki.get('view') + '"]').get(0).checked = true; - - $('#view input').click(function() { - var view = $(this).attr('value'); - if (_.kuki.get('view') != view) { - _.kuki.set('view', view); - if (view == 'list') { - $('#show input').each(function() { this.checked = true; }); - $('#show input').each(function() { this.disabled = true; }); - } else { - $.each(browser.shows, function(i, val) { - $('#show input[name="' + val + '"]').get(0).checked = - (_.kuki.get('show' + val) == "on"); - }); - $('#show input').each(function() { this.disabled = false; }); - } - } - browser.refresh(); - }); -}; -/** This file is part of KCFinder project - * - * @desc File related functionality - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.initFiles = function() { - $(document).unbind('keydown'); - $(document).keydown(function(e) { - return !browser.selectAll(e); - }); - $('#files').unbind(); - $('#files').scroll(function() { - browser.hideDialog(); - }); - $('.file').unbind(); - $('.file').click(function(e) { - _.unselect(); - browser.selectFile($(this), e); - }); - $('.file').rightClick(function(e) { - _.unselect(); - browser.menuFile($(this), e); - }); - $('.file').dblclick(function() { - _.unselect(); - browser.returnFile($(this)); - }); - $('.file').mouseup(function() { - _.unselect(); - }); - $('.file').mouseout(function() { - _.unselect(); - }); - $.each(this.shows, function(i, val) { - var display = (_.kuki.get('show' + val) == 'off') - ? 'none' : 'block'; - $('#files .file div.' + val).css('display', display); - }); - this.statusDir(); -}; - -browser.showFiles = function(callBack, selected) { - this.fadeFiles(); - setTimeout(function() { - var html = ''; - $.each(browser.files, function(i, file) { - var stamp = []; - $.each(file, function(key, val) { - stamp[stamp.length] = key + "|" + val; - }); - stamp = _.md5(stamp.join('|')); - if (_.kuki.get('view') == 'list') { - if (!i) html += ''; - var icon = _.getFileExtension(file.name); - if (file.thumb) - icon = '.image'; - else if (!icon.length || !file.smallIcon) - icon = '.'; - icon = 'themes/' + browser.theme + '/img/files/small/' + icon + '.png'; - html += '' + - '' + - '' + - '' + - ''; - if (i == browser.files.length - 1) html += '
' + _.htmlData(file.name) + '' + file.date + '' + browser.humanSize(file.size) + '
'; - } else { - if (file.thumb) - var icon = browser.baseGetData('thumb') + '&file=' + encodeURIComponent(file.name) + '&dir=' + encodeURIComponent(browser.dir) + '&stamp=' + stamp; - else if (file.smallThumb) { - var icon = browser.uploadURL + '/' + browser.dir + '/' + file.name; - icon = _.escapeDirs(icon).replace(/\'/g, "%27"); - } else { - var icon = file.bigIcon ? _.getFileExtension(file.name) : '.'; - if (!icon.length) icon = '.'; - icon = 'themes/' + browser.theme + '/img/files/big/' + icon + '.png'; - } - html += '
' + - '
' + - '
' + _.htmlData(file.name) + '
' + - '
' + file.date + '
' + - '
' + browser.humanSize(file.size) + '
' + - '
'; - } - }); - $('#files').html('
' + html + '
'); - $.each(browser.files, function(i, file) { - var item = $('#files .file').get(i); - $(item).data(file); - if (_.inArray(file.name, selected) || - ((typeof selected != 'undefined') && !selected.push && (file.name == selected)) - ) - $(item).addClass('selected'); - }); - $('#files > div').css({opacity:'', filter:''}); - if (callBack) callBack(); - browser.initFiles(); - }, 200); -}; - -browser.selectFile = function(file, e) { - if (e.ctrlKey || e.metaKey) { - if (file.hasClass('selected')) - file.removeClass('selected'); - else - file.addClass('selected'); - var files = $('.file.selected').get(); - var size = 0; - if (!files.length) - this.statusDir(); - else { - $.each(files, function(i, cfile) { - size += parseInt($(cfile).data('size')); - }); - size = this.humanSize(size); - if (files.length > 1) - $('#fileinfo').html(files.length + ' ' + this.label("selected files") + ' (' + size + ')'); - else { - var data = $(files[0]).data(); - $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); - } - } - } else { - var data = file.data(); - $('.file').removeClass('selected'); - file.addClass('selected'); - $('#fileinfo').html(data.name + ' (' + this.humanSize(data.size) + ', ' + data.date + ')'); - } -}; - -browser.selectAll = function(e) { - if ((!e.ctrlKey && !e.metaKey) || ((e.keyCode != 65) && (e.keyCode != 97))) - return false; - var files = $('.file').get(); - if (files.length) { - var size = 0; - $.each(files, function(i, file) { - if (!$(file).hasClass('selected')) - $(file).addClass('selected'); - size += parseInt($(file).data('size')); - }); - size = this.humanSize(size); - $('#fileinfo').html(files.length + ' ' + this.label("selected files") + ' (' + size + ')'); - } - return true; -}; - -browser.returnFile = function(file) { - - var fileURL = file.substr - ? file : browser.uploadURL + '/' + browser.dir + '/' + file.data('name'); - fileURL = _.escapeDirs(fileURL); - - if (this.opener.CKEditor) { - this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum, fileURL, ''); - window.close(); - - } else if (this.opener.FCKeditor) { - window.opener.SetUrl(fileURL) ; - window.close() ; - - } else if (this.opener.TinyMCE) { - var win = tinyMCEPopup.getWindowArg('window'); - win.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = fileURL; - if (win.getImageData) win.getImageData(); - if (typeof(win.ImageDialog) != "undefined") { - if (win.ImageDialog.getImageData) - win.ImageDialog.getImageData(); - if (win.ImageDialog.showPreviewImage) - win.ImageDialog.showPreviewImage(fileURL); - } - tinyMCEPopup.close(); - - } else if (this.opener.callBack) { - - if (window.opener && window.opener.KCFinder) { - this.opener.callBack(fileURL); - window.close(); - } - - if (window.parent && window.parent.KCFinder) { - var button = $('#toolbar a[href="kcact:maximize"]'); - if (button.hasClass('selected')) - this.maximize(button); - this.opener.callBack(fileURL); - } - - } else if (this.opener.callBackMultiple) { - if (window.opener && window.opener.KCFinder) { - this.opener.callBackMultiple([fileURL]); - window.close(); - } - - if (window.parent && window.parent.KCFinder) { - var button = $('#toolbar a[href="kcact:maximize"]'); - if (button.hasClass('selected')) - this.maximize(button); - this.opener.callBackMultiple([fileURL]); - } - - } -}; - -browser.returnFiles = function(files) { - if (this.opener.callBackMultiple && files.length) { - var rfiles = []; - $.each(files, function(i, file) { - rfiles[i] = browser.uploadURL + '/' + browser.dir + '/' + $(file).data('name'); - rfiles[i] = _.escapeDirs(rfiles[i]); - }); - this.opener.callBackMultiple(rfiles); - if (window.opener) window.close() - } -}; - -browser.returnThumbnails = function(files) { - if (this.opener.callBackMultiple) { - var rfiles = []; - var j = 0; - $.each(files, function(i, file) { - if ($(file).data('thumb')) { - rfiles[j] = browser.thumbsURL + '/' + browser.dir + '/' + $(file).data('name'); - rfiles[j] = _.escapeDirs(rfiles[j++]); - } - }); - this.opener.callBackMultiple(rfiles); - if (window.opener) window.close() - } -}; - -browser.menuFile = function(file, e) { - var data = file.data(); - var path = this.dir + '/' + data.name; - var files = $('.file.selected').get(); - var html = ''; - - if (file.hasClass('selected') && files.length && (files.length > 1)) { - var thumb = false; - var notWritable = 0; - var cdata; - $.each(files, function(i, cfile) { - cdata = $(cfile).data(); - if (cdata.thumb) thumb = true; - if (!data.writable) notWritable++; - }); - if (this.opener.callBackMultiple) { - html += '' + this.label("Select") + ''; - if (thumb) html += - '' + this.label("Select Thumbnails") + ''; - } - if (data.thumb || data.smallThumb || this.support.zip) { - html += (html.length ? '
' : ''); - if (data.thumb || data.smallThumb) - html +='' + this.label("View") + ''; - if (this.support.zip) html += (html.length ? '
' : '') + - '' + this.label("Download") + ''; - } - - if (this.access.files.copy || this.access.files.move) - html += (html.length ? '
' : '') + - '' + this.label("Add to Clipboard") + ''; - if (this.access.files['delete']) - html += (html.length ? '
' : '') + - '' + this.label("Delete") + ''; - - if (html.length) { - html = ''; - $('#dialog').html(html); - this.showMenu(e); - } else - return; - - $('.menu a[href="kcact:pick"]').click(function() { - browser.returnFiles(files); - browser.hideDialog(); - return false; - }); - - $('.menu a[href="kcact:pick_thumb"]').click(function() { - browser.returnThumbnails(files); - browser.hideDialog(); - return false; - }); - - $('.menu a[href="kcact:download"]').click(function() { - browser.hideDialog(); - var pfiles = []; - $.each(files, function(i, cfile) { - pfiles[i] = $(cfile).data('name'); - }); - browser.post(browser.baseGetData('downloadSelected'), {dir:browser.dir, files:pfiles}); - return false; - }); - - $('.menu a[href="kcact:clpbrdadd"]').click(function() { - browser.hideDialog(); - var msg = ''; - $.each(files, function(i, cfile) { - var cdata = $(cfile).data(); - var failed = false; - for (i = 0; i < browser.clipboard.length; i++) - if ((browser.clipboard[i].name == cdata.name) && - (browser.clipboard[i].dir == browser.dir) - ) { - failed = true - msg += cdata.name + ": " + browser.label("This file is already added to the Clipboard.") + "\n"; - break; - } - - if (!failed) { - cdata.dir = browser.dir; - browser.clipboard[browser.clipboard.length] = cdata; - } - }); - browser.initClipboard(); - if (msg.length) browser.alert(msg.substr(0, msg.length - 1)); - return false; - }); - - $('.menu a[href="kcact:rm"]').click(function() { - if ($(this).hasClass('denied')) return false; - browser.hideDialog(); - var failed = 0; - var dfiles = []; - $.each(files, function(i, cfile) { - var cdata = $(cfile).data(); - if (!cdata.writable) - failed++; - else - dfiles[dfiles.length] = browser.dir + "/" + cdata.name; - }); - if (failed == files.length) { - browser.alert(browser.label("The selected files are not removable.")); - return false; - } - - var go = function(callBack) { - browser.fadeFiles(); - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('rm_cbd'), - data: {files:dfiles}, - async: false, - success: function(data) { - if (callBack) callBack(); - browser.check4errors(data); - browser.refresh(); - }, - error: function() { - if (callBack) callBack(); - $('#files > div').css({ - opacity: '', - filter: '' - }); - browser.alert(browser.label("Unknown error.")); - } - }); - }; - - if (failed) - browser.confirm( - browser.label("{count} selected files are not removable. Do you want to delete the rest?", {count:failed}), - go - ) - - else - browser.confirm( - browser.label("Are you sure you want to delete all selected files?"), - go - ); - - return false; - }); - - } else { - html += ''; - - $('#dialog').html(html); - this.showMenu(e); - - $('.menu a[href="kcact:pick"]').click(function() { - browser.returnFile(file); - browser.hideDialog(); - return false; - }); - - $('.menu a[href="kcact:pick_thumb"]').click(function() { - var path = browser.thumbsURL + '/' + browser.dir + '/' + data.name; - browser.returnFile(path); - browser.hideDialog(); - return false; - }); - - $('.menu a[href="kcact:download"]').click(function() { - var html = '
' + - '' + - '' + - '
'; - $('#dialog').html(html); - $('#downloadForm input').get(0).value = browser.dir; - $('#downloadForm input').get(1).value = data.name; - $('#downloadForm').submit(); - return false; - }); - - $('.menu a[href="kcact:clpbrdadd"]').click(function() { - for (i = 0; i < browser.clipboard.length; i++) - if ((browser.clipboard[i].name == data.name) && - (browser.clipboard[i].dir == browser.dir) - ) { - browser.hideDialog(); - browser.alert(browser.label("This file is already added to the Clipboard.")); - return false; - } - var cdata = data; - cdata.dir = browser.dir; - browser.clipboard[browser.clipboard.length] = cdata; - browser.initClipboard(); - browser.hideDialog(); - return false; - }); - - $('.menu a[href="kcact:mv"]').click(function(e) { - if (!data.writable) return false; - browser.fileNameDialog( - e, {dir: browser.dir, file: data.name}, - 'newName', data.name, browser.baseGetData('rename'), { - title: "New file name:", - errEmpty: "Please enter new file name.", - errSlash: "Unallowable characters in file name.", - errDot: "File name shouldn't begins with '.'" - }, - function() { - browser.refresh(); - } - ); - return false; - }); - - $('.menu a[href="kcact:rm"]').click(function() { - if (!data.writable) return false; - browser.hideDialog(); - browser.confirm(browser.label("Are you sure you want to delete this file?"), - function(callBack) { - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('delete'), - data: {dir:browser.dir, file:data.name}, - async: false, - success: function(data) { - if (callBack) callBack(); - browser.clearClipboard(); - if (browser.check4errors(data)) - return; - browser.refresh(); - }, - error: function() { - if (callBack) callBack(); - browser.alert(browser.label("Unknown error.")); - } - }); - } - ); - return false; - }); - } - - $('.menu a[href="kcact:view"]').click(function() { - browser.hideDialog(); - var ts = new Date().getTime(); - var showImage = function(data) { - url = _.escapeDirs(browser.uploadURL + '/' + browser.dir + '/' + data.name) + '?ts=' + ts, - $('#loading').html(browser.label("Loading image...")); - $('#loading').css('display', 'inline'); - var img = new Image(); - img.src = url; - img.onerror = function() { - browser.lock = false; - $('#loading').css('display', 'none'); - browser.alert(browser.label("Unknown error.")); - $(document).unbind('keydown'); - $(document).keydown(function(e) { - return !browser.selectAll(e); - }); - browser.refresh(); - }; - var onImgLoad = function() { - browser.lock = false; - $('#files .file').each(function() { - if ($(this).data('name') == data.name) - browser.ssImage = this; - }); - $('#loading').css('display', 'none'); - $('#dialog').html('
'); - $('#dialog img').attr({ - src: url, - title: data.name - }).fadeIn('fast', function() { - var o_w = $('#dialog').outerWidth(); - var o_h = $('#dialog').outerHeight(); - var f_w = $(window).width() - 30; - var f_h = $(window).height() - 30; - if ((o_w > f_w) || (o_h > f_h)) { - if ((f_w / f_h) > (o_w / o_h)) - f_w = parseInt((o_w * f_h) / o_h); - else if ((f_w / f_h) < (o_w / o_h)) - f_h = parseInt((o_h * f_w) / o_w); - $('#dialog img').attr({ - width: f_w, - height: f_h - }); - } - $('#dialog').unbind('click'); - $('#dialog').click(function(e) { - browser.hideDialog(); - $(document).unbind('keydown'); - $(document).keydown(function(e) { - return !browser.selectAll(e); - }); - if (browser.ssImage) { - browser.selectFile($(browser.ssImage), e); - } - }); - browser.showDialog(); - var images = []; - $.each(browser.files, function(i, file) { - if (file.thumb || file.smallThumb) - images[images.length] = file; - }); - if (images.length) - $.each(images, function(i, image) { - if (image.name == data.name) { - $(document).unbind('keydown'); - $(document).keydown(function(e) { - if (images.length > 1) { - if (!browser.lock && (e.keyCode == 37)) { - var nimg = i - ? images[i - 1] - : images[images.length - 1]; - browser.lock = true; - showImage(nimg); - } - if (!browser.lock && (e.keyCode == 39)) { - var nimg = (i >= images.length - 1) - ? images[0] - : images[i + 1]; - browser.lock = true; - showImage(nimg); - } - } - if (e.keyCode == 27) { - browser.hideDialog(); - $(document).unbind('keydown'); - $(document).keydown(function(e) { - return !browser.selectAll(e); - }); - } - }); - } - }); - }); - }; - if (img.complete) - onImgLoad(); - else - img.onload = onImgLoad; - }; - showImage(data); - return false; - }); -}; -/** This file is part of KCFinder project - * - * @desc Folder related functionality - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.initFolders = function() { - $('#folders').scroll(function() { - browser.hideDialog(); - }); - $('div.folder > a').unbind(); - $('div.folder > a').bind('click', function() { - browser.hideDialog(); - return false; - }); - $('div.folder > a > span.brace').unbind(); - $('div.folder > a > span.brace').click(function() { - if ($(this).hasClass('opened') || $(this).hasClass('closed')) - browser.expandDir($(this).parent()); - }); - $('div.folder > a > span.folder').unbind(); - $('div.folder > a > span.folder').click(function() { - browser.changeDir($(this).parent()); - }); - $('div.folder > a > span.folder').rightClick(function(e) { - _.unselect(); - browser.menuDir($(this).parent(), e); - }); - - if ($.browser.msie && $.browser.version && - (parseInt($.browser.version.substr(0, 1)) < 8) - ) { - var fls = $('div.folder').get(); - var body = $('body').get(0); - var div; - $.each(fls, function(i, folder) { - div = document.createElement('div'); - div.style.display = 'inline'; - div.style.margin = div.style.border = div.style.padding = '0'; - div.innerHTML='
' + $(folder).html() + "
"; - body.appendChild(div); - $(folder).css('width', $(div).innerWidth() + 'px'); - body.removeChild(div); - }); - } -}; - -browser.setTreeData = function(data, path) { - if (!path) - path = ''; - else if (path.length && (path.substr(path.length - 1, 1) != '/')) - path += '/'; - path += data.name; - var selector = '#folders a[href="kcdir:/' + _.escapeDirs(path) + '"]'; - $(selector).data({ - name: data.name, - path: path, - readable: data.readable, - writable: data.writable, - removable: data.removable, - hasDirs: data.hasDirs - }); - $(selector + ' span.folder').addClass(data.current ? 'current' : 'regular'); - if (data.dirs && data.dirs.length) { - $(selector + ' span.brace').addClass('opened'); - $.each(data.dirs, function(i, cdir) { - browser.setTreeData(cdir, path + '/'); - }); - } else if (data.hasDirs) - $(selector + ' span.brace').addClass('closed'); -}; - -browser.buildTree = function(root, path) { - if (!path) path = ""; - path += root.name; - var html = '
 ' + _.htmlData(root.name) + ''; - if (root.dirs) { - html += '
'; - for (var i = 0; i < root.dirs.length; i++) { - cdir = root.dirs[i]; - html += browser.buildTree(cdir, path + '/'); - } - html += '
'; - } - html += '
'; - return html; -}; - -browser.expandDir = function(dir) { - var path = dir.data('path'); - if (dir.children('.brace').hasClass('opened')) { - dir.parent().children('.folders').hide(500, function() { - if (path == browser.dir.substr(0, path.length)) - browser.changeDir(dir); - }); - dir.children('.brace').removeClass('opened'); - dir.children('.brace').addClass('closed'); - } else { - if (dir.parent().children('.folders').get(0)) { - dir.parent().children('.folders').show(500); - dir.children('.brace').removeClass('closed'); - dir.children('.brace').addClass('opened'); - } else if (!$('#loadingDirs').get(0)) { - dir.parent().append('
' + this.label("Loading folders...") + '
'); - $('#loadingDirs').css('display', 'none'); - $('#loadingDirs').show(200, function() { - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('expand'), - data: {dir:path}, - async: false, - success: function(data) { - $('#loadingDirs').hide(200, function() { - $('#loadingDirs').detach(); - }); - if (browser.check4errors(data)) - return; - - var html = ''; - $.each(data.dirs, function(i, cdir) { - html += ''; - }); - if (html.length) { - dir.parent().append('
' + html + '
'); - var folders = $(dir.parent().children('.folders').first()); - folders.css('display', 'none'); - $(folders).show(500); - $.each(data.dirs, function(i, cdir) { - browser.setTreeData(cdir, path); - }); - } - if (data.dirs.length) { - dir.children('.brace').removeClass('closed'); - dir.children('.brace').addClass('opened'); - } else { - dir.children('.brace').removeClass('opened'); - dir.children('.brace').removeClass('closed'); - } - browser.initFolders(); - browser.initDropUpload(); - }, - error: function() { - $('#loadingDirs').detach(); - browser.alert(browser.label("Unknown error.")); - } - }); - }); - } - } -}; - -browser.changeDir = function(dir) { - if (dir.children('span.folder').hasClass('regular')) { - $('div.folder > a > span.folder').removeClass('current'); - $('div.folder > a > span.folder').removeClass('regular'); - $('div.folder > a > span.folder').addClass('regular'); - dir.children('span.folder').removeClass('regular'); - dir.children('span.folder').addClass('current'); - $('#files').html(browser.label("Loading files...")); - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('chDir'), - data: {dir:dir.data('path')}, - async: false, - success: function(data) { - if (browser.check4errors(data)) - return; - browser.files = data.files; - browser.orderFiles(); - browser.dir = dir.data('path'); - browser.dirWritable = data.dirWritable; - var title = "KCFinder: /" + browser.dir; - document.title = title; - if (browser.opener.TinyMCE) - tinyMCEPopup.editor.windowManager.setTitle(window, title); - browser.statusDir(); - }, - error: function() { - $('#files').html(browser.label("Unknown error.")); - } - }); - } -}; - -browser.statusDir = function() { - for (var i = 0, size = 0; i < this.files.length; i++) - size += parseInt(this.files[i].size); - size = this.humanSize(size); - $('#fileinfo').html(this.files.length + ' ' + this.label("files") + ' (' + size + ')'); -}; - -browser.menuDir = function(dir, e) { - var data = dir.data(); - var html = ''; - - $('#dialog').html(html); - this.showMenu(e); - $('div.folder > a > span.folder').removeClass('context'); - if (dir.children('span.folder').hasClass('regular')) - dir.children('span.folder').addClass('context'); - - if (this.clipboard && this.clipboard.length && data.writable) { - - $('.menu a[href="kcact:cpcbd"]').click(function() { - browser.hideDialog(); - browser.copyClipboard(data.path); - return false; - }); - - $('.menu a[href="kcact:mvcbd"]').click(function() { - browser.hideDialog(); - browser.moveClipboard(data.path); - return false; - }); - } - - $('.menu a[href="kcact:refresh"]').click(function() { - browser.hideDialog(); - browser.refreshDir(dir); - return false; - }); - - $('.menu a[href="kcact:download"]').click(function() { - browser.hideDialog(); - browser.post(browser.baseGetData('downloadDir'), {dir:data.path}); - return false; - }); - - $('.menu a[href="kcact:mkdir"]').click(function(e) { - if (!data.writable) return false; - browser.hideDialog(); - browser.fileNameDialog( - e, {dir: data.path}, - 'newDir', '', browser.baseGetData('newDir'), { - title: "New folder name:", - errEmpty: "Please enter new folder name.", - errSlash: "Unallowable characters in folder name.", - errDot: "Folder name shouldn't begins with '.'" - }, function() { - browser.refreshDir(dir); - browser.initDropUpload(); - if (!data.hasDirs) { - dir.data('hasDirs', true); - dir.children('span.brace').addClass('closed'); - } - } - ); - return false; - }); - - $('.menu a[href="kcact:mvdir"]').click(function(e) { - if (!data.removable) return false; - browser.hideDialog(); - browser.fileNameDialog( - e, {dir: data.path}, - 'newName', data.name, browser.baseGetData('renameDir'), { - title: "New folder name:", - errEmpty: "Please enter new folder name.", - errSlash: "Unallowable characters in folder name.", - errDot: "Folder name shouldn't begins with '.'" - }, function(dt) { - if (!dt.name) { - browser.alert(browser.label("Unknown error.")); - return; - } - var currentDir = (data.path == browser.dir); - dir.children('span.folder').html(_.htmlData(dt.name)); - dir.data('name', dt.name); - dir.data('path', _.dirname(data.path) + '/' + dt.name); - if (currentDir) - browser.dir = dir.data('path'); - browser.initDropUpload(); - }, - true - ); - return false; - }); - - $('.menu a[href="kcact:rmdir"]').click(function() { - if (!data.removable) return false; - browser.hideDialog(); - browser.confirm( - "Are you sure you want to delete this folder and all its content?", - function(callBack) { - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('deleteDir'), - data: {dir: data.path}, - async: false, - success: function(data) { - if (callBack) callBack(); - if (browser.check4errors(data)) - return; - dir.parent().hide(500, function() { - var folders = dir.parent().parent(); - var pDir = folders.parent().children('a').first(); - dir.parent().detach(); - if (!folders.children('div.folder').get(0)) { - pDir.children('span.brace').first().removeClass('opened'); - pDir.children('span.brace').first().removeClass('closed'); - pDir.parent().children('.folders').detach(); - pDir.data('hasDirs', false); - } - if (pDir.data('path') == browser.dir.substr(0, pDir.data('path').length)) - browser.changeDir(pDir); - browser.initDropUpload(); - }); - }, - error: function() { - if (callBack) callBack(); - browser.alert(browser.label("Unknown error.")); - } - }); - } - ); - return false; - }); -}; - -browser.refreshDir = function(dir) { - var path = dir.data('path'); - if (dir.children('.brace').hasClass('opened') || dir.children('.brace').hasClass('closed')) { - dir.children('.brace').removeClass('opened'); - dir.children('.brace').addClass('closed'); - } - dir.parent().children('.folders').first().detach(); - if (path == browser.dir.substr(0, path.length)) - browser.changeDir(dir); - browser.expandDir(dir); - return true; -}; -/** This file is part of KCFinder project - * - * @desc Clipboard functionality - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.initClipboard = function() { - if (!this.clipboard || !this.clipboard.length) return; - var size = 0; - $.each(this.clipboard, function(i, val) { - size += parseInt(val.size); - }); - size = this.humanSize(size); - $('#clipboard').html('
'); - var resize = function() { - $('#clipboard').css({ - left: $(window).width() - $('#clipboard').outerWidth() + 'px', - top: $(window).height() - $('#clipboard').outerHeight() + 'px' - }); - }; - resize(); - $('#clipboard').css('display', 'block'); - $(window).unbind(); - $(window).resize(function() { - browser.resize(); - resize(); - }); -}; - -browser.openClipboard = function() { - if (!this.clipboard || !this.clipboard.length) return; - if ($('.menu a[href="kcact:cpcbd"]').html()) { - $('#clipboard').removeClass('selected'); - this.hideDialog(); - return; - } - var html = ''; - - setTimeout(function() { - $('#clipboard').addClass('selected'); - $('#dialog').html(html); - $('.menu a[href="kcact:download"]').click(function() { - browser.hideDialog(); - browser.downloadClipboard(); - return false; - }); - $('.menu a[href="kcact:cpcbd"]').click(function() { - if (!browser.dirWritable) return false; - browser.hideDialog(); - browser.copyClipboard(browser.dir); - return false; - }); - $('.menu a[href="kcact:mvcbd"]').click(function() { - if (!browser.dirWritable) return false; - browser.hideDialog(); - browser.moveClipboard(browser.dir); - return false; - }); - $('.menu a[href="kcact:rmcbd"]').click(function() { - browser.hideDialog(); - browser.confirm( - browser.label("Are you sure you want to delete all files in the Clipboard?"), - function(callBack) { - if (callBack) callBack(); - browser.deleteClipboard(); - } - ); - return false; - }); - $('.menu a[href="kcact:clrcbd"]').click(function() { - browser.hideDialog(); - browser.clearClipboard(); - return false; - }); - - var left = $(window).width() - $('#dialog').outerWidth(); - var top = $(window).height() - $('#dialog').outerHeight() - $('#clipboard').outerHeight(); - var lheight = top + _.outerTopSpace('#dialog'); - $('.menu .list').css('max-height', lheight + 'px'); - var top = $(window).height() - $('#dialog').outerHeight() - $('#clipboard').outerHeight(); - $('#dialog').css({ - left: (left - 4) + 'px', - top: top + 'px' - }); - $('#dialog').fadeIn(); - }, 1); -}; - -browser.removeFromClipboard = function(i) { - if (!this.clipboard || !this.clipboard[i]) return false; - if (this.clipboard.length == 1) { - this.clearClipboard(); - this.hideDialog(); - return; - } - - if (i < this.clipboard.length - 1) { - var last = this.clipboard.slice(i + 1); - this.clipboard = this.clipboard.slice(0, i); - this.clipboard = this.clipboard.concat(last); - } else - this.clipboard.pop(); - - this.initClipboard(); - this.hideDialog(); - this.openClipboard(); - return true; -}; - -browser.copyClipboard = function(dir) { - if (!this.clipboard || !this.clipboard.length) return; - var files = []; - var failed = 0; - for (i = 0; i < this.clipboard.length; i++) - if (this.clipboard[i].readable) - files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; - else - failed++; - if (this.clipboard.length == failed) { - browser.alert(this.label("The files in the Clipboard are not readable.")); - return; - } - var go = function(callBack) { - if (dir == browser.dir) - browser.fadeFiles(); - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('cp_cbd'), - data: {dir: dir, files: files}, - async: false, - success: function(data) { - if (callBack) callBack(); - browser.check4errors(data); - browser.clearClipboard(); - if (dir == browser.dir) - browser.refresh(); - }, - error: function() { - if (callBack) callBack(); - $('#files > div').css({ - opacity: '', - filter: '' - }); - browser.alert(browser.label("Unknown error.")); - } - }); - }; - - if (failed) - browser.confirm( - browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?", {count:failed}), - go - ) - else - go(); - -}; - -browser.moveClipboard = function(dir) { - if (!this.clipboard || !this.clipboard.length) return; - var files = []; - var failed = 0; - for (i = 0; i < this.clipboard.length; i++) - if (this.clipboard[i].readable && this.clipboard[i].writable) - files[i] = this.clipboard[i].dir + "/" + this.clipboard[i].name; - else - failed++; - if (this.clipboard.length == failed) { - browser.alert(this.label("The files in the Clipboard are not movable.")) - return; - } - - var go = function(callBack) { - browser.fadeFiles(); - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('mv_cbd'), - data: {dir: dir, files: files}, - async: false, - success: function(data) { - if (callBack) callBack(); - browser.check4errors(data); - browser.clearClipboard(); - browser.refresh(); - }, - error: function() { - if (callBack) callBack(); - $('#files > div').css({ - opacity: '', - filter: '' - }); - browser.alert(browser.label("Unknown error.")); - } - }); - }; - - if (failed) - browser.confirm( - browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?", {count: failed}), - go - ); - else - go(); -}; - -browser.deleteClipboard = function() { - if (!this.clipboard || !this.clipboard.length) return; - var files = []; - var failed = 0; - for (i = 0; i < this.clipboard.length; i++) - if (this.clipboard[i].readable && this.clipboard[i].writable) - files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; - else - failed++; - if (this.clipboard.length == failed) { - browser.alert(this.label("The files in the Clipboard are not removable.")) - return; - } - var go = function(callBack) { - browser.fadeFiles(); - $.ajax({ - type: 'POST', - dataType: 'json', - url: browser.baseGetData('rm_cbd'), - data: {files:files}, - async: false, - success: function(data) { - if (callBack) callBack(); - browser.check4errors(data); - browser.clearClipboard(); - browser.refresh(); - }, - error: function() { - if (callBack) callBack(); - $('#files > div').css({ - opacity: '', - filter:'' - }); - browser.alert(browser.label("Unknown error.")); - } - }); - }; - if (failed) - browser.confirm( - browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?", {count: failed}), - go - ); - else - go(); -}; - -browser.downloadClipboard = function() { - if (!this.clipboard || !this.clipboard.length) return; - var files = []; - for (i = 0; i < this.clipboard.length; i++) - if (this.clipboard[i].readable) - files[i] = this.clipboard[i].dir + '/' + this.clipboard[i].name; - if (files.length) - this.post(this.baseGetData('downloadClipboard'), {files:files}); -}; - -browser.clearClipboard = function() { - $('#clipboard').html(''); - this.clipboard = []; -}; -/** This file is part of KCFinder project - * - * @desc Upload files using drag and drop - * @package KCFinder - * @version 3.0-dev - * @author Forum user (updated by Pavel Tzonkov) - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.initDropUpload = function() { - if ((typeof(XMLHttpRequest) == 'undefined') || - (typeof(document.addEventListener) == 'undefined') || - (typeof(File) == 'undefined') || - (typeof(FileReader) == 'undefined') - ) - return; - - if (!XMLHttpRequest.prototype.sendAsBinary) { - XMLHttpRequest.prototype.sendAsBinary = function(datastr) { - var ords = Array.prototype.map.call(datastr, function(x) { - return x.charCodeAt(0) & 0xff; - }); - var ui8a = new Uint8Array(ords); - this.send(ui8a.buffer); - } - } - - var uploadQueue = [], - uploadInProgress = false, - filesCount = 0, - errors = [], - files = $('#files'), - folders = $('div.folder > a'), - boundary = '------multipartdropuploadboundary' + (new Date).getTime(), - currentFile, - - filesDragOver = function(e) { - if (e.preventDefault) e.preventDefault(); - $('#files').addClass('drag'); - return false; - }, - - filesDragEnter = function(e) { - if (e.preventDefault) e.preventDefault(); - return false; - }, - - filesDragLeave = function(e) { - if (e.preventDefault) e.preventDefault(); - $('#files').removeClass('drag'); - return false; - }, - - filesDrop = function(e) { - if (e.preventDefault) e.preventDefault(); - if (e.stopPropagation) e.stopPropagation(); - $('#files').removeClass('drag'); - if (!$('#folders span.current').first().parent().data('writable')) { - browser.alert("Cannot write to upload folder."); - return false; - } - filesCount += e.dataTransfer.files.length - for (var i = 0; i < e.dataTransfer.files.length; i++) { - var file = e.dataTransfer.files[i]; - file.thisTargetDir = browser.dir; - uploadQueue.push(file); - } - processUploadQueue(); - return false; - }, - - folderDrag = function(e) { - if (e.preventDefault) e.preventDefault(); - return false; - }, - - folderDrop = function(e, dir) { - if (e.preventDefault) e.preventDefault(); - if (e.stopPropagation) e.stopPropagation(); - if (!$(dir).data('writable')) { - browser.alert("Cannot write to upload folder."); - return false; - } - filesCount += e.dataTransfer.files.length - for (var i = 0; i < e.dataTransfer.files.length; i++) { - var file = e.dataTransfer.files[i]; - file.thisTargetDir = $(dir).data('path'); - uploadQueue.push(file); - } - processUploadQueue(); - return false; - }; - - files.get(0).removeEventListener('dragover', filesDragOver, false); - files.get(0).removeEventListener('dragenter', filesDragEnter, false); - files.get(0).removeEventListener('dragleave', filesDragLeave, false); - files.get(0).removeEventListener('drop', filesDrop, false); - - files.get(0).addEventListener('dragover', filesDragOver, false); - files.get(0).addEventListener('dragenter', filesDragEnter, false); - files.get(0).addEventListener('dragleave', filesDragLeave, false); - files.get(0).addEventListener('drop', filesDrop, false); - - folders.each(function() { - var folder = this, - - dragOver = function(e) { - $(folder).children('span.folder').addClass('context'); - return folderDrag(e); - }, - - dragLeave = function(e) { - $(folder).children('span.folder').removeClass('context'); - return folderDrag(e); - }, - - drop = function(e) { - $(folder).children('span.folder').removeClass('context'); - return folderDrop(e, folder); - }; - - this.removeEventListener('dragover', dragOver, false); - this.removeEventListener('dragenter', folderDrag, false); - this.removeEventListener('dragleave', dragLeave, false); - this.removeEventListener('drop', drop, false); - - this.addEventListener('dragover', dragOver, false); - this.addEventListener('dragenter', folderDrag, false); - this.addEventListener('dragleave', dragLeave, false); - this.addEventListener('drop', drop, false); - }); - - function updateProgress(evt) { - var progress = evt.lengthComputable - ? Math.round((evt.loaded * 100) / evt.total) + '%' - : Math.round(evt.loaded / 1024) + " KB"; - $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { - number: filesCount - uploadQueue.length, - count: filesCount, - progress: progress - })); - } - - function processUploadQueue() { - if (uploadInProgress) - return false; - - if (uploadQueue && uploadQueue.length) { - var file = uploadQueue.shift(); - currentFile = file; - $('#loading').html(browser.label("Uploading file {number} of {count}... {progress}", { - number: filesCount - uploadQueue.length, - count: filesCount, - progress: "" - })); - $('#loading').css('display', 'inline'); - - var reader = new FileReader(); - reader.thisFileName = file.name; - reader.thisFileType = file.type; - reader.thisFileSize = file.size; - reader.thisTargetDir = file.thisTargetDir; - - reader.onload = function(evt) { - uploadInProgress = true; - - var postbody = '--' + boundary + '\r\nContent-Disposition: form-data; name="upload[]"'; - if (evt.target.thisFileName) - postbody += '; filename="' + _.utf8encode(evt.target.thisFileName) + '"'; - postbody += '\r\n'; - if (evt.target.thisFileSize) - postbody += 'Content-Length: ' + evt.target.thisFileSize + '\r\n'; - postbody += 'Content-Type: ' + evt.target.thisFileType + '\r\n\r\n' + evt.target.result + '\r\n--' + boundary + '\r\nContent-Disposition: form-data; name="dir"\r\n\r\n' + _.utf8encode(evt.target.thisTargetDir) + '\r\n--' + boundary + '\r\n--' + boundary + '--\r\n'; - - var xhr = new XMLHttpRequest(); - xhr.thisFileName = evt.target.thisFileName; - - if (xhr.upload) { - xhr.upload.thisFileName = evt.target.thisFileName; - xhr.upload.addEventListener("progress", updateProgress, false); - } - xhr.open('POST', browser.baseGetData('upload'), true); - xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); - xhr.setRequestHeader('Content-Length', postbody.length); - - xhr.onload = function(e) { - $('#loading').css('display', 'none'); - if (browser.dir == reader.thisTargetDir) - browser.fadeFiles(); - uploadInProgress = false; - processUploadQueue(); - if (xhr.responseText.substr(0, 1) != '/') - errors[errors.length] = xhr.responseText; - } - - xhr.sendAsBinary(postbody); - }; - - reader.onerror = function(evt) { - $('#loading').css('display', 'none'); - uploadInProgress = false; - processUploadQueue(); - errors[errors.length] = browser.label("Failed to upload {filename}!", { - filename: evt.target.thisFileName - }); - }; - - reader.readAsBinaryString(file); - - } else { - filesCount = 0; - var loop = setInterval(function() { - if (uploadInProgress) return; - boundary = '------multipartdropuploadboundary' + (new Date).getTime(); - uploadQueue = []; - clearInterval(loop); - if (currentFile.thisTargetDir == browser.dir) - browser.refresh(); - if (errors.length) { - browser.alert(errors.join('\n')); - errors = []; - } - }, 333); - } - } -}; -/** This file is part of KCFinder project - * - * @desc Miscellaneous functionality - * @package KCFinder - * @version 3.0-dev - * @author Pavel Tzonkov - * @copyright 2010-2014 KCFinder Project - * @license http://opensource.org/licenses/GPL-3.0 GPLv3 - * @license http://opensource.org/licenses/LGPL-3.0 LGPLv3 - * @link http://kcfinder.sunhater.com - */ - -browser.drag = function(ev, dd) { - var top = dd.offsetY, - left = dd.offsetX; - if (top < 0) top = 0; - if (left < 0) left = 0; - if (top + $(this).outerHeight() > $(window).height()) - top = $(window).height() - $(this).outerHeight(); - if (left + $(this).outerWidth() > $(window).width()) - left = $(window).width() - $(this).outerWidth(); - $(this).css({ - top: top, - left: left - }); -}; - -browser.showDialog = function(e) { - $('#dialog').css({left: 0, top: 0}); - this.shadow(); - if ($('#dialog div.box') && !$('#dialog div.title').get(0)) { - var html = $('#dialog div.box').html(); - var title = $('#dialog').data('title') ? $('#dialog').data('title') : ""; - html = '
' + title + '
' + html; - $('#dialog div.box').html(html); - $('#dialog div.title span.close').mousedown(function() { - $(this).addClass('clicked'); - }); - $('#dialog div.title span.close').mouseup(function() { - $(this).removeClass('clicked'); - }); - $('#dialog div.title span.close').click(function() { - browser.hideDialog(); - browser.hideAlert(); - }); - } - $('#dialog').drag(browser.drag, {handle: '#dialog div.title'}); - $('#dialog').css('display', 'block'); - - if (e) { - var left = e.pageX - parseInt($('#dialog').outerWidth() / 2); - var top = e.pageY - parseInt($('#dialog').outerHeight() / 2); - if (left < 0) left = 0; - if (top < 0) top = 0; - if (($('#dialog').outerWidth() + left) > $(window).width()) - left = $(window).width() - $('#dialog').outerWidth(); - if (($('#dialog').outerHeight() + top) > $(window).height()) - top = $(window).height() - $('#dialog').outerHeight(); - $('#dialog').css({ - left: left + 'px', - top: top + 'px' - }); - } else - $('#dialog').css({ - left: parseInt(($(window).width() - $('#dialog').outerWidth()) / 2) + 'px', - top: parseInt(($(window).height() - $('#dialog').outerHeight()) / 2) + 'px' - }); - $(document).unbind('keydown'); - $(document).keydown(function(e) { - if (e.keyCode == 27) - browser.hideDialog(); - }); -}; - -browser.hideDialog = function() { - this.unshadow(); - if ($('#clipboard').hasClass('selected')) - $('#clipboard').removeClass('selected'); - $('#dialog').css('display', 'none'); - $('div.folder > a > span.folder').removeClass('context'); - $('#dialog').html(''); - $('#dialog').data('title', null); - $('#dialog').unbind(); - $('#dialog').click(function() { - return false; - }); - $(document).unbind('keydown'); - $(document).keydown(function(e) { - return !browser.selectAll(e); - }); - browser.hideAlert(); -}; - -browser.showAlert = function(shadow) { - $('#alert').css({left: 0, top: 0}); - if (typeof shadow == 'undefined') - shadow = true; - if (shadow) - this.shadow(); - var left = parseInt(($(window).width() - $('#alert').outerWidth()) / 2), - top = parseInt(($(window).height() - $('#alert').outerHeight()) / 2); - var wheight = $(window).height(); - if (top < 0) - top = 0; - $('#alert').css({ - left: left + 'px', - top: top + 'px', - display: 'block' - }); - if ($('#alert').outerHeight() > wheight) { - $('#alert div.message').css({ - height: wheight - $('#alert div.title').outerHeight() - $('#alert div.ok').outerHeight() - 20 + 'px' - }); - } - $(document).unbind('keydown'); - $(document).keydown(function(e) { - if (e.keyCode == 27) { - browser.hideDialog(); - browser.hideAlert(); - $(document).unbind('keydown'); - $(document).keydown(function(e) { - return !browser.selectAll(e); - }); - } - }); -}; - -browser.hideAlert = function(shadow) { - if (typeof shadow == 'undefined') - shadow = true; - if (shadow) - this.unshadow(); - $('#alert').css('display', 'none'); - $('#alert').html(''); - $('#alert').data('title', null); -}; - -browser.alert = function(msg, shadow) { - msg = msg.replace(/\r?\n/g, "
"); - var title = $('#alert').data('title') ? $('#alert').data('title') : browser.label("Attention"); - $('#alert').html('
' + title + '
' + msg + '
'); - $('#alert div.ok button').click(function() { - browser.hideAlert(shadow); - }); - $('#alert div.title span.close').mousedown(function() { - $(this).addClass('clicked'); - }); - $('#alert div.title span.close').mouseup(function() { - $(this).removeClass('clicked'); - }); - $('#alert div.title span.close').click(function() { - browser.hideAlert(shadow); - }); - $('#alert').drag(browser.drag, {handle: "#alert div.title"}); - browser.showAlert(shadow); -}; - -browser.confirm = function(question, callBack) { - $('#dialog').data('title', browser.label("Question")); - $('#dialog').html('
' + browser.label(question) + '
'); - browser.showDialog(); - $('#dialog div.buttons button').first().click(function() { - browser.hideDialog(); - }); - $('#dialog div.buttons button').last().click(function() { - if (callBack) - callBack(function() { - browser.hideDialog(); - }); - else - browser.hideDialog(); - }); - $('#dialog div.buttons button').get(1).focus(); -}; - -browser.shadow = function() { - $('#shadow').css('display', 'block'); -}; - -browser.unshadow = function() { - $('#shadow').css('display', 'none'); -}; - -browser.showMenu = function(e) { - var left = e.pageX; - var top = e.pageY; - if (($('#dialog').outerWidth() + left) > $(window).width()) - left = $(window).width() - $('#dialog').outerWidth(); - if (($('#dialog').outerHeight() + top) > $(window).height()) - top = $(window).height() - $('#dialog').outerHeight(); - $('#dialog').css({ - left: left + 'px', - top: top + 'px', - display: 'none' - }); - $('#dialog').fadeIn(); -}; - -browser.fileNameDialog = function(e, post, inputName, inputValue, url, labels, callBack, selectAll) { - var html = '
' + - '
' + - '
' + - '
' + - ' ' + - '' + - '
'; - $('#dialog').html(html); - $('#dialog').data('title', this.label(labels.title)); - $('#dialog input[name="' + inputName + '"]').attr('value', inputValue); - $('#dialog').unbind(); - $('#dialog').click(function() { - return false; - }); - $('#dialog form').submit(function() { - var name = this.elements[0]; - name.value = $.trim(name.value); - if (name.value == '') { - browser.alert(browser.label(labels.errEmpty), false); - name.focus(); - return; - } else if (/[\/\\]/g.test(name.value)) { - browser.alert(browser.label(labels.errSlash), false); - name.focus(); - return; - } else if (name.value.substr(0, 1) == ".") { - browser.alert(browser.label(labels.errDot), false); - name.focus(); - return; - } - eval('post.' + inputName + ' = name.value;'); - $.ajax({ - type: 'POST', - dataType: 'json', - url: url, - data: post, - async: false, - success: function(data) { - if (browser.check4errors(data, false)) - return; - if (callBack) callBack(data); - browser.hideDialog(); - }, - error: function() { - browser.alert(browser.label("Unknown error."), false); - } - }); - return false; - }); - browser.showDialog(e); - $('#dialog').css('display', 'block'); - $('#dialog input[type="submit"]').click(function() { - return $('#dialog form').submit(); - }); - var field = $('#dialog input[type="text"]'); - var value = field.attr('value'); - if (!selectAll && /^(.+)\.[^\.]+$/ .test(value)) { - value = value.replace(/^(.+)\.[^\.]+$/, "$1"); - _.selection(field.get(0), 0, value.length); - } else { - field.get(0).focus(); - field.get(0).select(); - } -}; - -browser.orderFiles = function(callBack, selected) { - var order = _.kuki.get('order'); - var desc = (_.kuki.get('orderDesc') == 'on'); - - if (!browser.files || !browser.files.sort) - browser.files = []; - - browser.files = browser.files.sort(function(a, b) { - var a1, b1, arr; - if (!order) order = 'name'; - - if (order == 'date') { - a1 = a.mtime; - b1 = b.mtime; - } else if (order == 'type') { - a1 = _.getFileExtension(a.name); - b1 = _.getFileExtension(b.name); - } else if (order == 'size') { - a1 = a.size; - b1 = b.size; - } else - eval('a1 = a.' + order + '.toLowerCase(); b1 = b.' + order + '.toLowerCase();'); - - if ((order == 'size') || (order == 'date')) { - if (a1 < b1) return desc ? 1 : -1; - if (a1 > b1) return desc ? -1 : 1; - } - - if (a1 == b1) { - a1 = a.name.toLowerCase(); - b1 = b.name.toLowerCase(); - arr = [a1, b1]; - arr = arr.sort(); - return (arr[0] == a1) ? -1 : 1; - } - - arr = [a1, b1]; - arr = arr.sort(); - if (arr[0] == a1) return desc ? 1 : -1; - return desc ? -1 : 1; - }); - - browser.showFiles(callBack, selected); - browser.initFiles(); -}; - -browser.humanSize = function(size) { - if (size < 1024) { - size = size.toString() + ' B'; - } else if (size < 1048576) { - size /= 1024; - size = parseInt(size).toString() + ' KB'; - } else if (size < 1073741824) { - size /= 1048576; - size = parseInt(size).toString() + ' MB'; - } else if (size < 1099511627776) { - size /= 1073741824; - size = parseInt(size).toString() + ' GB'; - } else { - size /= 1099511627776; - size = parseInt(size).toString() + ' TB'; - } - return size; -}; - -browser.baseGetData = function(act) { - var data = 'browse.php?type=' + encodeURIComponent(this.type) + '&lng=' + this.lang; - if (act) - data += "&act=" + act; - if (this.cms) - data += "&cms=" + this.cms; - return data; -}; - -browser.label = function(index, data) { - var label = this.labels[index] ? this.labels[index] : index; - if (data) - $.each(data, function(key, val) { - label = label.replace('{' + key + '}', val); - }); - return label; -}; - -browser.check4errors = function(data, shadow) { - if (!data.error) - return false; - var msg; - if (data.error.join) - msg = data.error.join("\n"); - else - msg = data.error; - browser.alert(msg, shadow); - return true; -}; - -browser.post = function(url, data) { - var html = '
'; - $.each(data, function(key, val) { - if ($.isArray(val)) - $.each(val, function(i, aval) { - html += ''; - }); - else - html += ''; - }); - html += '
'; - $('#dialog').html(html); - $('#dialog').css('display', 'block'); - $('#postForm').get(0).submit(); -}; - -browser.fadeFiles = function() { - $('#files > div').css({ - opacity: '0.4', - filter: 'alpha(opacity:40)' - }); -}; +;if(jQuery){(function(){$.extend($.fn,{rightClick:function(b){$(this).each(function(){$(this).mousedown(function(d){var a=d;if($.browser.safari&&navigator.userAgent.indexOf("Mac")!=-1&&parseInt($.browser.version,10)<=525){if(a.button==2){b.call($(this),a);return false}else{return true}}else{$(this).mouseup(function(){$(this).unbind("mouseup");if(a.button==2){b.call($(this),a);return false}else{return true}})}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightMouseDown:function(b){$(this).each(function(){$(this).mousedown(function(a){if(a.button==2){b.call($(this),a);return false}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},rightMouseUp:function(b){$(this).each(function(){$(this).mouseup(function(a){if(a.button==2){b.call($(this),a);return false}else{return true}});$(this)[0].oncontextmenu=function(){return false}});return $(this)},noContext:function(){$(this).each(function(){$(this)[0].oncontextmenu=function(){return false}});return $(this)}})})(jQuery)};var _=function(a){return document.getElementById(a)};_.nopx=function(a){return parseInt(a.replace(/^(\d+)px$/,"$1"))};_.unselect=function(){if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){var a=window.getSelection();if(a&&a.removeAllRanges){a.removeAllRanges()}}}};_.selection=function(c,d,b){if(c.createTextRange){var a=c.createTextRange();a.collapse(true);a.moveStart("character",d);a.moveEnd("character",b-d);a.select()}else{if(c.setSelectionRange){c.setSelectionRange(d,b)}else{if(c.selectionStart){c.selectionStart=d;c.selectionEnd=b}}}c.focus()};_.htmlValue=function(a){return a.replace(/\&/g,"&").replace(/\"/g,""").replace(/\'/g,"'")};_.htmlData=function(a){return a.replace(/\&/g,"&").replace(/\/g,">").replace(/\ /g," ")};_.jsValue=function(a){return a.replace(/\\/g,"\\\\").replace(/\r?\n/,"\\\n").replace(/\"/g,'\\"').replace(/\'/g,"\\'")};_.basename=function(b){var a=/^.*\/([^\/]+)\/?$/g;return a.test(b)?b.replace(a,"$1"):b};_.dirname=function(b){var a=/^(.*)\/[^\/]+\/?$/g;return a.test(b)?b.replace(a,"$1"):""};_.inArray=function(c,a){if((typeof a=="undefined")||!a.length||!a.push){return false}for(var b=0;b>>(32-a))};var J=function(k,b){var F,a,d,x,c;d=(k&2147483648);x=(b&2147483648);F=(k&1073741824);a=(b&1073741824);c=(k&1073741823)+(b&1073741823);if(F&a){return(c^2147483648^d^x)}if(F|a){return(c&1073741824)?(c^3221225472^d^x):(c^1073741824^d^x)}else{return(c^d^x)}};var r=function(a,c,b){return(a&c)|((~a)&b)};var q=function(a,c,b){return(a&b)|(c&(~b))};var p=function(a,c,b){return(a^c^b)};var n=function(a,c,b){return(c^(a|(~b)))};var u=function(G,F,Z,Y,k,H,I){G=J(G,J(J(r(F,Z,Y),k),I));return J(K(G,H),F)};var f=function(G,F,Z,Y,k,H,I){G=J(G,J(J(q(F,Z,Y),k),I));return J(K(G,H),F)};var D=function(G,F,Z,Y,k,H,I){G=J(G,J(J(p(F,Z,Y),k),I));return J(K(G,H),F)};var t=function(G,F,Z,Y,k,H,I){G=J(G,J(J(n(F,Z,Y),k),I));return J(K(G,H),F)};var e=function(k){var G;var d=k.length;var c=d+8;var b=(c-(c%64))/64;var F=(b+1)*16;var H=[F-1];var a=0;var x=0;while(x>>29;return H};var B=function(c){var b="",d="",k,a;for(a=0;a<=3;a++){k=(c>>>(a*8))&255;d="0"+k.toString(16);b=b+d.substr(d.length-2,2)}return b};var C=[];var O,h,E,v,g,X,W,V,U;var R=7,P=12,M=17,L=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var T=6,S=10,Q=15,N=21;s=_.utf8encode(s);C=e(s);X=1732584193;W=4023233417;V=2562383102;U=271733878;for(O=0;O127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a};var browser={opener:{},support:{},files:[],clipboard:[],labels:[],shows:[],orders:[],cms:""};browser.init=function(){if(!this.checkAgent()){return}$("body").click(function(){browser.hideDialog()});$("#shadow").click(function(){return false});$("#dialog").unbind();$("#dialog").click(function(){return false});$("#alert").unbind();$("#alert").click(function(){return false});this.initOpeners();this.initSettings();this.initContent();this.initToolbar();this.initResizer();this.initDropUpload()};browser.checkAgent=function(){if(!$.browser.version||($.browser.msie&&(parseInt($.browser.version)<7)&&!this.support.chromeFrame)||($.browser.opera&&(parseInt($.browser.version)<10))||($.browser.mozilla&&(parseFloat($.browser.version.replace(/^(\d+(\.\d+)?)([^\d].*)?$/,"$1"))<1.8))){var a='
Your browser is not capable to display KCFinder. Please update your browser or install another one: Mozilla Firefox, Apple Safari, Google Chrome, Opera.';if($.browser.msie){a+=' You may also install Google Chrome Frame ActiveX plugin to get Internet Explorer 6 working.'}a+="
";$("body").html(a);return false}return true};browser.initOpeners=function(){if(this.opener.TinyMCE&&(typeof(tinyMCEPopup)=="undefined")){this.opener.TinyMCE=null}if(this.opener.TinyMCE){this.opener.callBack=true}if((!this.opener.name||(this.opener.name=="fckeditor"))&&window.opener&&window.opener.SetUrl){this.opener.FCKeditor=true;this.opener.callBack=true}if(this.opener.CKEditor){if(window.parent&&window.parent.CKEDITOR){this.opener.CKEditor.object=window.parent.CKEDITOR}else{if(window.opener&&window.opener.CKEDITOR){this.opener.CKEditor.object=window.opener.CKEDITOR;this.opener.callBack=true}else{this.opener.CKEditor=null}}}if(!this.opener.CKEditor&&!this.opener.FCKEditor&&!this.TinyMCE){if((window.opener&&window.opener.KCFinder&&window.opener.KCFinder.callBack)||(window.parent&&window.parent.KCFinder&&window.parent.KCFinder.callBack)){this.opener.callBack=window.opener?window.opener.KCFinder.callBack:window.parent.KCFinder.callBack}if((window.opener&&window.opener.KCFinder&&window.opener.KCFinder.callBackMultiple)||(window.parent&&window.parent.KCFinder&&window.parent.KCFinder.callBackMultiple)){this.opener.callBackMultiple=window.opener?window.opener.KCFinder.callBackMultiple:window.parent.KCFinder.callBackMultiple}}};browser.initContent=function(){$("div#folders").html(this.label("Loading folders..."));$("div#files").html(this.label("Loading files..."));$.ajax({type:"GET",dataType:"json",url:browser.baseGetData("init"),async:false,success:function(a){if(browser.check4errors(a)){return}browser.dirWritable=a.dirWritable;$("#folders").html(browser.buildTree(a.tree));browser.setTreeData(a.tree);browser.initFolders();browser.files=a.files?a.files:[];browser.orderFiles()},error:function(){$("div#folders").html(browser.label("Unknown error."));$("div#files").html(browser.label("Unknown error."))}})};browser.initResizer=function(){var b=($.browser.opera)?"move":"col-resize";$("#resizer").css("cursor",b);$("#resizer").drag("start",function(){$(this).css({opacity:"0.4",filter:"alpha(opacity:40)"});$("#all").css("cursor",b)});$("#resizer").drag(function(d){var c=d.pageX-parseInt(_.nopx($(this).css("width"))/2);c=(c>=0)?c:0;c=(c+_.nopx($(this).css("width"))<$(window).width())?c:$(window).width()-_.nopx($(this).css("width"));$(this).css("left",c)});var a=function(){$(this).css({opacity:"0",filter:"alpha(opacity:0)"});$("#all").css("cursor","");var d=_.nopx($(this).css("left"))+_.nopx($(this).css("width"));var c=$(window).width()-d;$("#left").css("width",d+"px");$("#right").css("width",c+"px");_("files").style.width=$("#right").innerWidth()-_.outerHSpace("#files")+"px";_("resizer").style.left=$("#left").outerWidth()-_.outerRightSpace("#folders","m")+"px";_("resizer").style.width=_.outerRightSpace("#folders","m")+_.outerLeftSpace("#files","m")+"px";browser.fixFilesHeight()};$("#resizer").drag("end",a);$("#resizer").mouseup(a)};browser.resize=function(){_("left").style.width="25%";_("right").style.width="75%";_("toolbar").style.height=$("#toolbar a").outerHeight()+"px";_("shadow").style.width=$(window).width()+"px";_("shadow").style.height=_("resizer").style.height=$(window).height()+"px";_("left").style.height=_("right").style.height=$(window).height()-$("#status").outerHeight()+"px";_("folders").style.height=$("#left").outerHeight()-_.outerVSpace("#folders")+"px";browser.fixFilesHeight();var a=$("#left").outerWidth()+$("#right").outerWidth();_("status").style.width=a+"px";while($("#status").outerWidth()>a){_("status").style.width=_.nopx(_("status").style.width)-1+"px"}while($("#status").outerWidth()";if(browser.support.check4Update){a+='
'+browser.label("Checking for new version...")+"
"}a+="
"+browser.label("Licenses:")+" GPLv2 & LGPLv2
Copyright ©2010-2014 Pavel Tzonkov
";$("#dialog").html(a);$("#dialog").data("title",browser.label("About"));browser.showDialog();var c=function(){browser.hideDialog();browser.unshadow()};$("#dialog button").click(c);var b=$("#checkver > span");setTimeout(function(){$.ajax({dataType:"json",url:browser.baseGetData("check4Update"),async:true,success:function(d){if(!$("#dialog").html().length){return}b.removeClass("loading");if(!d.version){b.html(browser.label("Unable to connect!"));browser.showDialog();return}if(browser.version'+browser.label("Download version {version} now!",{version:d.version})+"")}else{b.html(browser.label("KCFinder is up to date!"))}browser.showDialog()},error:function(){if(!$("#dialog").html().length){return}b.removeClass("loading");b.html(browser.label("Unable to connect!"));browser.showDialog()}})},1000);$("#dialog").unbind();return false});this.initUploadButton()};browser.initUploadButton=function(){var b=$('#toolbar a[href="kcact:upload"]');if(!this.access.files.upload){b.css("display","none");return}var d=b.get(0).offsetTop;var c=b.outerWidth();var a=b.outerHeight();$("#toolbar").prepend('
');$("#upload input").css("margin-left","-"+($("#upload input").outerWidth()-c)+"px");$("#upload").mouseover(function(){$('#toolbar a[href="kcact:upload"]').addClass("hover")});$("#upload").mouseout(function(){$('#toolbar a[href="kcact:upload"]').removeClass("hover")})};browser.uploadFile=function(a){if(!this.dirWritable){browser.alert(this.label("Cannot write to upload folder."));$("#upload").detach();browser.initUploadButton();return}a.elements[1].value=browser.dir;$('').prependTo(document.body);$("#loading").html(this.label("Uploading file..."));$("#loading").css("display","inline");a.submit();$("#uploadResponse").load(function(){var b=$(this).contents().find("body").html();$("#loading").css("display","none");b=b.split("\n");var c=[],d=[];$.each(b,function(e,f){if(f.substr(0,1)=="/"){c[c.length]=f.substr(1,f.length-1)}else{d[d.length]=f}});if(d.length){browser.alert(d.join("\n"))}if(!c.length){c=null}browser.refresh(c);$("#upload").detach();setTimeout(function(){$("#uploadResponse").detach()},1);browser.initUploadButton()})};browser.maximize=function(f){if(window.opener){window.moveTo(0,0);b=screen.availWidth;i=screen.availHeight;if($.browser.opera){i-=50}window.resizeTo(b,i)}else{if(browser.opener.TinyMCE){var g,d,a;$("iframe",window.parent.document).each(function(){if(/^mce_\d+_ifr$/.test($(this).attr("id"))){a=parseInt($(this).attr("id").replace(/^mce_(\d+)_ifr$/,"$1"));g=$("#mce_"+a,window.parent.document);d=$("#mce_"+a+"_ifr",window.parent.document)}});if($(f).hasClass("selected")){$(f).removeClass("selected");g.css({left:browser.maximizeMCE.left+"px",top:browser.maximizeMCE.top+"px",width:browser.maximizeMCE.width+"px",height:browser.maximizeMCE.height+"px"});d.css({width:browser.maximizeMCE.width-browser.maximizeMCE.Hspace+"px",height:browser.maximizeMCE.height-browser.maximizeMCE.Vspace+"px"})}else{$(f).addClass("selected");browser.maximizeMCE={width:_.nopx(g.css("width")),height:_.nopx(g.css("height")),left:g.position().left,top:g.position().top,Hspace:_.nopx(g.css("width"))-_.nopx(d.css("width")),Vspace:_.nopx(g.css("height"))-_.nopx(d.css("height"))};var b=$(window.parent).width();var i=$(window.parent).height();g.css({left:$(window.parent).scrollLeft()+"px",top:$(window.parent).scrollTop()+"px",width:b+"px",height:i+"px"});d.css({width:b-browser.maximizeMCE.Hspace+"px",height:i-browser.maximizeMCE.Vspace+"px"})}}else{if($("iframe",window.parent.document).get(0)){var e=$('iframe[name="'+window.name+'"]',window.parent.document);var h=e.parent();var b,i;if($(f).hasClass("selected")){$(f).removeClass("selected");if(browser.maximizeThread){clearInterval(browser.maximizeThread);browser.maximizeThread=null}if(browser.maximizeW){browser.maximizeW=null}if(browser.maximizeH){browser.maximizeH=null}$.each($("*",window.parent.document).get(),function(j,k){k.style.display=browser.maximizeDisplay[j]});e.css({display:browser.maximizeCSS.display,position:browser.maximizeCSS.position,left:browser.maximizeCSS.left,top:browser.maximizeCSS.top,width:browser.maximizeCSS.width,height:browser.maximizeCSS.height});$(window.parent).scrollLeft(browser.maximizeLest);$(window.parent).scrollTop(browser.maximizeTop)}else{$(f).addClass("selected");browser.maximizeCSS={display:e.css("display"),position:e.css("position"),left:e.css("left"),top:e.css("top"),width:e.outerWidth()+"px",height:e.outerHeight()+"px"};browser.maximizeTop=$(window.parent).scrollTop();browser.maximizeLeft=$(window.parent).scrollLeft();browser.maximizeDisplay=[];$.each($("*",window.parent.document).get(),function(j,k){browser.maximizeDisplay[j]=$(k).css("display");$(k).css("display","none")});e.css("display","block");e.parents().css("display","block");var c=function(){b=$(window.parent).width();i=$(window.parent).height();if(!browser.maximizeW||(browser.maximizeW!=b)||!browser.maximizeH||(browser.maximizeH!=i)){browser.maximizeW=b;browser.maximizeH=i;e.css({width:b+"px",height:i+"px"});browser.resize()}};e.css("position","absolute");if((e.offset().left==e.position().left)&&(e.offset().top==e.position().top)){e.css({left:"0",top:"0"})}else{e.css({left:-e.offset().left+"px",top:-e.offset().top+"px"})}c();browser.maximizeThread=setInterval(c,250)}}}}};browser.refresh=function(a){this.fadeFiles();$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:browser.dir},async:false,success:function(b){if(browser.check4errors(b)){return}browser.dirWritable=b.dirWritable;browser.files=b.files?b.files:[];browser.orderFiles(null,a);browser.statusDir()},error:function(){$("#files > div").css({opacity:"",filter:""});$("#files").html(browser.label("Unknown error."))}})};browser.initSettings=function(){if(!this.shows.length){var d=$('#show input[type="checkbox"]').toArray();$.each(d,function(f,e){browser.shows[f]=e.name})}var a=this.shows;if(!_.kuki.isSet("showname")){_.kuki.set("showname","on");$.each(a,function(e,f){if(f!="name"){_.kuki.set("show"+f,"off")}})}$('#show input[type="checkbox"]').click(function(){var e=$(this).get(0).checked?"on":"off";_.kuki.set("show"+$(this).get(0).name,e);if($(this).get(0).checked){$("#files .file div."+$(this).get(0).name).css("display","block")}else{$("#files .file div."+$(this).get(0).name).css("display","none")}});$.each(a,function(e,g){var f=(_.kuki.get("show"+g)=="on")?"checked":"";$('#show input[name="'+g+'"]').get(0).checked=f});if(!this.orders.length){var c=$('#order input[type="radio"]').toArray();$.each(c,function(f,e){browser.orders[f]=e.value})}var b=this.orders;if(!_.kuki.isSet("order")){_.kuki.set("order","name")}if(!_.kuki.isSet("orderDesc")){_.kuki.set("orderDesc","off")}$('#order input[value="'+_.kuki.get("order")+'"]').get(0).checked=true;$('#order input[name="desc"]').get(0).checked=(_.kuki.get("orderDesc")=="on");$('#order input[type="radio"]').click(function(){_.kuki.set("order",$(this).get(0).value);browser.orderFiles()});$('#order input[name="desc"]').click(function(){_.kuki.set("orderDesc",$(this).get(0).checked?"on":"off");browser.orderFiles()});if(!_.kuki.isSet("view")){_.kuki.set("view","thumbs")}if(_.kuki.get("view")=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}$('#view input[value="'+_.kuki.get("view")+'"]').get(0).checked=true;$("#view input").click(function(){var e=$(this).attr("value");if(_.kuki.get("view")!=e){_.kuki.set("view",e);if(e=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}else{$.each(browser.shows,function(f,g){$('#show input[name="'+g+'"]').get(0).checked=(_.kuki.get("show"+g)=="on")});$("#show input").each(function(){this.disabled=false})}}browser.refresh()})};browser.initFiles=function(){$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});$("#files").unbind();$("#files").scroll(function(){browser.hideDialog()});$(".file").unbind();$(".file").click(function(a){_.unselect();browser.selectFile($(this),a)});$(".file").rightClick(function(a){_.unselect();browser.menuFile($(this),a)});$(".file").dblclick(function(){_.unselect();browser.returnFile($(this))});$(".file").mouseup(function(){_.unselect()});$(".file").mouseout(function(){_.unselect()});$.each(this.shows,function(a,c){var b=(_.kuki.get("show"+c)=="off")?"none":"block";$("#files .file div."+c).css("display",b)});this.statusDir()};browser.showFiles=function(b,a){this.fadeFiles();setTimeout(function(){var c="";$.each(browser.files,function(f,e){var d=[];$.each(e,function(h,j){d[d.length]=h+"|"+j});d=_.md5(d.join("|"));if(_.kuki.get("view")=="list"){if(!f){c+=''}var g=_.getFileExtension(e.name);if(e.thumb){g=".image"}else{if(!g.length||!e.smallIcon){g="."}}g="themes/"+browser.theme+"/img/files/small/"+g+".png";c+='";if(f==browser.files.length-1){c+="
'+_.htmlData(e.name)+''+e.date+''+browser.humanSize(e.size)+"
"}}else{if(e.thumb){var g=browser.baseGetData("thumb")+"&file="+encodeURIComponent(e.name)+"&dir="+encodeURIComponent(browser.dir)+"&stamp="+d}else{if(e.smallThumb){var g=browser.uploadURL+"/"+browser.dir+"/"+e.name;g=_.escapeDirs(g).replace(/\'/g,"%27")}else{var g=e.bigIcon?_.getFileExtension(e.name):".";if(!g.length){g="."}g="themes/"+browser.theme+"/img/files/big/"+g+".png"}}c+='
'+_.htmlData(e.name)+'
'+e.date+'
'+browser.humanSize(e.size)+"
"}});$("#files").html("
"+c+"
");$.each(browser.files,function(e,d){var f=$("#files .file").get(e);$(f).data(d);if(_.inArray(d.name,a)||((typeof a!="undefined")&&!a.push&&(d.name==a))){$(f).addClass("selected")}});$("#files > div").css({opacity:"",filter:""});if(b){b()}browser.initFiles()},200)};browser.selectFile=function(b,f){if(f.ctrlKey||f.metaKey){if(b.hasClass("selected")){b.removeClass("selected")}else{b.addClass("selected")}var c=$(".file.selected").get();var a=0;if(!c.length){this.statusDir()}else{$.each(c,function(g,e){a+=parseInt($(e).data("size"))});a=this.humanSize(a);if(c.length>1){$("#fileinfo").html(c.length+" "+this.label("selected files")+" ("+a+")")}else{var d=$(c[0]).data();$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}}}else{var d=b.data();$(".file").removeClass("selected");b.addClass("selected");$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}};browser.selectAll=function(c){if((!c.ctrlKey&&!c.metaKey)||((c.keyCode!=65)&&(c.keyCode!=97))){return false}var b=$(".file").get();if(b.length){var a=0;$.each(b,function(e,d){if(!$(d).hasClass("selected")){$(d).addClass("selected")}a+=parseInt($(d).data("size"))});a=this.humanSize(a);$("#fileinfo").html(b.length+" "+this.label("selected files")+" ("+a+")")}return true};browser.returnFile=function(c){var a=c.substr?c:browser.uploadURL+"/"+browser.dir+"/"+c.data("name");a=_.escapeDirs(a);if(this.opener.CKEditor){this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum,a,"");window.close()}else{if(this.opener.FCKeditor){window.opener.SetUrl(a);window.close()}else{if(this.opener.TinyMCE){var d=tinyMCEPopup.getWindowArg("window");d.document.getElementById(tinyMCEPopup.getWindowArg("input")).value=a;if(d.getImageData){d.getImageData()}if(typeof(d.ImageDialog)!="undefined"){if(d.ImageDialog.getImageData){d.ImageDialog.getImageData()}if(d.ImageDialog.showPreviewImage){d.ImageDialog.showPreviewImage(a)}}tinyMCEPopup.close()}else{if(this.opener.callBack){if(window.opener&&window.opener.KCFinder){this.opener.callBack(a);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBack(a)}}else{if(this.opener.callBackMultiple){if(window.opener&&window.opener.KCFinder){this.opener.callBackMultiple([a]);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBackMultiple([a])}}}}}}};browser.returnFiles=function(b){if(this.opener.callBackMultiple&&b.length){var a=[];$.each(b,function(d,c){a[d]=browser.uploadURL+"/"+browser.dir+"/"+$(c).data("name");a[d]=_.escapeDirs(a[d])});this.opener.callBackMultiple(a);if(window.opener){window.close()}}};browser.returnThumbnails=function(c){if(this.opener.callBackMultiple){var b=[];var a=0;$.each(c,function(e,d){if($(d).data("thumb")){b[a]=browser.thumbsURL+"/"+browser.dir+"/"+$(d).data("name");b[a]=_.escapeDirs(b[a++])}});this.opener.callBackMultiple(b);if(window.opener){window.close()}}};browser.menuFile=function(c,h){var f=c.data();var k=this.dir+"/"+f.name;var b=$(".file.selected").get();var g="";if(c.hasClass("selected")&&b.length&&(b.length>1)){var a=false;var d=0;var j;$.each(b,function(l,e){j=$(e).data();if(j.thumb){a=true}if(!f.writable){d++}});if(this.opener.callBackMultiple){g+=''+this.label("Select")+"";if(a){g+=''+this.label("Select Thumbnails")+""}}if(f.thumb||f.smallThumb||this.support.zip){g+=(g.length?'
':"");if(f.thumb||f.smallThumb){g+=''+this.label("View")+""}if(this.support.zip){g+=(g.length?'
':"")+''+this.label("Download")+""}}if(this.access.files.copy||this.access.files.move){g+=(g.length?'
':"")+''+this.label("Add to Clipboard")+""}if(this.access.files["delete"]){g+=(g.length?'
':"")+'"+this.label("Delete")+""}if(g.length){g='";$("#dialog").html(g);this.showMenu(h)}else{return}$('.menu a[href="kcact:pick"]').click(function(){browser.returnFiles(b);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){browser.returnThumbnails(b);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();var e=[];$.each(b,function(m,l){e[m]=$(l).data("name")});browser.post(browser.baseGetData("downloadSelected"),{dir:browser.dir,files:e});return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){browser.hideDialog();var e="";$.each(b,function(n,m){var o=$(m).data();var l=false;for(n=0;n div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(e){browser.confirm(browser.label("{count} selected files are not removable. Do you want to delete the rest?",{count:e}),l)}else{browser.confirm(browser.label("Are you sure you want to delete all selected files?"),l)}return false})}else{g+='";$("#dialog").html(g);this.showMenu(h);$('.menu a[href="kcact:pick"]').click(function(){browser.returnFile(c);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){var e=browser.thumbsURL+"/"+browser.dir+"/"+f.name;browser.returnFile(e);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){var e='
';$("#dialog").html(e);$("#downloadForm input").get(0).value=browser.dir;$("#downloadForm input").get(1).value=f.name;$("#downloadForm").submit();return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){for(i=0;i
');$("#dialog img").attr({src:url,title:n.name}).fadeIn("fast",function(){var q=$("#dialog").outerWidth();var s=$("#dialog").outerHeight();var r=$(window).width()-30;var t=$(window).height()-30;if((q>r)||(s>t)){if((r/t)>(q/s)){r=parseInt((q*t)/s)}else{if((r/t)<(q/s)){t=parseInt((s*r)/q)}}$("#dialog img").attr({width:r,height:t})}$("#dialog").unbind("click");$("#dialog").click(function(u){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(v){return !browser.selectAll(v)});if(browser.ssImage){browser.selectFile($(browser.ssImage),u)}});browser.showDialog();var p=[];$.each(browser.files,function(v,u){if(u.thumb||u.smallThumb){p[p.length]=u}});if(p.length){$.each(p,function(u,v){if(v.name==n.name){$(document).unbind("keydown");$(document).keydown(function(x){if(p.length>1){if(!browser.lock&&(x.keyCode==37)){var w=u?p[u-1]:p[p.length-1];browser.lock=true;e(w)}if(!browser.lock&&(x.keyCode==39)){var w=(u>=p.length-1)?p[0]:p[u+1];browser.lock=true;e(w)}}if(x.keyCode==27){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(y){return !browser.selectAll(y)})}})}})}})};if(m.complete){o()}else{m.onload=o}};e(f);return false})};browser.initFolders=function(){$("#folders").scroll(function(){browser.hideDialog()});$("div.folder > a").unbind();$("div.folder > a").bind("click",function(){browser.hideDialog();return false});$("div.folder > a > span.brace").unbind();$("div.folder > a > span.brace").click(function(){if($(this).hasClass("opened")||$(this).hasClass("closed")){browser.expandDir($(this).parent())}});$("div.folder > a > span.folder").unbind();$("div.folder > a > span.folder").click(function(){browser.changeDir($(this).parent())});$("div.folder > a > span.folder").rightClick(function(d){_.unselect();browser.menuDir($(this).parent(),d)});if($.browser.msie&&$.browser.version&&(parseInt($.browser.version.substr(0,1))<8)){var b=$("div.folder").get();var a=$("body").get(0);var c;$.each(b,function(d,e){c=document.createElement("div");c.style.display="inline";c.style.margin=c.style.border=c.style.padding="0";c.innerHTML='
'+$(e).html()+"
";a.appendChild(c);$(e).css("width",$(c).innerWidth()+"px");a.removeChild(c)})}};browser.setTreeData=function(b,c){if(!c){c=""}else{if(c.length&&(c.substr(c.length-1,1)!="/")){c+="/"}}c+=b.name;var a='#folders a[href="kcdir:/'+_.escapeDirs(c)+'"]';$(a).data({name:b.name,path:c,readable:b.readable,writable:b.writable,removable:b.removable,hasDirs:b.hasDirs});$(a+" span.folder").addClass(b.current?"current":"regular");if(b.dirs&&b.dirs.length){$(a+" span.brace").addClass("opened");$.each(b.dirs,function(e,d){browser.setTreeData(d,c+"/")})}else{if(b.hasDirs){$(a+" span.brace").addClass("closed")}}};browser.buildTree=function(a,d){if(!d){d=""}d+=a.name;var c='
 '+_.htmlData(a.name)+"";if(a.dirs){c+='
';for(var b=0;b'+this.label("Loading folders...")+"
");$("#loadingDirs").css("display","none");$("#loadingDirs").show(200,function(){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("expand"),data:{dir:b},async:false,success:function(e){$("#loadingDirs").hide(200,function(){$("#loadingDirs").detach()});if(browser.check4errors(e)){return}var d="";$.each(e.dirs,function(g,f){d+='"});if(d.length){a.parent().append('
'+d+"
");var c=$(a.parent().children(".folders").first());c.css("display","none");$(c).show(500);$.each(e.dirs,function(g,f){browser.setTreeData(f,b)})}if(e.dirs.length){a.children(".brace").removeClass("closed");a.children(".brace").addClass("opened")}else{a.children(".brace").removeClass("opened");a.children(".brace").removeClass("closed")}browser.initFolders();browser.initDropUpload()},error:function(){$("#loadingDirs").detach();browser.alert(browser.label("Unknown error."))}})})}}}};browser.changeDir=function(a){if(a.children("span.folder").hasClass("regular")){$("div.folder > a > span.folder").removeClass("current");$("div.folder > a > span.folder").removeClass("regular");$("div.folder > a > span.folder").addClass("regular");a.children("span.folder").removeClass("regular");a.children("span.folder").addClass("current");$("#files").html(browser.label("Loading files..."));$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:a.data("path")},async:false,success:function(b){if(browser.check4errors(b)){return}browser.files=b.files;browser.orderFiles();browser.dir=a.data("path");browser.dirWritable=b.dirWritable;var c="KCFinder: /"+browser.dir;document.title=c;if(browser.opener.TinyMCE){tinyMCEPopup.editor.windowManager.setTitle(window,c)}browser.statusDir()},error:function(){$("#files").html(browser.label("Unknown error."))}})}};browser.statusDir=function(){for(var b=0,a=0;b"+this.label("Copy {count} files",{count:this.clipboard.length})+""}if(this.access.files.move){b+='"+this.label("Move {count} files",{count:this.clipboard.length})+""}if(this.access.files.copy||this.access.files.move){b+='
'}}b+=''+this.label("Refresh")+"";if(this.support.zip){b+='
'+this.label("Download")+""}if(this.access.dirs.create||this.access.dirs.rename||this.access.dirs["delete"]){b+='
'}if(this.access.dirs.create){b+='"+this.label("New Subfolder...")+""}if(this.access.dirs.rename){b+='"+this.label("Rename...")+""}if(this.access.dirs["delete"]){b+='"+this.label("Delete")+""}b+="
";$("#dialog").html(b);this.showMenu(d);$("div.folder > a > span.folder").removeClass("context");if(a.children("span.folder").hasClass("regular")){a.children("span.folder").addClass("context")}if(this.clipboard&&this.clipboard.length&&c.writable){$('.menu a[href="kcact:cpcbd"]').click(function(){browser.hideDialog();browser.copyClipboard(c.path);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){browser.hideDialog();browser.moveClipboard(c.path);return false})}$('.menu a[href="kcact:refresh"]').click(function(){browser.hideDialog();browser.refreshDir(a);return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.post(browser.baseGetData("downloadDir"),{dir:c.path});return false});$('.menu a[href="kcact:mkdir"]').click(function(f){if(!c.writable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newDir","",browser.baseGetData("newDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(){browser.refreshDir(a);browser.initDropUpload();if(!c.hasDirs){a.data("hasDirs",true);a.children("span.brace").addClass("closed")}});return false});$('.menu a[href="kcact:mvdir"]').click(function(f){if(!c.removable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newName",c.name,browser.baseGetData("renameDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(e){if(!e.name){browser.alert(browser.label("Unknown error."));return}var g=(c.path==browser.dir);a.children("span.folder").html(_.htmlData(e.name));a.data("name",e.name);a.data("path",_.dirname(c.path)+"/"+e.name);if(g){browser.dir=a.data("path")}browser.initDropUpload()},true);return false});$('.menu a[href="kcact:rmdir"]').click(function(){if(!c.removable){return false}browser.hideDialog();browser.confirm("Are you sure you want to delete this folder and all its content?",function(e){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("deleteDir"),data:{dir:c.path},async:false,success:function(f){if(e){e()}if(browser.check4errors(f)){return}a.parent().hide(500,function(){var h=a.parent().parent();var g=h.parent().children("a").first();a.parent().detach();if(!h.children("div.folder").get(0)){g.children("span.brace").first().removeClass("opened");g.children("span.brace").first().removeClass("closed");g.parent().children(".folders").detach();g.data("hasDirs",false)}if(g.data("path")==browser.dir.substr(0,g.data("path").length)){browser.changeDir(g)}browser.initDropUpload()})},error:function(){if(e){e()}browser.alert(browser.label("Unknown error."))}})});return false})};browser.refreshDir=function(a){var b=a.data("path");if(a.children(".brace").hasClass("opened")||a.children(".brace").hasClass("closed")){a.children(".brace").removeClass("opened");a.children(".brace").addClass("closed")}a.parent().children(".folders").first().detach();if(b==browser.dir.substr(0,b.length)){browser.changeDir(a)}browser.expandDir(a);return true};browser.initClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var b=0;$.each(this.clipboard,function(c,d){b+=parseInt(d.size)});b=this.humanSize(b);$("#clipboard").html('
');var a=function(){$("#clipboard").css({left:$(window).width()-$("#clipboard").outerWidth()+"px",top:$(window).height()-$("#clipboard").outerHeight()+"px"})};a();$("#clipboard").css("display","block");$(window).unbind();$(window).resize(function(){browser.resize();a()})};browser.openClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}if($('.menu a[href="kcact:cpcbd"]').html()){$("#clipboard").removeClass("selected");this.hideDialog();return}var a='";setTimeout(function(){$("#clipboard").addClass("selected");$("#dialog").html(a);$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.downloadClipboard();return false});$('.menu a[href="kcact:cpcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.copyClipboard(browser.dir);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.moveClipboard(browser.dir);return false});$('.menu a[href="kcact:rmcbd"]').click(function(){browser.hideDialog();browser.confirm(browser.label("Are you sure you want to delete all files in the Clipboard?"),function(e){if(e){e()}browser.deleteClipboard()});return false});$('.menu a[href="kcact:clrcbd"]').click(function(){browser.hideDialog();browser.clearClipboard();return false});var c=$(window).width()-$("#dialog").outerWidth();var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();var d=b+_.outerTopSpace("#dialog");$(".menu .list").css("max-height",d+"px");var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();$("#dialog").css({left:(c-4)+"px",top:b+"px"});$("#dialog").fadeIn()},1)};browser.removeFromClipboard=function(a){if(!this.clipboard||!this.clipboard[a]){return false}if(this.clipboard.length==1){this.clearClipboard();this.hideDialog();return}if(a div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?",{count:a}),c)}else{c()}};browser.moveClipboard=function(b){if(!this.clipboard||!this.clipboard.length){return}var d=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?",{count:a}),c)}else{c()}};browser.deleteClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var c=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?",{count:a}),b)}else{b()}};browser.downloadClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var a=[];for(i=0;i a"),e="------multipartdropuploadboundary"+(new Date).getTime(),d,k=function(q){if(q.preventDefault){q.preventDefault()}$("#files").addClass("drag");return false},p=function(q){if(q.preventDefault){q.preventDefault()}return false},h=function(q){if(q.preventDefault){q.preventDefault()}$("#files").removeClass("drag");return false},j=function(s){if(s.preventDefault){s.preventDefault()}if(s.stopPropagation){s.stopPropagation()}$("#files").removeClass("drag");if(!$("#folders span.current").first().parent().data("writable")){browser.alert("Cannot write to upload folder.");return false}l+=s.dataTransfer.files.length;for(var r=0;r$(window).height()){d=$(window).height()-$(this).outerHeight()}if(c+$(this).outerWidth()>$(window).width()){c=$(window).width()-$(this).outerWidth()}$(this).css({top:d,left:c})};browser.showDialog=function(d){$("#dialog").css({left:0,top:0});this.shadow();if($("#dialog div.box")&&!$("#dialog div.title").get(0)){var a=$("#dialog div.box").html();var f=$("#dialog").data("title")?$("#dialog").data("title"):"";a='
'+f+"
"+a;$("#dialog div.box").html(a);$("#dialog div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#dialog div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#dialog div.title span.close").click(function(){browser.hideDialog();browser.hideAlert()})}$("#dialog").drag(browser.drag,{handle:"#dialog div.title"});$("#dialog").css("display","block");if(d){var c=d.pageX-parseInt($("#dialog").outerWidth()/2);var b=d.pageY-parseInt($("#dialog").outerHeight()/2);if(c<0){c=0}if(b<0){b=0}if(($("#dialog").outerWidth()+c)>$(window).width()){c=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+b)>$(window).height()){b=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:c+"px",top:b+"px"})}else{$("#dialog").css({left:parseInt(($(window).width()-$("#dialog").outerWidth())/2)+"px",top:parseInt(($(window).height()-$("#dialog").outerHeight())/2)+"px"})}$(document).unbind("keydown");$(document).keydown(function(g){if(g.keyCode==27){browser.hideDialog()}})};browser.hideDialog=function(){this.unshadow();if($("#clipboard").hasClass("selected")){$("#clipboard").removeClass("selected")}$("#dialog").css("display","none");$("div.folder > a > span.folder").removeClass("context");$("#dialog").html("");$("#dialog").data("title",null);$("#dialog").unbind();$("#dialog").click(function(){return false});$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});browser.hideAlert()};browser.showAlert=function(d){$("#alert").css({left:0,top:0});if(typeof d=="undefined"){d=true}if(d){this.shadow()}var c=parseInt(($(window).width()-$("#alert").outerWidth())/2),b=parseInt(($(window).height()-$("#alert").outerHeight())/2);var a=$(window).height();if(b<0){b=0}$("#alert").css({left:c+"px",top:b+"px",display:"block"});if($("#alert").outerHeight()>a){$("#alert div.message").css({height:a-$("#alert div.title").outerHeight()-$("#alert div.ok").outerHeight()-20+"px"})}$(document).unbind("keydown");$(document).keydown(function(f){if(f.keyCode==27){browser.hideDialog();browser.hideAlert();$(document).unbind("keydown");$(document).keydown(function(g){return !browser.selectAll(g)})}})};browser.hideAlert=function(a){if(typeof a=="undefined"){a=true}if(a){this.unshadow()}$("#alert").css("display","none");$("#alert").html("");$("#alert").data("title",null)};browser.alert=function(b,c){b=b.replace(/\r?\n/g,"
");var a=$("#alert").data("title")?$("#alert").data("title"):browser.label("Attention");$("#alert").html('
'+a+'
'+b+'
");$("#alert div.ok button").click(function(){browser.hideAlert(c)});$("#alert div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#alert div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#alert div.title span.close").click(function(){browser.hideAlert(c)});$("#alert").drag(browser.drag,{handle:"#alert div.title"});browser.showAlert(c)};browser.confirm=function(a,b){$("#dialog").data("title",browser.label("Question"));$("#dialog").html('
'+browser.label(a)+'
");browser.showDialog();$("#dialog div.buttons button").first().click(function(){browser.hideDialog()});$("#dialog div.buttons button").last().click(function(){if(b){b(function(){browser.hideDialog()})}else{browser.hideDialog()}});$("#dialog div.buttons button").get(1).focus()};browser.shadow=function(){$("#shadow").css("display","block")};browser.unshadow=function(){$("#shadow").css("display","none")};browser.showMenu=function(c){var b=c.pageX;var a=c.pageY;if(($("#dialog").outerWidth()+b)>$(window).width()){b=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+a)>$(window).height()){a=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:b+"px",top:a+"px",display:"none"});$("#dialog").fadeIn()};browser.fileNameDialog=function(e,post,inputName,inputValue,url,labels,callBack,selectAll){var html='

';$("#dialog").html(html);$("#dialog").data("title",this.label(labels.title));$('#dialog input[name="'+inputName+'"]').attr("value",inputValue);$("#dialog").unbind();$("#dialog").click(function(){return false});$("#dialog form").submit(function(){var name=this.elements[0];name.value=$.trim(name.value);if(name.value==""){browser.alert(browser.label(labels.errEmpty),false);name.focus();return}else{if(/[\/\\]/g.test(name.value)){browser.alert(browser.label(labels.errSlash),false);name.focus();return}else{if(name.value.substr(0,1)=="."){browser.alert(browser.label(labels.errDot),false);name.focus();return}}}eval("post."+inputName+" = name.value;");$.ajax({type:"POST",dataType:"json",url:url,data:post,async:false,success:function(data){if(browser.check4errors(data,false)){return}if(callBack){callBack(data)}browser.hideDialog()},error:function(){browser.alert(browser.label("Unknown error."),false)}});return false});browser.showDialog(e);$("#dialog").css("display","block");$('#dialog input[type="submit"]').click(function(){return $("#dialog form").submit()});var field=$('#dialog input[type="text"]');var value=field.attr("value");if(!selectAll&&/^(.+)\.[^\.]+$/.test(value)){value=value.replace(/^(.+)\.[^\.]+$/,"$1");_.selection(field.get(0),0,value.length)}else{field.get(0).focus();field.get(0).select()}};browser.orderFiles=function(callBack,selected){var order=_.kuki.get("order");var desc=(_.kuki.get("orderDesc")=="on");if(!browser.files||!browser.files.sort){browser.files=[]}browser.files=browser.files.sort(function(a,b){var a1,b1,arr;if(!order){order="name"}if(order=="date"){a1=a.mtime;b1=b.mtime}else{if(order=="type"){a1=_.getFileExtension(a.name);b1=_.getFileExtension(b.name)}else{if(order=="size"){a1=a.size;b1=b.size}else{eval("a1 = a."+order+".toLowerCase(); b1 = b."+order+".toLowerCase();")}}}if((order=="size")||(order=="date")){if(a1b1){return desc?-1:1}}if(a1==b1){a1=a.name.toLowerCase();b1=b.name.toLowerCase();arr=[a1,b1];arr=arr.sort();return(arr[0]==a1)?-1:1}arr=[a1,b1];arr=arr.sort();if(arr[0]==a1){return desc?1:-1}return desc?-1:1});browser.showFiles(callBack,selected);browser.initFiles()};browser.humanSize=function(a){if(a<1024){a=a.toString()+" B"}else{if(a<1048576){a/=1024;a=parseInt(a).toString()+" KB"}else{if(a<1073741824){a/=1048576;a=parseInt(a).toString()+" MB"}else{if(a<1099511627776){a/=1073741824;a=parseInt(a).toString()+" GB"}else{a/=1099511627776;a=parseInt(a).toString()+" TB"}}}}return a};browser.baseGetData=function(a){var b="browse.php?type="+encodeURIComponent(this.type)+"&lng="+this.lang;if(a){b+="&act="+a}if(this.cms){b+="&cms="+this.cms}return b};browser.label=function(b,c){var a=this.labels[b]?this.labels[b]:b;if(c){$.each(c,function(d,e){a=a.replace("{"+d+"}",e)})}return a};browser.check4errors=function(a,c){if(!a.error){return false}var b;if(a.error.join){b=a.error.join("\n")}else{b=a.error}browser.alert(b,c);return true};browser.post=function(a,c){var b='
';$.each(c,function(d,e){if($.isArray(e)){$.each(e,function(g,f){b+=''})}else{b+=''}});b+="
";$("#dialog").html(b);$("#dialog").css("display","block");$("#postForm").get(0).submit()};browser.fadeFiles=function(){$("#files > div").css({opacity:"0.4",filter:"alpha(opacity:40)"})}; \ No newline at end of file diff --git a/cache/theme_oxygen.css b/cache/theme_oxygen.css index d5c74de..ea58b6e 100644 --- a/cache/theme_oxygen.css +++ b/cache/theme_oxygen.css @@ -1,566 +1 @@ -body { - background: #e0dfde; -} - -input { - margin: 0; -} - -input[type="radio"], input[type="checkbox"], label { - cursor: pointer; -} - -input[type="text"] { - border: 1px solid #d3d3d3; - background: #fff; - padding: 2px; - margin: 0; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - box-shadow: 0 -1px 0 rgba(0,0,0,0.5); - -moz-box-shadow: 0 -1px 0 rgba(0,0,0,0.5); - -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.5); - outline-width: 0; -} - -input[type="text"]:hover { - box-shadow: 0 -1px 0 rgba(0,0,0,0.2); - -moz-box-shadow: 0 -1px 0 rgba(0,0,0,0.2); - -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.2); -} - -input[type="text"]:focus { - border-color: #3687e2; - box-shadow: 0 0 3px rgba(54,135,226,1); - -moz-box-shadow: 0 0 3px rgba(54,135,226,1); - -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); -} - -input[type="button"], input[type="submit"], input[type="reset"], button { - outline-width: 0; - background: #edeceb; - border: 1px solid #fff; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - box-shadow: 0 1px 1px rgba(0,0,0,0.6); - -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.6); - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.6); - color: #222; -} - -input[type="button"]:hover, input[type="submit"]:hover, input[type="reset"]:hover, button:hover { - box-shadow: 0 0 1px rgba(0,0,0,0.6); - -moz-box-shadow: 0 0 1px rgba(0,0,0,0.6); - -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.6); -} - -input[type="button"]:focus, input[type="submit"]:focus, input[type="reset"]:focus, button:focus { - box-shadow: 0 0 5px rgba(54,135,226,1); - -moz-box-shadow: 0 0 5px rgba(54,135,226,1); - -webkit-box-shadow: 0 0 5px rgba(54,135,226,1); -} - -fieldset { - margin: 0 5px 5px 0px; - padding: 5px; - border: 1px solid #afadaa; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - cursor: default; -} - -fieldset td { - white-space: nowrap; -} - -legend { - margin: 0; - padding:0 3px; - font-weight: bold; -} - -#folders { - margin: 4px 4px 0 4px; - background: #f8f7f6; - border: 1px solid #adaba9; - border-radius: 6px; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; -} - -#files { - float: left; - margin: 0 4px 0 0; - background: #f8f7f6; - border: 1px solid #adaba9; - border-radius: 6px; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; -} - -#files.drag { - background: #ddebf8; -} - -#topic { - padding-left: 12px; -} - - -div.folder { - padding-top: 2px; - margin-top: 4px; - white-space: nowrap; -} - -div.folder a { - text-decoration: none; - cursor: default; - outline: none; - color: #000; -} - -span.folder { - padding: 2px 3px 2px 23px; - outline: none; - background: no-repeat 3px center; - cursor: pointer; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border: 1px solid transparent; -} - -span.brace { - width: 16px; - height: 16px; - outline: none; -} - -span.current { - background-image: url(img/tree/folder_current.png); - background-color: #5b9bda; - border-color: #2973bd; - color: #fff; -} - -span.regular { - background-image: url(img/tree/folder.png); - background-color: #f8f7f6; -} - -span.regular:hover, span.context { - background-color: #ddebf8; - border-color: #cee0f4; - color: #000; -} - -span.opened { - background-image: url(img/tree/minus.png); -} - -span.closed { - background-image: url(img/tree/plus.png); -} - -span.denied { - background-image: url(img/tree/denied.png); -} - -div.file { - padding: 4px; - margin: 3px; - border: 1px solid #aaa; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - background: #fff; -} - -div.file:hover { - background: #ddebf8; - border-color: #a7bed7; -} - -div.file .name { - margin-top: 4px; - font-weight: bold; - height: 16px; - overflow: hidden; -} - -div.file .time { - font-size: 10px; -} - -div.file .size { - font-size: 10px; -} - -#files div.selected, -#files div.selected:hover { - background-color: #5b9bda; - border-color: #2973bd; - color: #fff; -} - -tr.file > td { - padding: 3px 4px; - background-color: #f8f7f6 -} - -tr.file:hover > td { - background-color: #ddebf8; -} - -tr.selected > td, -tr.selected:hover > td { - background-color: #5b9bda; - color: #fff; -} - -#toolbar { - padding: 5px 0; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; -} - -#toolbar a { - color: #000; - padding: 4px 4px 4px 24px; - margin-right: 5px; - border: 1px solid transparent; - background: no-repeat 2px center; - outline: none; - display: block; - float: left; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; -} - -#toolbar a:hover, -#toolbar a.hover { - background-color: #cfcfcf; - border-color: #afadaa; - box-shadow: inset 0 0 3px rgba(175,173,170,1); - -moz-box-shadow: inset 0 0 3px rgba(175,173,170,1); - -webkit-box-shadow: inset 0 0 3px rgba(175,173,170,1); -} - -#toolbar a.selected { - background-color: #eeeeff; - border-color: #3687e2; - box-shadow: inset 0 0 3px rgba(54,135,226,1); - -moz-box-shadow: inset 0 0 3px rgba(54,135,226,1); - -webkit-box-shadow: inset 0 0 3px rgba(54,135,226,1); -} - -#toolbar a[href="kcact:upload"] { - background-image: url(img/icons/upload.png); -} - -#toolbar a[href="kcact:refresh"] { - background-image: url(img/icons/refresh.png); -} - -#toolbar a[href="kcact:settings"] { - background-image: url(img/icons/settings.png); -} - -#toolbar a[href="kcact:about"] { - background-image: url(img/icons/about.png); -} - -#toolbar a[href="kcact:maximize"] { - background-image: url(img/icons/maximize.png); -} - -#settings { - background: #e0dfde; -} - -.box, #loading, #alert { - padding: 5px; - border: 1px solid #3687e2; - background: #e0dfde; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -.box, #alert { - padding: 8px; - border-color: #fff; - -moz-box-shadow: 0 0 8px rgba(255,255,255,1); - -webkit-box-shadow: 0 0 8px rgba(255,255,255,1); - box-shadow: 0 0 8px rgba(255,255,255,1); -} - -#loading { - background-image: url(img/loading.gif); - font-weight: bold; - margin-right: 4px; - box-shadow: 0 0 3px rgba(54,135,226,1); - -moz-box-shadow: 0 0 3px rgba(54,135,226,1); - -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); -} - -#alert div.message, #dialog div.question { - padding: 0 0 0 40px; -} - -#alert { - background: #e0dfde url(img/alert.png) no-repeat 8px 29px; -} - -#dialog div.question { - background: #e0dfde url(img/confirm.png) no-repeat 0 0; -} - -#alert div.ok, #dialog div.buttons { - padding-top: 5px; - text-align: right; -} - -.menu { - padding: 2px; - border: 1px solid #acaaa7; - background: #e4e3e2; - opacity: 0.95; -} - -.menu a { - text-decoration: none; - padding: 3px 3px 3px 22px; - background: no-repeat 2px center; - color: #000; - margin: 0; - background-color: #e4e3e2; - outline: none; - border: 1px solid transparent; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; -} - -.menu .delimiter { - border-top: 1px solid #acaaa7; - padding-bottom: 3px; - margin: 3px 2px 0 2px; -} - -.menu a:hover { - background-color: #cfcfcf; - border-color: #afadaa; - box-shadow: inset 0 0 3px rgba(175,173,170,1); - -moz-box-shadow: inset 0 0 3px rgba(175,173,170,1); - -webkit-box-shadow: inset 0 0 3px rgba(175,173,170,1); -} - -.menu a[href="kcact:refresh"] { - background-image: url(img/icons/refresh.png); -} - -.menu a[href="kcact:mkdir"] { - background-image: url(img/icons/folder-new.png); -} - -.menu a[href="kcact:mvdir"], .menu a[href="kcact:mv"] { - background-image: url(img/icons/rename.png); -} - -.menu a[href="kcact:rmdir"], .menu a[href="kcact:rm"], .menu a[href="kcact:rmcbd"] { - background-image: url(img/icons/delete.png); -} - -.menu a[href="kcact:clpbrdadd"] { - background-image: url(img/icons/clipboard-add.png); -} - -.menu a[href="kcact:pick"], .menu a[href="kcact:pick_thumb"] { - background-image: url(img/icons/select.png); -} - -.menu a[href="kcact:download"] { - background-image: url(img/icons/download.png); -} - -.menu a[href="kcact:view"] { - background-image: url(img/icons/view.png); -} - -.menu a[href="kcact:cpcbd"] { - background-image: url(img/icons/copy.png); -} - -.menu a[href="kcact:mvcbd"] { - background-image: url(img/icons/move.png); -} - -.menu a[href="kcact:clrcbd"] { - background-image: url(img/icons/clipboard-clear.png); -} - -a.denied { - color: #666; - opacity: 0.5; - filter: alpha(opacity:50); - cursor: default; -} - -a.denied:hover { - background-color: #e4e3e2; - border-color: transparent; - box-shadow: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; -} - -#dialog { - -moz-box-shadow: 0 0 5px rgba(0,0,0,0.5); - -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.5); - box-shadow: 0 0 5px rgba(0,0,0,0.5); -} - -#dialog input[type="text"] { - margin: 5px 0; - width: 200px; -} - -#dialog div.slideshow { - border: 1px solid #000; - padding: 5px 5px 3px 5px; - background: #000; - -moz-box-shadow: 0 0 8px rgba(255,255,255,1); - -webkit-box-shadow: 0 0 8px rgba(255,255,255,1); - box-shadow: 0 0 8px rgba(255,255,255,1); -} - -#dialog img { - padding: 0; - margin: 0; - background: url(img/bg_transparent.png); -} - -#loadingDirs { - padding: 5px 0 1px 24px; -} - -.about { - text-align: center; -} - -.about div.head { - font-weight: bold; - font-size: 12px; - padding: 3px 0 8px 0; -} - -.about div.head a { - background: url(img/kcf_logo.png) no-repeat left center; - padding: 0 0 0 27px; - font-size: 17px; -} - -.about a { - text-decoration: none; - color: #0055ff; -} - -.about a:hover { - text-decoration: underline; -} - -.about button { - margin-top: 8px; -} - -#clipboard { - padding: 0 4px 1px 0; -} - -#clipboard div { - background: url(img/icons/clipboard.png) no-repeat center center; - border: 1px solid transparent; - padding: 1px; - cursor: pointer; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; -} - -#clipboard div:hover { - background-color: #bfbdbb; - border-color: #a9a59f; -} - -#clipboard.selected div, #clipboard.selected div:hover { - background-color: #c9c7c4; - border-color: #3687e2; -} - -#checkver { - padding-bottom: 8px; -} -#checkver > span { - padding: 2px; - border: 1px solid transparent; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -#checkver > span.loading { - background: url(img/loading.gif); - border: 1px solid #3687e2; - box-shadow: 0 0 3px rgba(54,135,226,1); - -moz-box-shadow: 0 0 3px rgba(54,135,226,1); - -webkit-box-shadow: 0 0 3px rgba(54,135,226,1); -} - -#checkver span { - padding: 3px; -} - -#checkver a { - font-weight: normal; - padding: 3px 3px 3px 20px; - background: url(img/icons/download.png) no-repeat left center; -} - -div.title { - overflow: auto; - text-align: center; - margin: -3px -5px 5px -5px; - padding-left: 19px; - padding-bottom: 2px; - border-bottom: 1px solid #bbb; - font-weight: bold; - cursor: move; -} - -.about div.title { - cursor: default; -} - -span.close, span.clicked { - float: right; - width: 19px; - height: 19px; - background: url(img/icons/close.png); - margin-top: -3px; - cursor: default; -} - -span.close:hover { - background: url(img/icons/close-hover.png); -} - -span.clicked:hover { - background: url(img/icons/close-clicked.png); -} \ No newline at end of file +body{background:#e0dfde}input{margin:0}input[type="radio"],input[type="checkbox"],label{cursor:pointer}input[type="text"]{border:1px solid #d3d3d3;background:#fff;padding:2px;margin:0;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;box-shadow:0 -1px 0 rgba(0,0,0,0.5);-moz-box-shadow:0 -1px 0 rgba(0,0,0,0.5);-webkit-box-shadow:0 -1px 0 rgba(0,0,0,0.5);outline-width:0}input[type="text"]:hover{box-shadow:0 -1px 0 rgba(0,0,0,0.2);-moz-box-shadow:0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow:0 -1px 0 rgba(0,0,0,0.2)}input[type="text"]:focus{border-color:#3687e2;box-shadow:0 0 3px rgba(54,135,226,1);-moz-box-shadow:0 0 3px rgba(54,135,226,1);-webkit-box-shadow:0 0 3px rgba(54,135,226,1)}input[type="button"],input[type="submit"],input[type="reset"],button{outline-width:0;background:#edeceb;border:1px solid #fff;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;box-shadow:0 1px 1px rgba(0,0,0,0.6);-moz-box-shadow:0 1px 1px rgba(0,0,0,0.6);-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.6);color:#222}input[type="button"]:hover,input[type="submit"]:hover,input[type="reset"]:hover,button:hover{box-shadow:0 0 1px rgba(0,0,0,0.6);-moz-box-shadow:0 0 1px rgba(0,0,0,0.6);-webkit-box-shadow:0 0 1px rgba(0,0,0,0.6)}input[type="button"]:focus,input[type="submit"]:focus,input[type="reset"]:focus,button:focus{box-shadow:0 0 5px rgba(54,135,226,1);-moz-box-shadow:0 0 5px rgba(54,135,226,1);-webkit-box-shadow:0 0 5px rgba(54,135,226,1)}fieldset{margin:0 5px 5px 0;padding:5px;border:1px solid #afadaa;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;cursor:default}fieldset td{white-space:nowrap}legend{margin:0;padding:0 3px;font-weight:bold}#folders{margin:4px 4px 0 4px;background:#f8f7f6;border:1px solid #adaba9;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px}#files{float:left;margin:0 4px 0 0;background:#f8f7f6;border:1px solid #adaba9;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px}#files.drag{background:#ddebf8}#topic{padding-left:12px}div.folder{padding-top:2px;margin-top:4px;white-space:nowrap}div.folder a{text-decoration:none;cursor:default;outline:0;color:#000}span.folder{padding:2px 3px 2px 23px;outline:0;background:no-repeat 3px center;cursor:pointer;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid transparent}span.brace{width:16px;height:16px;outline:0}span.current{background-image:url(img/tree/folder_current.png);background-color:#5b9bda;border-color:#2973bd;color:#fff}span.regular{background-image:url(img/tree/folder.png);background-color:#f8f7f6}span.regular:hover,span.context{background-color:#ddebf8;border-color:#cee0f4;color:#000}span.opened{background-image:url(img/tree/minus.png)}span.closed{background-image:url(img/tree/plus.png)}span.denied{background-image:url(img/tree/denied.png)}div.file{padding:4px;margin:3px;border:1px solid #aaa;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;background:#fff}div.file:hover{background:#ddebf8;border-color:#a7bed7}div.file .name{margin-top:4px;font-weight:bold;height:16px;overflow:hidden}div.file .time{font-size:10px}div.file .size{font-size:10px}#files div.selected,#files div.selected:hover{background-color:#5b9bda;border-color:#2973bd;color:#fff}tr.file>td{padding:3px 4px;background-color:#f8f7f6}tr.file:hover>td{background-color:#ddebf8}tr.selected>td,tr.selected:hover>td{background-color:#5b9bda;color:#fff}#toolbar{padding:5px 0;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px}#toolbar a{color:#000;padding:4px 4px 4px 24px;margin-right:5px;border:1px solid transparent;background:no-repeat 2px center;outline:0;display:block;float:left;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}#toolbar a:hover,#toolbar a.hover{background-color:#cfcfcf;border-color:#afadaa;box-shadow:inset 0 0 3px rgba(175,173,170,1);-moz-box-shadow:inset 0 0 3px rgba(175,173,170,1);-webkit-box-shadow:inset 0 0 3px rgba(175,173,170,1)}#toolbar a.selected{background-color:#eef;border-color:#3687e2;box-shadow:inset 0 0 3px rgba(54,135,226,1);-moz-box-shadow:inset 0 0 3px rgba(54,135,226,1);-webkit-box-shadow:inset 0 0 3px rgba(54,135,226,1)}#toolbar a[href="kcact:upload"]{background-image:url(img/icons/upload.png)}#toolbar a[href="kcact:refresh"]{background-image:url(img/icons/refresh.png)}#toolbar a[href="kcact:settings"]{background-image:url(img/icons/settings.png)}#toolbar a[href="kcact:about"]{background-image:url(img/icons/about.png)}#toolbar a[href="kcact:maximize"]{background-image:url(img/icons/maximize.png)}#settings{background:#e0dfde}.box,#loading,#alert{padding:5px;border:1px solid #3687e2;background:#e0dfde;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}.box,#alert{padding:8px;border-color:#fff;-moz-box-shadow:0 0 8px rgba(255,255,255,1);-webkit-box-shadow:0 0 8px rgba(255,255,255,1);box-shadow:0 0 8px rgba(255,255,255,1)}#loading{background-image:url(img/loading.gif);font-weight:bold;margin-right:4px;box-shadow:0 0 3px rgba(54,135,226,1);-moz-box-shadow:0 0 3px rgba(54,135,226,1);-webkit-box-shadow:0 0 3px rgba(54,135,226,1)}#alert div.message,#dialog div.question{padding:0 0 0 40px}#alert{background:#e0dfde url(img/alert.png) no-repeat 8px 29px}#dialog div.question{background:#e0dfde url(img/confirm.png) no-repeat 0 0}#alert div.ok,#dialog div.buttons{padding-top:5px;text-align:right}.menu{padding:2px;border:1px solid #acaaa7;background:#e4e3e2;opacity:.95}.menu a{text-decoration:none;padding:3px 3px 3px 22px;background:no-repeat 2px center;color:#000;margin:0;background-color:#e4e3e2;outline:0;border:1px solid transparent;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}.menu .delimiter{border-top:1px solid #acaaa7;padding-bottom:3px;margin:3px 2px 0 2px}.menu a:hover{background-color:#cfcfcf;border-color:#afadaa;box-shadow:inset 0 0 3px rgba(175,173,170,1);-moz-box-shadow:inset 0 0 3px rgba(175,173,170,1);-webkit-box-shadow:inset 0 0 3px rgba(175,173,170,1)}.menu a[href="kcact:refresh"]{background-image:url(img/icons/refresh.png)}.menu a[href="kcact:mkdir"]{background-image:url(img/icons/folder-new.png)}.menu a[href="kcact:mvdir"],.menu a[href="kcact:mv"]{background-image:url(img/icons/rename.png)}.menu a[href="kcact:rmdir"],.menu a[href="kcact:rm"],.menu a[href="kcact:rmcbd"]{background-image:url(img/icons/delete.png)}.menu a[href="kcact:clpbrdadd"]{background-image:url(img/icons/clipboard-add.png)}.menu a[href="kcact:pick"],.menu a[href="kcact:pick_thumb"]{background-image:url(img/icons/select.png)}.menu a[href="kcact:download"]{background-image:url(img/icons/download.png)}.menu a[href="kcact:view"]{background-image:url(img/icons/view.png)}.menu a[href="kcact:cpcbd"]{background-image:url(img/icons/copy.png)}.menu a[href="kcact:mvcbd"]{background-image:url(img/icons/move.png)}.menu a[href="kcact:clrcbd"]{background-image:url(img/icons/clipboard-clear.png)}a.denied{color:#666;opacity:.5;filter:alpha(opacity:50);cursor:default}a.denied:hover{background-color:#e4e3e2;border-color:transparent;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none}#dialog{-moz-box-shadow:0 0 5px rgba(0,0,0,0.5);-webkit-box-shadow:0 0 5px rgba(0,0,0,0.5);box-shadow:0 0 5px rgba(0,0,0,0.5)}#dialog input[type="text"]{margin:5px 0;width:200px}#dialog div.slideshow{border:1px solid #000;padding:5px 5px 3px 5px;background:#000;-moz-box-shadow:0 0 8px rgba(255,255,255,1);-webkit-box-shadow:0 0 8px rgba(255,255,255,1);box-shadow:0 0 8px rgba(255,255,255,1)}#dialog img{padding:0;margin:0;background:url(img/bg_transparent.png)}#loadingDirs{padding:5px 0 1px 24px}.about{text-align:center}.about div.head{font-weight:bold;font-size:12px;padding:3px 0 8px 0}.about div.head a{background:url(img/kcf_logo.png) no-repeat left center;padding:0 0 0 27px;font-size:17px}.about a{text-decoration:none;color:#05f}.about a:hover{text-decoration:underline}.about button{margin-top:8px}#clipboard{padding:0 4px 1px 0}#clipboard div{background:url(img/icons/clipboard.png) no-repeat center center;border:1px solid transparent;padding:1px;cursor:pointer;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}#clipboard div:hover{background-color:#bfbdbb;border-color:#a9a59f}#clipboard.selected div,#clipboard.selected div:hover{background-color:#c9c7c4;border-color:#3687e2}#checkver{padding-bottom:8px}#checkver>span{padding:2px;border:1px solid transparent;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}#checkver>span.loading{background:url(img/loading.gif);border:1px solid #3687e2;box-shadow:0 0 3px rgba(54,135,226,1);-moz-box-shadow:0 0 3px rgba(54,135,226,1);-webkit-box-shadow:0 0 3px rgba(54,135,226,1)}#checkver span{padding:3px}#checkver a{font-weight:normal;padding:3px 3px 3px 20px;background:url(img/icons/download.png) no-repeat left center}div.title{overflow:auto;text-align:center;margin:-3px -5px 5px -5px;padding-left:19px;padding-bottom:2px;border-bottom:1px solid #bbb;font-weight:bold;cursor:move}.about div.title{cursor:default}span.close,span.clicked{float:right;width:19px;height:19px;background:url(img/icons/close.png);margin-top:-3px;cursor:default}span.close:hover{background:url(img/icons/close-hover.png)}span.clicked:hover{background:url(img/icons/close-clicked.png)} \ No newline at end of file diff --git a/cache/theme_oxygen.js b/cache/theme_oxygen.js index ef325d0..1d6d5f9 100644 --- a/cache/theme_oxygen.js +++ b/cache/theme_oxygen.js @@ -1,3 +1 @@ -// If this file exists in theme directory, it will be loaded in section - -new Image().src = 'themes/oxygen/img/loading.gif'; // preload animated gif +new Image().src="themes/oxygen/img/loading.gif"; \ No newline at end of file diff --git a/js/040.browser.js b/js/040.browser.js deleted file mode 100644 index e69de29..0000000 From b056cc5ac3e2f24f64731a41d37a1a70e9500e64 Mon Sep 17 00:00:00 2001 From: sunhater Date: Tue, 18 Feb 2014 03:11:50 +0200 Subject: [PATCH 009/125] 3.0-dev update 3 some JS, jQuery UI & Uniform preparations --- cache/base.js | 42 +- js/000._jquery.js | 22 +- js/002._jqueryui.js | 7 + js/006.jquery.uniform.js | 1070 ++++++++++++++++++++++++++++++++++ js/010._jquery.drag.js | 6 - js/010.jquery.fixes.js | 55 ++ js/020._jquery.rightClick.js | 16 - js/020.jquery.rightClick.js | 25 + js/021.jquery.agent.js | 68 +++ js/030.helper.js | 411 ------------- js/030.jquery.helper.js | 222 +++++++ js/031.jquery.md5.js | 212 +++++++ js/050.init.js | 104 ++-- js/060.toolbar.js | 20 +- js/070.settings.js | 40 +- js/080.files.js | 41 +- js/090.folders.js | 20 +- js/100.clipboard.js | 6 +- js/110.dropUpload.js | 4 +- js/120.misc.js | 25 +- tpl/tpl_browser.php | 3 - tpl/tpl_javascript.php | 8 +- 22 files changed, 1804 insertions(+), 623 deletions(-) create mode 100644 js/002._jqueryui.js create mode 100644 js/006.jquery.uniform.js delete mode 100644 js/010._jquery.drag.js create mode 100644 js/010.jquery.fixes.js delete mode 100644 js/020._jquery.rightClick.js create mode 100644 js/020.jquery.rightClick.js create mode 100644 js/021.jquery.agent.js delete mode 100644 js/030.helper.js create mode 100644 js/030.jquery.helper.js create mode 100644 js/031.jquery.md5.js diff --git a/cache/base.js b/cache/base.js index 4d84915..7b8ef65 100644 --- a/cache/base.js +++ b/cache/base.js @@ -1,36 +1,6 @@ -/*! - * jQuery JavaScript Library v1.6.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu May 12 15:04:36 2011 -0400 - */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement){cl=(ck.contentWindow||ck.contentDocument).document,cl.write("")}b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,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=0===c})}function W(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic){break}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped()){break}}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return !0}function E(){return !1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a){if(b!=="toJSON"){return !1}}return !0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else{d=b}}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,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=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};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=n.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.6.1",length:0,size:function(){return this.length},toArray:function(){return D.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)?C.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(),y.done(a);return this},eq:function(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(D.apply(this,arguments),"slice",D.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:C,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(;j0){return}y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf")){return !1}var c;for(c in a){}return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m){l.style[q]=m[q]}l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent){for(q in {submit:1,change:1,focusin:1}){p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r}}return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b){return}l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c)}i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c]){return i[g]&&i[g].events}return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i]){return}if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j)){return}}}if(d){delete h[i][e];if(!l(h[i])){return}}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=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=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1){return !0}}return !1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d}return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0){return null}for(var h=g?c:0,i=g?c+1:e.length;h=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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2){return b}if(e&&c in f.attrFn){return f(a)[c](d)}if(!("getAttribute" in a)){return f.prop(a,c,d)}var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h}a.setAttribute(c,""+d);return d}if(i&&"get" in i&&j){return i.get(a,c)}h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.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}}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0: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=a.nodeType;if(!a||e===3||e===8||e===2){return b}var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?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]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button")){return v.get(a,b)}return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button")){return v.set(a,b,c)}a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},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.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)}})),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 x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=E}else{if(!d){return}}var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i){return}var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t){return}c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t){f.event.remove(a,h+c)}return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p){continue}if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e){c.preventDefault(),c.stopPropagation()}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8){return}c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e){return}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file"){return !1}for(var c in I){f.event.add(this,c+".specialChange",I[c])}return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e)}return this}if(arguments.length===2||d===!1){e=d,d=b}c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one"){this.one(a,d,e)}else{for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return f}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d)}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}}else{n=x=[]}}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n)}else{if(d&&d.nodeType===1){for(t=0;n[t]!=null;t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t])}}else{for(t=0;n[t]!=null;t++){n[t]&&n[t].nodeType===1&&f.push(j[t])}}}}else{p(n,f)}o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g){for(var b=1;b0},k.find=function(a,b,c){var d;if(!a){return[]}for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0])}a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c)}else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(l.match.POS.test(b[0])||l.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 !!k(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 bc[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=l.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||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=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f){return f(a,c,b,d)}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n))}var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.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:[]}},l.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&&(l.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.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f)}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return p([],f)}if(i.id===h[3]){return p([i],f)}}try{return p(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}}catch(s){}finally{n||m.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a)){try{if(e||!l.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 k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return !1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"")}a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0){for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k})}g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-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||typeof a=="string"){return f.inArray(this[0],a?f(a):this.parent().children())}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(W(c[0])||W(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),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};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
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},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){return this.each(function(){f(this).wrapAll(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(arguments[0]);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(arguments[0]).toArray());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){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null}if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h){bj(e[h],g[h])}}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h){bi(e[h],g[h])}}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!bb.test(k)){k=b.createTextNode(k)}else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.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;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView)){return b}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c))}return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT){return bT.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("
").append(c.replace(bO,"")).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||bP.test(this.nodeName)||bJ.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(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in {context:1,url:1}){c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c])}return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},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}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),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?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified")){f.lastModified[k]=x}if(y=v.getResponseHeader("Etag")){f.etag[k]=y}}if(a===304){c="notmodified",o=!0}else{try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}}else{u=c;if(!c||a){c="error",a<0&&(a=0)}}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),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._Deferred(),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=bI.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.done,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(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.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]!=="*"?", */*; 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=b$(bV,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){status<2?w(-1,z):f.error(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(bE,"+")}}),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=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";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),m.text=h.responseText;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,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cu("show",3),a,b,c)}for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1)}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i])}}e.complete.call(d)}return !1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null}g=cy(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);/*! - * jquery.event.drag - v 2.0.0 - * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com - * Open Source MIT License - http://threedubmedia.com/code/license - */ -(function(d){d.fn.drag=function(c,f,i){var h=typeof c=="string"?c:"",g=d.isFunction(c)?c:d.isFunction(f)?f:null;if(h.indexOf("drag")!==0){h="drag"+h}i=(c==g?f:i)||{};return g?this.bind(h,i,g):this.trigger(h)};var a=d.event,b=a.special,e=b.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",livekey:"livedrag",add:function(c){var f=d.data(this,e.datakey),g=c.data||{};f.related+=1;if(!f.live&&c.selector){f.live=true;a.add(this,"draginit."+e.livekey,e.delegate)}d.each(e.defaults,function(h){if(g[h]!==undefined){f[h]=g[h]}})},remove:function(){d.data(this,e.datakey).related-=1},setup:function(){if(!d.data(this,e.datakey)){var c=d.extend({related:0},e.defaults);d.data(this,e.datakey,c);a.add(this,"mousedown",e.init,c);this.attachEvent&&this.attachEvent("ondragstart",e.dontstart)}},teardown:function(){if(!d.data(this,e.datakey).related){d.removeData(this,e.datakey);a.remove(this,"mousedown",e.init);a.remove(this,"draginit",e.delegate);e.textselect(true);this.detachEvent&&this.detachEvent("ondragstart",e.dontstart)}},init:function(c){var f=c.data,g;if(!(f.which>0&&c.which!=f.which)){if(!d(c.target).is(f.not)){if(!(f.handle&&!d(c.target).closest(f.handle,c.currentTarget).length)){f.propagates=1;f.interactions=[e.interaction(this,f)];f.target=c.target;f.pageX=c.pageX;f.pageY=c.pageY;f.dragging=null;g=e.hijack(c,"draginit",f);if(f.propagates){if((g=e.flatten(g))&&g.length){f.interactions=[];d.each(g,function(){f.interactions.push(e.interaction(this,f))})}f.propagates=f.interactions.length;f.drop!==false&&b.drop&&b.drop.handler(c,f);e.textselect(false);a.add(document,"mousemove mouseup",e.handler,f);return false}}}}},interaction:function(c,f){return{drag:c,callback:new e.callback,droppable:[],offset:d(c)[f.relative?"position":"offset"]()||{top:0,left:0}}},handler:function(c){var f=c.data;switch(c.type){case !f.dragging&&"mousemove":if(Math.pow(c.pageX-f.pageX,2)+Math.pow(c.pageY-f.pageY,2)/g,">").replace(/\ /g," ")};_.jsValue=function(a){return a.replace(/\\/g,"\\\\").replace(/\r?\n/,"\\\n").replace(/\"/g,'\\"').replace(/\'/g,"\\'")};_.basename=function(b){var a=/^.*\/([^\/]+)\/?$/g;return a.test(b)?b.replace(a,"$1"):b};_.dirname=function(b){var a=/^(.*)\/[^\/]+\/?$/g;return a.test(b)?b.replace(a,"$1"):""};_.inArray=function(c,a){if((typeof a=="undefined")||!a.length||!a.push){return false}for(var b=0;b>>(32-a))};var J=function(k,b){var F,a,d,x,c;d=(k&2147483648);x=(b&2147483648);F=(k&1073741824);a=(b&1073741824);c=(k&1073741823)+(b&1073741823);if(F&a){return(c^2147483648^d^x)}if(F|a){return(c&1073741824)?(c^3221225472^d^x):(c^1073741824^d^x)}else{return(c^d^x)}};var r=function(a,c,b){return(a&c)|((~a)&b)};var q=function(a,c,b){return(a&b)|(c&(~b))};var p=function(a,c,b){return(a^c^b)};var n=function(a,c,b){return(c^(a|(~b)))};var u=function(G,F,Z,Y,k,H,I){G=J(G,J(J(r(F,Z,Y),k),I));return J(K(G,H),F)};var f=function(G,F,Z,Y,k,H,I){G=J(G,J(J(q(F,Z,Y),k),I));return J(K(G,H),F)};var D=function(G,F,Z,Y,k,H,I){G=J(G,J(J(p(F,Z,Y),k),I));return J(K(G,H),F)};var t=function(G,F,Z,Y,k,H,I){G=J(G,J(J(n(F,Z,Y),k),I));return J(K(G,H),F)};var e=function(k){var G;var d=k.length;var c=d+8;var b=(c-(c%64))/64;var F=(b+1)*16;var H=[F-1];var a=0;var x=0;while(x>>29;return H};var B=function(c){var b="",d="",k,a;for(a=0;a<=3;a++){k=(c>>>(a*8))&255;d="0"+k.toString(16);b=b+d.substr(d.length-2,2)}return b};var C=[];var O,h,E,v,g,X,W,V,U;var R=7,P=12,M=17,L=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var T=6,S=10,Q=15,N=21;s=_.utf8encode(s);C=e(s);X=1732584193;W=4023233417;V=2562383102;U=271733878;for(O=0;O127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a};var browser={opener:{},support:{},files:[],clipboard:[],labels:[],shows:[],orders:[],cms:""};browser.init=function(){if(!this.checkAgent()){return}$("body").click(function(){browser.hideDialog()});$("#shadow").click(function(){return false});$("#dialog").unbind();$("#dialog").click(function(){return false});$("#alert").unbind();$("#alert").click(function(){return false});this.initOpeners();this.initSettings();this.initContent();this.initToolbar();this.initResizer();this.initDropUpload()};browser.checkAgent=function(){if(!$.browser.version||($.browser.msie&&(parseInt($.browser.version)<7)&&!this.support.chromeFrame)||($.browser.opera&&(parseInt($.browser.version)<10))||($.browser.mozilla&&(parseFloat($.browser.version.replace(/^(\d+(\.\d+)?)([^\d].*)?$/,"$1"))<1.8))){var a='
Your browser is not capable to display KCFinder. Please update your browser or install another one: Mozilla Firefox, Apple Safari, Google Chrome, Opera.';if($.browser.msie){a+=' You may also install Google Chrome Frame ActiveX plugin to get Internet Explorer 6 working.'}a+="
";$("body").html(a);return false}return true};browser.initOpeners=function(){if(this.opener.TinyMCE&&(typeof(tinyMCEPopup)=="undefined")){this.opener.TinyMCE=null}if(this.opener.TinyMCE){this.opener.callBack=true}if((!this.opener.name||(this.opener.name=="fckeditor"))&&window.opener&&window.opener.SetUrl){this.opener.FCKeditor=true;this.opener.callBack=true}if(this.opener.CKEditor){if(window.parent&&window.parent.CKEDITOR){this.opener.CKEditor.object=window.parent.CKEDITOR}else{if(window.opener&&window.opener.CKEDITOR){this.opener.CKEditor.object=window.opener.CKEDITOR;this.opener.callBack=true}else{this.opener.CKEditor=null}}}if(!this.opener.CKEditor&&!this.opener.FCKEditor&&!this.TinyMCE){if((window.opener&&window.opener.KCFinder&&window.opener.KCFinder.callBack)||(window.parent&&window.parent.KCFinder&&window.parent.KCFinder.callBack)){this.opener.callBack=window.opener?window.opener.KCFinder.callBack:window.parent.KCFinder.callBack}if((window.opener&&window.opener.KCFinder&&window.opener.KCFinder.callBackMultiple)||(window.parent&&window.parent.KCFinder&&window.parent.KCFinder.callBackMultiple)){this.opener.callBackMultiple=window.opener?window.opener.KCFinder.callBackMultiple:window.parent.KCFinder.callBackMultiple}}};browser.initContent=function(){$("div#folders").html(this.label("Loading folders..."));$("div#files").html(this.label("Loading files..."));$.ajax({type:"GET",dataType:"json",url:browser.baseGetData("init"),async:false,success:function(a){if(browser.check4errors(a)){return}browser.dirWritable=a.dirWritable;$("#folders").html(browser.buildTree(a.tree));browser.setTreeData(a.tree);browser.initFolders();browser.files=a.files?a.files:[];browser.orderFiles()},error:function(){$("div#folders").html(browser.label("Unknown error."));$("div#files").html(browser.label("Unknown error."))}})};browser.initResizer=function(){var b=($.browser.opera)?"move":"col-resize";$("#resizer").css("cursor",b);$("#resizer").drag("start",function(){$(this).css({opacity:"0.4",filter:"alpha(opacity:40)"});$("#all").css("cursor",b)});$("#resizer").drag(function(d){var c=d.pageX-parseInt(_.nopx($(this).css("width"))/2);c=(c>=0)?c:0;c=(c+_.nopx($(this).css("width"))<$(window).width())?c:$(window).width()-_.nopx($(this).css("width"));$(this).css("left",c)});var a=function(){$(this).css({opacity:"0",filter:"alpha(opacity:0)"});$("#all").css("cursor","");var d=_.nopx($(this).css("left"))+_.nopx($(this).css("width"));var c=$(window).width()-d;$("#left").css("width",d+"px");$("#right").css("width",c+"px");_("files").style.width=$("#right").innerWidth()-_.outerHSpace("#files")+"px";_("resizer").style.left=$("#left").outerWidth()-_.outerRightSpace("#folders","m")+"px";_("resizer").style.width=_.outerRightSpace("#folders","m")+_.outerLeftSpace("#files","m")+"px";browser.fixFilesHeight()};$("#resizer").drag("end",a);$("#resizer").mouseup(a)};browser.resize=function(){_("left").style.width="25%";_("right").style.width="75%";_("toolbar").style.height=$("#toolbar a").outerHeight()+"px";_("shadow").style.width=$(window).width()+"px";_("shadow").style.height=_("resizer").style.height=$(window).height()+"px";_("left").style.height=_("right").style.height=$(window).height()-$("#status").outerHeight()+"px";_("folders").style.height=$("#left").outerHeight()-_.outerVSpace("#folders")+"px";browser.fixFilesHeight();var a=$("#left").outerWidth()+$("#right").outerWidth();_("status").style.width=a+"px";while($("#status").outerWidth()>a){_("status").style.width=_.nopx(_("status").style.width)-1+"px"}while($("#status").outerWidth()";if(browser.support.check4Update){a+='
'+browser.label("Checking for new version...")+"
"}a+="
"+browser.label("Licenses:")+" GPLv2 & LGPLv2
Copyright ©2010-2014 Pavel Tzonkov
";$("#dialog").html(a);$("#dialog").data("title",browser.label("About"));browser.showDialog();var c=function(){browser.hideDialog();browser.unshadow()};$("#dialog button").click(c);var b=$("#checkver > span");setTimeout(function(){$.ajax({dataType:"json",url:browser.baseGetData("check4Update"),async:true,success:function(d){if(!$("#dialog").html().length){return}b.removeClass("loading");if(!d.version){b.html(browser.label("Unable to connect!"));browser.showDialog();return}if(browser.version'+browser.label("Download version {version} now!",{version:d.version})+"")}else{b.html(browser.label("KCFinder is up to date!"))}browser.showDialog()},error:function(){if(!$("#dialog").html().length){return}b.removeClass("loading");b.html(browser.label("Unable to connect!"));browser.showDialog()}})},1000);$("#dialog").unbind();return false});this.initUploadButton()};browser.initUploadButton=function(){var b=$('#toolbar a[href="kcact:upload"]');if(!this.access.files.upload){b.css("display","none");return}var d=b.get(0).offsetTop;var c=b.outerWidth();var a=b.outerHeight();$("#toolbar").prepend('
');$("#upload input").css("margin-left","-"+($("#upload input").outerWidth()-c)+"px");$("#upload").mouseover(function(){$('#toolbar a[href="kcact:upload"]').addClass("hover")});$("#upload").mouseout(function(){$('#toolbar a[href="kcact:upload"]').removeClass("hover")})};browser.uploadFile=function(a){if(!this.dirWritable){browser.alert(this.label("Cannot write to upload folder."));$("#upload").detach();browser.initUploadButton();return}a.elements[1].value=browser.dir;$('').prependTo(document.body);$("#loading").html(this.label("Uploading file..."));$("#loading").css("display","inline");a.submit();$("#uploadResponse").load(function(){var b=$(this).contents().find("body").html();$("#loading").css("display","none");b=b.split("\n");var c=[],d=[];$.each(b,function(e,f){if(f.substr(0,1)=="/"){c[c.length]=f.substr(1,f.length-1)}else{d[d.length]=f}});if(d.length){browser.alert(d.join("\n"))}if(!c.length){c=null}browser.refresh(c);$("#upload").detach();setTimeout(function(){$("#uploadResponse").detach()},1);browser.initUploadButton()})};browser.maximize=function(f){if(window.opener){window.moveTo(0,0);b=screen.availWidth;i=screen.availHeight;if($.browser.opera){i-=50}window.resizeTo(b,i)}else{if(browser.opener.TinyMCE){var g,d,a;$("iframe",window.parent.document).each(function(){if(/^mce_\d+_ifr$/.test($(this).attr("id"))){a=parseInt($(this).attr("id").replace(/^mce_(\d+)_ifr$/,"$1"));g=$("#mce_"+a,window.parent.document);d=$("#mce_"+a+"_ifr",window.parent.document)}});if($(f).hasClass("selected")){$(f).removeClass("selected");g.css({left:browser.maximizeMCE.left+"px",top:browser.maximizeMCE.top+"px",width:browser.maximizeMCE.width+"px",height:browser.maximizeMCE.height+"px"});d.css({width:browser.maximizeMCE.width-browser.maximizeMCE.Hspace+"px",height:browser.maximizeMCE.height-browser.maximizeMCE.Vspace+"px"})}else{$(f).addClass("selected");browser.maximizeMCE={width:_.nopx(g.css("width")),height:_.nopx(g.css("height")),left:g.position().left,top:g.position().top,Hspace:_.nopx(g.css("width"))-_.nopx(d.css("width")),Vspace:_.nopx(g.css("height"))-_.nopx(d.css("height"))};var b=$(window.parent).width();var i=$(window.parent).height();g.css({left:$(window.parent).scrollLeft()+"px",top:$(window.parent).scrollTop()+"px",width:b+"px",height:i+"px"});d.css({width:b-browser.maximizeMCE.Hspace+"px",height:i-browser.maximizeMCE.Vspace+"px"})}}else{if($("iframe",window.parent.document).get(0)){var e=$('iframe[name="'+window.name+'"]',window.parent.document);var h=e.parent();var b,i;if($(f).hasClass("selected")){$(f).removeClass("selected");if(browser.maximizeThread){clearInterval(browser.maximizeThread);browser.maximizeThread=null}if(browser.maximizeW){browser.maximizeW=null}if(browser.maximizeH){browser.maximizeH=null}$.each($("*",window.parent.document).get(),function(j,k){k.style.display=browser.maximizeDisplay[j]});e.css({display:browser.maximizeCSS.display,position:browser.maximizeCSS.position,left:browser.maximizeCSS.left,top:browser.maximizeCSS.top,width:browser.maximizeCSS.width,height:browser.maximizeCSS.height});$(window.parent).scrollLeft(browser.maximizeLest);$(window.parent).scrollTop(browser.maximizeTop)}else{$(f).addClass("selected");browser.maximizeCSS={display:e.css("display"),position:e.css("position"),left:e.css("left"),top:e.css("top"),width:e.outerWidth()+"px",height:e.outerHeight()+"px"};browser.maximizeTop=$(window.parent).scrollTop();browser.maximizeLeft=$(window.parent).scrollLeft();browser.maximizeDisplay=[];$.each($("*",window.parent.document).get(),function(j,k){browser.maximizeDisplay[j]=$(k).css("display");$(k).css("display","none")});e.css("display","block");e.parents().css("display","block");var c=function(){b=$(window.parent).width();i=$(window.parent).height();if(!browser.maximizeW||(browser.maximizeW!=b)||!browser.maximizeH||(browser.maximizeH!=i)){browser.maximizeW=b;browser.maximizeH=i;e.css({width:b+"px",height:i+"px"});browser.resize()}};e.css("position","absolute");if((e.offset().left==e.position().left)&&(e.offset().top==e.position().top)){e.css({left:"0",top:"0"})}else{e.css({left:-e.offset().left+"px",top:-e.offset().top+"px"})}c();browser.maximizeThread=setInterval(c,250)}}}}};browser.refresh=function(a){this.fadeFiles();$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:browser.dir},async:false,success:function(b){if(browser.check4errors(b)){return}browser.dirWritable=b.dirWritable;browser.files=b.files?b.files:[];browser.orderFiles(null,a);browser.statusDir()},error:function(){$("#files > div").css({opacity:"",filter:""});$("#files").html(browser.label("Unknown error."))}})};browser.initSettings=function(){if(!this.shows.length){var d=$('#show input[type="checkbox"]').toArray();$.each(d,function(f,e){browser.shows[f]=e.name})}var a=this.shows;if(!_.kuki.isSet("showname")){_.kuki.set("showname","on");$.each(a,function(e,f){if(f!="name"){_.kuki.set("show"+f,"off")}})}$('#show input[type="checkbox"]').click(function(){var e=$(this).get(0).checked?"on":"off";_.kuki.set("show"+$(this).get(0).name,e);if($(this).get(0).checked){$("#files .file div."+$(this).get(0).name).css("display","block")}else{$("#files .file div."+$(this).get(0).name).css("display","none")}});$.each(a,function(e,g){var f=(_.kuki.get("show"+g)=="on")?"checked":"";$('#show input[name="'+g+'"]').get(0).checked=f});if(!this.orders.length){var c=$('#order input[type="radio"]').toArray();$.each(c,function(f,e){browser.orders[f]=e.value})}var b=this.orders;if(!_.kuki.isSet("order")){_.kuki.set("order","name")}if(!_.kuki.isSet("orderDesc")){_.kuki.set("orderDesc","off")}$('#order input[value="'+_.kuki.get("order")+'"]').get(0).checked=true;$('#order input[name="desc"]').get(0).checked=(_.kuki.get("orderDesc")=="on");$('#order input[type="radio"]').click(function(){_.kuki.set("order",$(this).get(0).value);browser.orderFiles()});$('#order input[name="desc"]').click(function(){_.kuki.set("orderDesc",$(this).get(0).checked?"on":"off");browser.orderFiles()});if(!_.kuki.isSet("view")){_.kuki.set("view","thumbs")}if(_.kuki.get("view")=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}$('#view input[value="'+_.kuki.get("view")+'"]').get(0).checked=true;$("#view input").click(function(){var e=$(this).attr("value");if(_.kuki.get("view")!=e){_.kuki.set("view",e);if(e=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}else{$.each(browser.shows,function(f,g){$('#show input[name="'+g+'"]').get(0).checked=(_.kuki.get("show"+g)=="on")});$("#show input").each(function(){this.disabled=false})}}browser.refresh()})};browser.initFiles=function(){$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});$("#files").unbind();$("#files").scroll(function(){browser.hideDialog()});$(".file").unbind();$(".file").click(function(a){_.unselect();browser.selectFile($(this),a)});$(".file").rightClick(function(a){_.unselect();browser.menuFile($(this),a)});$(".file").dblclick(function(){_.unselect();browser.returnFile($(this))});$(".file").mouseup(function(){_.unselect()});$(".file").mouseout(function(){_.unselect()});$.each(this.shows,function(a,c){var b=(_.kuki.get("show"+c)=="off")?"none":"block";$("#files .file div."+c).css("display",b)});this.statusDir()};browser.showFiles=function(b,a){this.fadeFiles();setTimeout(function(){var c="";$.each(browser.files,function(f,e){var d=[];$.each(e,function(h,j){d[d.length]=h+"|"+j});d=_.md5(d.join("|"));if(_.kuki.get("view")=="list"){if(!f){c+=''}var g=_.getFileExtension(e.name);if(e.thumb){g=".image"}else{if(!g.length||!e.smallIcon){g="."}}g="themes/"+browser.theme+"/img/files/small/"+g+".png";c+='";if(f==browser.files.length-1){c+="
'+_.htmlData(e.name)+''+e.date+''+browser.humanSize(e.size)+"
"}}else{if(e.thumb){var g=browser.baseGetData("thumb")+"&file="+encodeURIComponent(e.name)+"&dir="+encodeURIComponent(browser.dir)+"&stamp="+d}else{if(e.smallThumb){var g=browser.uploadURL+"/"+browser.dir+"/"+e.name;g=_.escapeDirs(g).replace(/\'/g,"%27")}else{var g=e.bigIcon?_.getFileExtension(e.name):".";if(!g.length){g="."}g="themes/"+browser.theme+"/img/files/big/"+g+".png"}}c+='
'+_.htmlData(e.name)+'
'+e.date+'
'+browser.humanSize(e.size)+"
"}});$("#files").html("
"+c+"
");$.each(browser.files,function(e,d){var f=$("#files .file").get(e);$(f).data(d);if(_.inArray(d.name,a)||((typeof a!="undefined")&&!a.push&&(d.name==a))){$(f).addClass("selected")}});$("#files > div").css({opacity:"",filter:""});if(b){b()}browser.initFiles()},200)};browser.selectFile=function(b,f){if(f.ctrlKey||f.metaKey){if(b.hasClass("selected")){b.removeClass("selected")}else{b.addClass("selected")}var c=$(".file.selected").get();var a=0;if(!c.length){this.statusDir()}else{$.each(c,function(g,e){a+=parseInt($(e).data("size"))});a=this.humanSize(a);if(c.length>1){$("#fileinfo").html(c.length+" "+this.label("selected files")+" ("+a+")")}else{var d=$(c[0]).data();$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}}}else{var d=b.data();$(".file").removeClass("selected");b.addClass("selected");$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}};browser.selectAll=function(c){if((!c.ctrlKey&&!c.metaKey)||((c.keyCode!=65)&&(c.keyCode!=97))){return false}var b=$(".file").get();if(b.length){var a=0;$.each(b,function(e,d){if(!$(d).hasClass("selected")){$(d).addClass("selected")}a+=parseInt($(d).data("size"))});a=this.humanSize(a);$("#fileinfo").html(b.length+" "+this.label("selected files")+" ("+a+")")}return true};browser.returnFile=function(c){var a=c.substr?c:browser.uploadURL+"/"+browser.dir+"/"+c.data("name");a=_.escapeDirs(a);if(this.opener.CKEditor){this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum,a,"");window.close()}else{if(this.opener.FCKeditor){window.opener.SetUrl(a);window.close()}else{if(this.opener.TinyMCE){var d=tinyMCEPopup.getWindowArg("window");d.document.getElementById(tinyMCEPopup.getWindowArg("input")).value=a;if(d.getImageData){d.getImageData()}if(typeof(d.ImageDialog)!="undefined"){if(d.ImageDialog.getImageData){d.ImageDialog.getImageData()}if(d.ImageDialog.showPreviewImage){d.ImageDialog.showPreviewImage(a)}}tinyMCEPopup.close()}else{if(this.opener.callBack){if(window.opener&&window.opener.KCFinder){this.opener.callBack(a);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBack(a)}}else{if(this.opener.callBackMultiple){if(window.opener&&window.opener.KCFinder){this.opener.callBackMultiple([a]);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBackMultiple([a])}}}}}}};browser.returnFiles=function(b){if(this.opener.callBackMultiple&&b.length){var a=[];$.each(b,function(d,c){a[d]=browser.uploadURL+"/"+browser.dir+"/"+$(c).data("name");a[d]=_.escapeDirs(a[d])});this.opener.callBackMultiple(a);if(window.opener){window.close()}}};browser.returnThumbnails=function(c){if(this.opener.callBackMultiple){var b=[];var a=0;$.each(c,function(e,d){if($(d).data("thumb")){b[a]=browser.thumbsURL+"/"+browser.dir+"/"+$(d).data("name");b[a]=_.escapeDirs(b[a++])}});this.opener.callBackMultiple(b);if(window.opener){window.close()}}};browser.menuFile=function(c,h){var f=c.data();var k=this.dir+"/"+f.name;var b=$(".file.selected").get();var g="";if(c.hasClass("selected")&&b.length&&(b.length>1)){var a=false;var d=0;var j;$.each(b,function(l,e){j=$(e).data();if(j.thumb){a=true}if(!f.writable){d++}});if(this.opener.callBackMultiple){g+=''+this.label("Select")+"";if(a){g+=''+this.label("Select Thumbnails")+""}}if(f.thumb||f.smallThumb||this.support.zip){g+=(g.length?'
':"");if(f.thumb||f.smallThumb){g+=''+this.label("View")+""}if(this.support.zip){g+=(g.length?'
':"")+''+this.label("Download")+""}}if(this.access.files.copy||this.access.files.move){g+=(g.length?'
':"")+''+this.label("Add to Clipboard")+""}if(this.access.files["delete"]){g+=(g.length?'
':"")+'"+this.label("Delete")+""}if(g.length){g='";$("#dialog").html(g);this.showMenu(h)}else{return}$('.menu a[href="kcact:pick"]').click(function(){browser.returnFiles(b);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){browser.returnThumbnails(b);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();var e=[];$.each(b,function(m,l){e[m]=$(l).data("name")});browser.post(browser.baseGetData("downloadSelected"),{dir:browser.dir,files:e});return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){browser.hideDialog();var e="";$.each(b,function(n,m){var o=$(m).data();var l=false;for(n=0;n div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(e){browser.confirm(browser.label("{count} selected files are not removable. Do you want to delete the rest?",{count:e}),l)}else{browser.confirm(browser.label("Are you sure you want to delete all selected files?"),l)}return false})}else{g+='";$("#dialog").html(g);this.showMenu(h);$('.menu a[href="kcact:pick"]').click(function(){browser.returnFile(c);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){var e=browser.thumbsURL+"/"+browser.dir+"/"+f.name;browser.returnFile(e);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){var e='
';$("#dialog").html(e);$("#downloadForm input").get(0).value=browser.dir;$("#downloadForm input").get(1).value=f.name;$("#downloadForm").submit();return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){for(i=0;i
');$("#dialog img").attr({src:url,title:n.name}).fadeIn("fast",function(){var q=$("#dialog").outerWidth();var s=$("#dialog").outerHeight();var r=$(window).width()-30;var t=$(window).height()-30;if((q>r)||(s>t)){if((r/t)>(q/s)){r=parseInt((q*t)/s)}else{if((r/t)<(q/s)){t=parseInt((s*r)/q)}}$("#dialog img").attr({width:r,height:t})}$("#dialog").unbind("click");$("#dialog").click(function(u){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(v){return !browser.selectAll(v)});if(browser.ssImage){browser.selectFile($(browser.ssImage),u)}});browser.showDialog();var p=[];$.each(browser.files,function(v,u){if(u.thumb||u.smallThumb){p[p.length]=u}});if(p.length){$.each(p,function(u,v){if(v.name==n.name){$(document).unbind("keydown");$(document).keydown(function(x){if(p.length>1){if(!browser.lock&&(x.keyCode==37)){var w=u?p[u-1]:p[p.length-1];browser.lock=true;e(w)}if(!browser.lock&&(x.keyCode==39)){var w=(u>=p.length-1)?p[0]:p[u+1];browser.lock=true;e(w)}}if(x.keyCode==27){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(y){return !browser.selectAll(y)})}})}})}})};if(m.complete){o()}else{m.onload=o}};e(f);return false})};browser.initFolders=function(){$("#folders").scroll(function(){browser.hideDialog()});$("div.folder > a").unbind();$("div.folder > a").bind("click",function(){browser.hideDialog();return false});$("div.folder > a > span.brace").unbind();$("div.folder > a > span.brace").click(function(){if($(this).hasClass("opened")||$(this).hasClass("closed")){browser.expandDir($(this).parent())}});$("div.folder > a > span.folder").unbind();$("div.folder > a > span.folder").click(function(){browser.changeDir($(this).parent())});$("div.folder > a > span.folder").rightClick(function(d){_.unselect();browser.menuDir($(this).parent(),d)});if($.browser.msie&&$.browser.version&&(parseInt($.browser.version.substr(0,1))<8)){var b=$("div.folder").get();var a=$("body").get(0);var c;$.each(b,function(d,e){c=document.createElement("div");c.style.display="inline";c.style.margin=c.style.border=c.style.padding="0";c.innerHTML='
'+$(e).html()+"
";a.appendChild(c);$(e).css("width",$(c).innerWidth()+"px");a.removeChild(c)})}};browser.setTreeData=function(b,c){if(!c){c=""}else{if(c.length&&(c.substr(c.length-1,1)!="/")){c+="/"}}c+=b.name;var a='#folders a[href="kcdir:/'+_.escapeDirs(c)+'"]';$(a).data({name:b.name,path:c,readable:b.readable,writable:b.writable,removable:b.removable,hasDirs:b.hasDirs});$(a+" span.folder").addClass(b.current?"current":"regular");if(b.dirs&&b.dirs.length){$(a+" span.brace").addClass("opened");$.each(b.dirs,function(e,d){browser.setTreeData(d,c+"/")})}else{if(b.hasDirs){$(a+" span.brace").addClass("closed")}}};browser.buildTree=function(a,d){if(!d){d=""}d+=a.name;var c='
 '+_.htmlData(a.name)+"";if(a.dirs){c+='
';for(var b=0;b'+this.label("Loading folders...")+"
");$("#loadingDirs").css("display","none");$("#loadingDirs").show(200,function(){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("expand"),data:{dir:b},async:false,success:function(e){$("#loadingDirs").hide(200,function(){$("#loadingDirs").detach()});if(browser.check4errors(e)){return}var d="";$.each(e.dirs,function(g,f){d+='"});if(d.length){a.parent().append('
'+d+"
");var c=$(a.parent().children(".folders").first());c.css("display","none");$(c).show(500);$.each(e.dirs,function(g,f){browser.setTreeData(f,b)})}if(e.dirs.length){a.children(".brace").removeClass("closed");a.children(".brace").addClass("opened")}else{a.children(".brace").removeClass("opened");a.children(".brace").removeClass("closed")}browser.initFolders();browser.initDropUpload()},error:function(){$("#loadingDirs").detach();browser.alert(browser.label("Unknown error."))}})})}}}};browser.changeDir=function(a){if(a.children("span.folder").hasClass("regular")){$("div.folder > a > span.folder").removeClass("current");$("div.folder > a > span.folder").removeClass("regular");$("div.folder > a > span.folder").addClass("regular");a.children("span.folder").removeClass("regular");a.children("span.folder").addClass("current");$("#files").html(browser.label("Loading files..."));$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:a.data("path")},async:false,success:function(b){if(browser.check4errors(b)){return}browser.files=b.files;browser.orderFiles();browser.dir=a.data("path");browser.dirWritable=b.dirWritable;var c="KCFinder: /"+browser.dir;document.title=c;if(browser.opener.TinyMCE){tinyMCEPopup.editor.windowManager.setTitle(window,c)}browser.statusDir()},error:function(){$("#files").html(browser.label("Unknown error."))}})}};browser.statusDir=function(){for(var b=0,a=0;b"+this.label("Copy {count} files",{count:this.clipboard.length})+""}if(this.access.files.move){b+='"+this.label("Move {count} files",{count:this.clipboard.length})+""}if(this.access.files.copy||this.access.files.move){b+='
'}}b+=''+this.label("Refresh")+"";if(this.support.zip){b+='
'+this.label("Download")+""}if(this.access.dirs.create||this.access.dirs.rename||this.access.dirs["delete"]){b+='
'}if(this.access.dirs.create){b+='"+this.label("New Subfolder...")+""}if(this.access.dirs.rename){b+='"+this.label("Rename...")+""}if(this.access.dirs["delete"]){b+='"+this.label("Delete")+""}b+="
";$("#dialog").html(b);this.showMenu(d);$("div.folder > a > span.folder").removeClass("context");if(a.children("span.folder").hasClass("regular")){a.children("span.folder").addClass("context")}if(this.clipboard&&this.clipboard.length&&c.writable){$('.menu a[href="kcact:cpcbd"]').click(function(){browser.hideDialog();browser.copyClipboard(c.path);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){browser.hideDialog();browser.moveClipboard(c.path);return false})}$('.menu a[href="kcact:refresh"]').click(function(){browser.hideDialog();browser.refreshDir(a);return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.post(browser.baseGetData("downloadDir"),{dir:c.path});return false});$('.menu a[href="kcact:mkdir"]').click(function(f){if(!c.writable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newDir","",browser.baseGetData("newDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(){browser.refreshDir(a);browser.initDropUpload();if(!c.hasDirs){a.data("hasDirs",true);a.children("span.brace").addClass("closed")}});return false});$('.menu a[href="kcact:mvdir"]').click(function(f){if(!c.removable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newName",c.name,browser.baseGetData("renameDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(e){if(!e.name){browser.alert(browser.label("Unknown error."));return}var g=(c.path==browser.dir);a.children("span.folder").html(_.htmlData(e.name));a.data("name",e.name);a.data("path",_.dirname(c.path)+"/"+e.name);if(g){browser.dir=a.data("path")}browser.initDropUpload()},true);return false});$('.menu a[href="kcact:rmdir"]').click(function(){if(!c.removable){return false}browser.hideDialog();browser.confirm("Are you sure you want to delete this folder and all its content?",function(e){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("deleteDir"),data:{dir:c.path},async:false,success:function(f){if(e){e()}if(browser.check4errors(f)){return}a.parent().hide(500,function(){var h=a.parent().parent();var g=h.parent().children("a").first();a.parent().detach();if(!h.children("div.folder").get(0)){g.children("span.brace").first().removeClass("opened");g.children("span.brace").first().removeClass("closed");g.parent().children(".folders").detach();g.data("hasDirs",false)}if(g.data("path")==browser.dir.substr(0,g.data("path").length)){browser.changeDir(g)}browser.initDropUpload()})},error:function(){if(e){e()}browser.alert(browser.label("Unknown error."))}})});return false})};browser.refreshDir=function(a){var b=a.data("path");if(a.children(".brace").hasClass("opened")||a.children(".brace").hasClass("closed")){a.children(".brace").removeClass("opened");a.children(".brace").addClass("closed")}a.parent().children(".folders").first().detach();if(b==browser.dir.substr(0,b.length)){browser.changeDir(a)}browser.expandDir(a);return true};browser.initClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var b=0;$.each(this.clipboard,function(c,d){b+=parseInt(d.size)});b=this.humanSize(b);$("#clipboard").html('
');var a=function(){$("#clipboard").css({left:$(window).width()-$("#clipboard").outerWidth()+"px",top:$(window).height()-$("#clipboard").outerHeight()+"px"})};a();$("#clipboard").css("display","block");$(window).unbind();$(window).resize(function(){browser.resize();a()})};browser.openClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}if($('.menu a[href="kcact:cpcbd"]').html()){$("#clipboard").removeClass("selected");this.hideDialog();return}var a='";setTimeout(function(){$("#clipboard").addClass("selected");$("#dialog").html(a);$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.downloadClipboard();return false});$('.menu a[href="kcact:cpcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.copyClipboard(browser.dir);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.moveClipboard(browser.dir);return false});$('.menu a[href="kcact:rmcbd"]').click(function(){browser.hideDialog();browser.confirm(browser.label("Are you sure you want to delete all files in the Clipboard?"),function(e){if(e){e()}browser.deleteClipboard()});return false});$('.menu a[href="kcact:clrcbd"]').click(function(){browser.hideDialog();browser.clearClipboard();return false});var c=$(window).width()-$("#dialog").outerWidth();var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();var d=b+_.outerTopSpace("#dialog");$(".menu .list").css("max-height",d+"px");var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();$("#dialog").css({left:(c-4)+"px",top:b+"px"});$("#dialog").fadeIn()},1)};browser.removeFromClipboard=function(a){if(!this.clipboard||!this.clipboard[a]){return false}if(this.clipboard.length==1){this.clearClipboard();this.hideDialog();return}if(a div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?",{count:a}),c)}else{c()}};browser.moveClipboard=function(b){if(!this.clipboard||!this.clipboard.length){return}var d=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?",{count:a}),c)}else{c()}};browser.deleteClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var c=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?",{count:a}),b)}else{b()}};browser.downloadClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var a=[];for(i=0;i a"),e="------multipartdropuploadboundary"+(new Date).getTime(),d,k=function(q){if(q.preventDefault){q.preventDefault()}$("#files").addClass("drag");return false},p=function(q){if(q.preventDefault){q.preventDefault()}return false},h=function(q){if(q.preventDefault){q.preventDefault()}$("#files").removeClass("drag");return false},j=function(s){if(s.preventDefault){s.preventDefault()}if(s.stopPropagation){s.stopPropagation()}$("#files").removeClass("drag");if(!$("#folders span.current").first().parent().data("writable")){browser.alert("Cannot write to upload folder.");return false}l+=s.dataTransfer.files.length;for(var r=0;r$(window).height()){d=$(window).height()-$(this).outerHeight()}if(c+$(this).outerWidth()>$(window).width()){c=$(window).width()-$(this).outerWidth()}$(this).css({top:d,left:c})};browser.showDialog=function(d){$("#dialog").css({left:0,top:0});this.shadow();if($("#dialog div.box")&&!$("#dialog div.title").get(0)){var a=$("#dialog div.box").html();var f=$("#dialog").data("title")?$("#dialog").data("title"):"";a='
'+f+"
"+a;$("#dialog div.box").html(a);$("#dialog div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#dialog div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#dialog div.title span.close").click(function(){browser.hideDialog();browser.hideAlert()})}$("#dialog").drag(browser.drag,{handle:"#dialog div.title"});$("#dialog").css("display","block");if(d){var c=d.pageX-parseInt($("#dialog").outerWidth()/2);var b=d.pageY-parseInt($("#dialog").outerHeight()/2);if(c<0){c=0}if(b<0){b=0}if(($("#dialog").outerWidth()+c)>$(window).width()){c=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+b)>$(window).height()){b=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:c+"px",top:b+"px"})}else{$("#dialog").css({left:parseInt(($(window).width()-$("#dialog").outerWidth())/2)+"px",top:parseInt(($(window).height()-$("#dialog").outerHeight())/2)+"px"})}$(document).unbind("keydown");$(document).keydown(function(g){if(g.keyCode==27){browser.hideDialog()}})};browser.hideDialog=function(){this.unshadow();if($("#clipboard").hasClass("selected")){$("#clipboard").removeClass("selected")}$("#dialog").css("display","none");$("div.folder > a > span.folder").removeClass("context");$("#dialog").html("");$("#dialog").data("title",null);$("#dialog").unbind();$("#dialog").click(function(){return false});$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});browser.hideAlert()};browser.showAlert=function(d){$("#alert").css({left:0,top:0});if(typeof d=="undefined"){d=true}if(d){this.shadow()}var c=parseInt(($(window).width()-$("#alert").outerWidth())/2),b=parseInt(($(window).height()-$("#alert").outerHeight())/2);var a=$(window).height();if(b<0){b=0}$("#alert").css({left:c+"px",top:b+"px",display:"block"});if($("#alert").outerHeight()>a){$("#alert div.message").css({height:a-$("#alert div.title").outerHeight()-$("#alert div.ok").outerHeight()-20+"px"})}$(document).unbind("keydown");$(document).keydown(function(f){if(f.keyCode==27){browser.hideDialog();browser.hideAlert();$(document).unbind("keydown");$(document).keydown(function(g){return !browser.selectAll(g)})}})};browser.hideAlert=function(a){if(typeof a=="undefined"){a=true}if(a){this.unshadow()}$("#alert").css("display","none");$("#alert").html("");$("#alert").data("title",null)};browser.alert=function(b,c){b=b.replace(/\r?\n/g,"
");var a=$("#alert").data("title")?$("#alert").data("title"):browser.label("Attention");$("#alert").html('
'+a+'
'+b+'
");$("#alert div.ok button").click(function(){browser.hideAlert(c)});$("#alert div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#alert div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#alert div.title span.close").click(function(){browser.hideAlert(c)});$("#alert").drag(browser.drag,{handle:"#alert div.title"});browser.showAlert(c)};browser.confirm=function(a,b){$("#dialog").data("title",browser.label("Question"));$("#dialog").html('
'+browser.label(a)+'
");browser.showDialog();$("#dialog div.buttons button").first().click(function(){browser.hideDialog()});$("#dialog div.buttons button").last().click(function(){if(b){b(function(){browser.hideDialog()})}else{browser.hideDialog()}});$("#dialog div.buttons button").get(1).focus()};browser.shadow=function(){$("#shadow").css("display","block")};browser.unshadow=function(){$("#shadow").css("display","none")};browser.showMenu=function(c){var b=c.pageX;var a=c.pageY;if(($("#dialog").outerWidth()+b)>$(window).width()){b=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+a)>$(window).height()){a=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:b+"px",top:a+"px",display:"none"});$("#dialog").fadeIn()};browser.fileNameDialog=function(e,post,inputName,inputValue,url,labels,callBack,selectAll){var html='

';$("#dialog").html(html);$("#dialog").data("title",this.label(labels.title));$('#dialog input[name="'+inputName+'"]').attr("value",inputValue);$("#dialog").unbind();$("#dialog").click(function(){return false});$("#dialog form").submit(function(){var name=this.elements[0];name.value=$.trim(name.value);if(name.value==""){browser.alert(browser.label(labels.errEmpty),false);name.focus();return}else{if(/[\/\\]/g.test(name.value)){browser.alert(browser.label(labels.errSlash),false);name.focus();return}else{if(name.value.substr(0,1)=="."){browser.alert(browser.label(labels.errDot),false);name.focus();return}}}eval("post."+inputName+" = name.value;");$.ajax({type:"POST",dataType:"json",url:url,data:post,async:false,success:function(data){if(browser.check4errors(data,false)){return}if(callBack){callBack(data)}browser.hideDialog()},error:function(){browser.alert(browser.label("Unknown error."),false)}});return false});browser.showDialog(e);$("#dialog").css("display","block");$('#dialog input[type="submit"]').click(function(){return $("#dialog form").submit()});var field=$('#dialog input[type="text"]');var value=field.attr("value");if(!selectAll&&/^(.+)\.[^\.]+$/.test(value)){value=value.replace(/^(.+)\.[^\.]+$/,"$1");_.selection(field.get(0),0,value.length)}else{field.get(0).focus();field.get(0).select()}};browser.orderFiles=function(callBack,selected){var order=_.kuki.get("order");var desc=(_.kuki.get("orderDesc")=="on");if(!browser.files||!browser.files.sort){browser.files=[]}browser.files=browser.files.sort(function(a,b){var a1,b1,arr;if(!order){order="name"}if(order=="date"){a1=a.mtime;b1=b.mtime}else{if(order=="type"){a1=_.getFileExtension(a.name);b1=_.getFileExtension(b.name)}else{if(order=="size"){a1=a.size;b1=b.size}else{eval("a1 = a."+order+".toLowerCase(); b1 = b."+order+".toLowerCase();")}}}if((order=="size")||(order=="date")){if(a1b1){return desc?-1:1}}if(a1==b1){a1=a.name.toLowerCase();b1=b.name.toLowerCase();arr=[a1,b1];arr=arr.sort();return(arr[0]==a1)?-1:1}arr=[a1,b1];arr=arr.sort();if(arr[0]==a1){return desc?1:-1}return desc?-1:1});browser.showFiles(callBack,selected);browser.initFiles()};browser.humanSize=function(a){if(a<1024){a=a.toString()+" B"}else{if(a<1048576){a/=1024;a=parseInt(a).toString()+" KB"}else{if(a<1073741824){a/=1048576;a=parseInt(a).toString()+" MB"}else{if(a<1099511627776){a/=1073741824;a=parseInt(a).toString()+" GB"}else{a/=1099511627776;a=parseInt(a).toString()+" TB"}}}}return a};browser.baseGetData=function(a){var b="browse.php?type="+encodeURIComponent(this.type)+"&lng="+this.lang;if(a){b+="&act="+a}if(this.cms){b+="&cms="+this.cms}return b};browser.label=function(b,c){var a=this.labels[b]?this.labels[b]:b;if(c){$.each(c,function(d,e){a=a.replace("{"+d+"}",e)})}return a};browser.check4errors=function(a,c){if(!a.error){return false}var b;if(a.error.join){b=a.error.join("\n")}else{b=a.error}browser.alert(b,c);return true};browser.post=function(a,c){var b='
';$.each(c,function(d,e){if($.isArray(e)){$.each(e,function(g,f){b+=''})}else{b+=''}});b+="
";$("#dialog").html(b);$("#dialog").css("display","block");$("#postForm").get(0).submit()};browser.fadeFiles=function(){$("#files > div").css({opacity:"0.4",filter:"alpha(opacity:40)"})}; \ No newline at end of file +/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +;!function(d,c){"object"==typeof module&&"object"==typeof module.exports?module.exports=d.document?c(d,!0):function(b){if(!b.document){throw new Error("jQuery requires a window with a document")}return c(b)}:c(d)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++){if(null!=(e=arguments[h])){for(d in e){a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c))}}}return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a){return !1}return !0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a)){return !1}try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}if(l.ownLast){for(b in a){return j.call(a,b)}}for(b in a){}return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++){if(d=b.apply(a[e],c),d===!1){break}}}else{for(e in a){if(d=b.apply(a[e],c),d===!1){break}}}}else{if(g){for(;f>e;e++){if(d=b.call(a[e],e,a[e]),d===!1){break}}}else{for(e in a){if(d=b.call(a[e],e,a[e]),d===!1){break}}}}return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g){return g.call(b,a,c)}for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++){if(c in b&&b[c]===a){return c}}}return -1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d){a[e++]=b[d++]}if(c!==c){while(void 0!==b[d]){a[e++]=b[d++]}}return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++){d=!b(a[f],f),d!==h&&e.push(a[f])}return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h){for(;g>f;f++){d=b(a[f],f,c),null!=d&&i.push(d)}}else{for(f in a){d=b(a[f],f,c),null!=d&&i.push(d)}}return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return +new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++){if(this[b]===a){return b}}return -1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]){}a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a){return d}if(1!==(i=b.nodeType)&&9!==i){return[]}if(n&&!e){if(f=Z.exec(a)){if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode){return d}if(g.id===h){return d.push(g),d}}else{if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h){return d.push(g),d}}}else{if(f[2]){return G.apply(d,b.getElementsByTagName(a)),d}if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName){return G.apply(d,b.getElementsByClassName(h)),d}}}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--){m[j]=q+pb(m[j])}u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v){try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return !!a(b)}catch(c){return !1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--){d.attrHandle[c[e]]=b}}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d){return d}if(c){while(c=c.nextSibling){if(c===b){return -1}}}return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--){c[e=f[g]]&&(c[e]=!(d[e]=c[e]))}})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++]){1===c.nodeType&&d.push(c)}return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b){while(b=b.parentNode){if(b===a){return !0}}}return !1},z=b?function(a,b){if(a===b){return j=!0,0}var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b){return j=!0,0}var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g){return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0}if(f===g){return ib(a,b)}c=a;while(c=c.parentNode){h.unshift(c)}c=b;while(c=c.parentNode){k.unshift(c)}while(h[d]===k[d]){d++}return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b))){try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType){return d}}catch(e){}}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++]){b===a[f]&&(e=d.push(f))}while(e--){a.splice(d[e],1)}}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent){return a.textContent}for(a=a.firstChild;a;a=a.nextSibling){c+=e(a)}}else{if(3===f||4===f){return a.nodeValue}}}else{while(b=a[d++]){c+=e(b)}}return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return !0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return !!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p]){if(h?l.nodeName.toLowerCase()===r:1===l.nodeType){return !1}}o=p="only"===a&&!o&&"nextSibling"}return !0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}}else{if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u){m=j[1]}else{while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b)){break}}}}return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--){d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--){(f=g[h])&&(a[h]=!(b[h]=f))}}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do{if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang")){return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-")}}while((b=b.parentNode)&&1===b.nodeType);return !1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling){if(a.nodeType<6){return !1}}return !0},parent:function(a){return !d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2){a.push(c)}return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2){a.push(c)}return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;){a.push(d)}return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++){d+=a[b].value}return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d]){if(1===b.nodeType||e){return a(b,c,f)}}}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d]){if((1===b.nodeType||e)&&a(b,c,g)){return !0}}}else{while(b=b[d]){if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f){return j[2]=h[2]}if(i[d]=j,j[2]=a(b,c,g)){return !0}}}}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--){if(!a[e](b,c,d)){return !1}}return !0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++){(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h))}return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--){(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}}if(f){if(e||a){if(e){j=[],k=r.length;while(k--){(l=r[k])&&j.push(q[k]=l)}e(null,r=[],j,i)}k=r.length;while(k--){(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}}else{r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)}})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return !g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++){if(c=d.relative[a[j].type]){m=[qb(rb(m),c)]}else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++){if(d.relative[a[e].type]){break}}return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||0.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++]){if(o(m,g,i)){j.push(m);break}}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++]){o(r,s,g,i)}if(f){if(p>0){while(q--){r[q]||s[q]||(s[q]=E.call(j))}}s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--){f=ub(b[c]),f[s]?d.push(f):e.push(f)}f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++){db(a,b[d],c)}return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b){return e}a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type]){break}if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a){return G.apply(e,f),e}break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b)){return n.grep(a,function(a,d){return !!b.call(a,d,a)!==c})}if(b.nodeType){return n.grep(a,function(a){return a===b!==c})}if("string"==typeof b){if(w.test(b)){return n.filter(b,a,c)}b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a){return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++){if(n.contains(d[b],this)){return !0}}}))}for(b=0;e>b;b++){n.find(a,d[b],c)}return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return !!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a){return this}if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b){return !b||b.jquery?(b||y).find(a):this.constructor(b).find(a)}if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b)){for(c in b){n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c])}}return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2]){return y.find(a)}this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c))){1===e.nodeType&&d.push(e),e=e[b]}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling){1===a.nodeType&&a!==b&&c.push(a)}return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++){if(n.contains(this,c[b])){return !0}}})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++){for(c=this[d];c&&c!==b;c=c.parentNode){if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}}}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do{a=a[b]}while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++){if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1){h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return !h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return !i},fireWith:function(a,c){return !h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return !!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1){for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++){c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f}}return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body){return setTimeout(n.ready)}n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I){if(I=n.Deferred(),"complete"===z.readyState){setTimeout(n.ready)}else{if(z.addEventListener){z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1)}else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}}}return I.promise(b)};var L="undefined",M;for(M in n(l)){break}l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else{c=void 0}}return c}function Q(a){var b;for(b in a){if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b){return !1}}return !0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b){return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--){delete d[b[e]]}if(c?!Q(d):!n.isEmptyObject(d)){return}}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--){d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]))}n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++){b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)))}}}return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in {submit:!0,change:!0,focusin:!0}){c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1)}d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return !0}function cb(){return !1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--){f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0)}a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--){if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--){g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g))}i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else{for(o in k){n.event.remove(a,o+b[j],c,d,!0)}}}n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode){o.push(h),l=h}l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped()){b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault())}if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped()){(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type)){for(;i!=this;i=i.parentNode||this){if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++){d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d)}e.length&&g.push({elem:i,handlers:e})}}}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f){for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++){!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b))}}return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++){n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h){for(d=0,e=h[c].length;e>d;d++){n.event.add(b,c,h[c][d])}}}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events){n.removeEvent(b,d,e.handle)}b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a))){for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g){d[g]&&Cb(e,d[g])}}if(b){if(c){for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++){Bb(e,d[g])}}else{Bb(a,f)}}return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++){if(f=a[q],f||0===f){if("object"===n.type(f)){n.merge(p,f.nodeType?[f]:f)}else{if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--){h=h.lastChild}if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--){n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild){h.removeChild(h.firstChild)}h=o.lastChild}else{p.push(b.createTextNode(f))}}}}h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++]){if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++]){pb.test(f.type||"")&&c.push(f)}}}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++){if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events){for(e in g.events){m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle)}}j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++){b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c))}return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild){a.removeChild(a.firstChild)}a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a){return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0}if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++){b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a)}b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p)){return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)})}if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++){d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j)}if(f){for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++){d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")))}}i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++){c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get())}return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("').prependTo(document.body);$("#loading").html(this.label("Uploading file..."));$("#loading").css("display","inline");a.submit();$("#uploadResponse").load(function(){var b=$(this).contents().find("body").html();$("#loading").css("display","none");b=b.split("\n");var c=[],d=[];$.each(b,function(e,f){if(f.substr(0,1)=="/"){c[c.length]=f.substr(1,f.length-1)}else{d[d.length]=f}});if(d.length){browser.alert(d.join("\n"))}if(!c.length){c=null}browser.refresh(c);$("#upload").detach();setTimeout(function(){$("#uploadResponse").detach()},1);browser.initUploadButton()})};browser.maximize=function(f){if(window.opener){window.moveTo(0,0);b=screen.availWidth;i=screen.availHeight;if($.agent.opera){i-=50}window.resizeTo(b,i)}else{if(browser.opener.TinyMCE){var g,d,a;$("iframe",window.parent.document).each(function(){if(/^mce_\d+_ifr$/.test($(this).attr("id"))){a=parseInt($(this).attr("id").replace(/^mce_(\d+)_ifr$/,"$1"));g=$("#mce_"+a,window.parent.document);d=$("#mce_"+a+"_ifr",window.parent.document)}});if($(f).hasClass("selected")){$(f).removeClass("selected");g.css({left:browser.maximizeMCE.left+"px",top:browser.maximizeMCE.top+"px",width:browser.maximizeMCE.width+"px",height:browser.maximizeMCE.height+"px"});d.css({width:browser.maximizeMCE.width-browser.maximizeMCE.Hspace+"px",height:browser.maximizeMCE.height-browser.maximizeMCE.Vspace+"px"})}else{$(f).addClass("selected");browser.maximizeMCE={width:parseInt(g.css("width")),height:parseInt(g.css("height")),left:g.position().left,top:g.position().top,Hspace:parseInt(g.css("width"))-parseInt(d.css("width")),Vspace:parseInt(g.css("height"))-parseInt(d.css("height"))};var b=$(window.parent).width();var i=$(window.parent).height();g.css({left:$(window.parent).scrollLeft()+"px",top:$(window.parent).scrollTop()+"px",width:b+"px",height:i+"px"});d.css({width:b-browser.maximizeMCE.Hspace+"px",height:i-browser.maximizeMCE.Vspace+"px"})}}else{if($("iframe",window.parent.document).get(0)){var e=$('iframe[name="'+window.name+'"]',window.parent.document);var h=e.parent();var b,i;if($(f).hasClass("selected")){$(f).removeClass("selected");if(browser.maximizeThread){clearInterval(browser.maximizeThread);browser.maximizeThread=null}if(browser.maximizeW){browser.maximizeW=null}if(browser.maximizeH){browser.maximizeH=null}$.each($("*",window.parent.document).get(),function(j,k){k.style.display=browser.maximizeDisplay[j]});e.css({display:browser.maximizeCSS.display,position:browser.maximizeCSS.position,left:browser.maximizeCSS.left,top:browser.maximizeCSS.top,width:browser.maximizeCSS.width,height:browser.maximizeCSS.height});$(window.parent).scrollLeft(browser.maximizeLest);$(window.parent).scrollTop(browser.maximizeTop)}else{$(f).addClass("selected");browser.maximizeCSS={display:e.css("display"),position:e.css("position"),left:e.css("left"),top:e.css("top"),width:e.outerWidth()+"px",height:e.outerHeight()+"px"};browser.maximizeTop=$(window.parent).scrollTop();browser.maximizeLeft=$(window.parent).scrollLeft();browser.maximizeDisplay=[];$.each($("*",window.parent.document).get(),function(j,k){browser.maximizeDisplay[j]=$(k).css("display");$(k).css("display","none")});e.css("display","block");e.parents().css("display","block");var c=function(){b=$(window.parent).width();i=$(window.parent).height();if(!browser.maximizeW||(browser.maximizeW!=b)||!browser.maximizeH||(browser.maximizeH!=i)){browser.maximizeW=b;browser.maximizeH=i;e.css({width:b+"px",height:i+"px"});browser.resize()}};e.css("position","absolute");if((e.offset().left==e.position().left)&&(e.offset().top==e.position().top)){e.css({left:"0",top:"0"})}else{e.css({left:-e.offset().left+"px",top:-e.offset().top+"px"})}c();browser.maximizeThread=setInterval(c,250)}}}}};browser.refresh=function(a){this.fadeFiles();$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:browser.dir},async:false,success:function(b){if(browser.check4errors(b)){return}browser.dirWritable=b.dirWritable;browser.files=b.files?b.files:[];browser.orderFiles(null,a);browser.statusDir()},error:function(){$("#files > div").css({opacity:"",filter:""});$("#files").html(browser.label("Unknown error."))}})};browser.initSettings=function(){if(!this.shows.length){var d=$('#show input[type="checkbox"]').toArray();$.each(d,function(f,e){browser.shows[f]=e.name})}var a=this.shows;if(!$.$.kuki.isSet("showname")){$.$.kuki.set("showname","on");$.each(a,function(e,f){if(f!="name"){$.$.kuki.set("show"+f,"off")}})}$('#show input[type="checkbox"]').click(function(){var e=$(this).get(0).checked?"on":"off";$.$.kuki.set("show"+$(this).get(0).name,e);if($(this).get(0).checked){$("#files .file div."+$(this).get(0).name).css("display","block")}else{$("#files .file div."+$(this).get(0).name).css("display","none")}});$.each(a,function(e,g){var f=($.$.kuki.get("show"+g)=="on")?"checked":"";$('#show input[name="'+g+'"]').get(0).checked=f});if(!this.orders.length){var c=$('#order input[type="radio"]').toArray();$.each(c,function(f,e){browser.orders[f]=e.value})}var b=this.orders;if(!$.$.kuki.isSet("order")){$.$.kuki.set("order","name")}if(!$.$.kuki.isSet("orderDesc")){$.$.kuki.set("orderDesc","off")}$('#order input[value="'+$.$.kuki.get("order")+'"]').get(0).checked=true;$('#order input[name="desc"]').get(0).checked=($.$.kuki.get("orderDesc")=="on");$('#order input[type="radio"]').click(function(){$.$.kuki.set("order",$(this).get(0).value);browser.orderFiles()});$('#order input[name="desc"]').click(function(){$.$.kuki.set("orderDesc",$(this).get(0).checked?"on":"off");browser.orderFiles()});if(!$.$.kuki.isSet("view")){$.$.kuki.set("view","thumbs")}if($.$.kuki.get("view")=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}$('#view input[value="'+$.$.kuki.get("view")+'"]').get(0).checked=true;$("#view input").click(function(){var e=$(this).attr("value");if($.$.kuki.get("view")!=e){$.$.kuki.set("view",e);if(e=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}else{$.each(browser.shows,function(f,g){$('#show input[name="'+g+'"]').get(0).checked=($.$.kuki.get("show"+g)=="on")});$("#show input").each(function(){this.disabled=false})}}browser.refresh()})};browser.initFiles=function(){$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});$("#files").unbind();$("#files").scroll(function(){browser.hideDialog()});$(".file").unbind();$(".file").click(function(a){$.$.unselect();browser.selectFile($(this),a)});$("#files .file").rightClick(function(a,b){$.$.unselect();browser.menuFile($(a),b)});$(".file").dblclick(function(){$.$.unselect();browser.returnFile($(this))});$(".file").mouseup(function(){$.$.unselect()});$(".file").mouseout(function(){$.$.unselect()});$.each(this.shows,function(a,c){var b=($.$.kuki.get("show"+c)=="off")?"none":"block";$("#files .file div."+c).css("display",b)});this.statusDir()};browser.showFiles=function(b,a){this.fadeFiles();setTimeout(function(){var c="";$.each(browser.files,function(f,e){var d=[];$.each(e,function(h,j){d[d.length]=h+"|"+j});d=$.$.md5(d.join("|"));if($.$.kuki.get("view")=="list"){if(!f){c+='
'}var g=$.$.getFileExtension(e.name);if(e.thumb){g=".image"}else{if(!g.length||!e.smallIcon){g="."}}g="themes/"+browser.theme+"/img/files/small/"+g+".png";c+='";if(f==browser.files.length-1){c+="
'+$.$.htmlData(e.name)+''+e.date+''+browser.humanSize(e.size)+"
"}}else{if(e.thumb){var g=browser.baseGetData("thumb")+"&file="+encodeURIComponent(e.name)+"&dir="+encodeURIComponent(browser.dir)+"&stamp="+d}else{if(e.smallThumb){var g=browser.uploadURL+"/"+browser.dir+"/"+e.name;g=$.$.escapeDirs(g).replace(/\'/g,"%27")}else{var g=e.bigIcon?$.$.getFileExtension(e.name):".";if(!g.length){g="."}g="themes/"+browser.theme+"/img/files/big/"+g+".png"}}c+='
'+$.$.htmlData(e.name)+'
'+e.date+'
'+browser.humanSize(e.size)+"
"}});$("#files").html("
"+c+"
");$.each(browser.files,function(e,d){var f=$("#files .file").get(e);$(f).data(d);if($.$.inArray(d.name,a)||((typeof a!="undefined")&&!a.push&&(d.name==a))){$(f).addClass("selected")}});$("#files > div").css({opacity:"",filter:""});if(b){b()}browser.initFiles()},200)};browser.selectFile=function(b,f){if(f.ctrlKey||f.metaKey){if(b.hasClass("selected")){b.removeClass("selected")}else{b.addClass("selected")}var c=$(".file.selected").get();var a=0;if(!c.length){this.statusDir()}else{$.each(c,function(g,e){a+=parseInt($(e).data("size"))});a=this.humanSize(a);if(c.length>1){$("#fileinfo").html(c.length+" "+this.label("selected files")+" ("+a+")")}else{var d=$(c[0]).data();$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}}}else{var d=b.data();$(".file").removeClass("selected");b.addClass("selected");$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}};browser.selectAll=function(c){if((!c.ctrlKey&&!c.metaKey)||((c.keyCode!=65)&&(c.keyCode!=97))){return false}var b=$(".file").get();if(b.length){var a=0;$.each(b,function(e,d){if(!$(d).hasClass("selected")){$(d).addClass("selected")}a+=parseInt($(d).data("size"))});a=this.humanSize(a);$("#fileinfo").html(b.length+" "+this.label("selected files")+" ("+a+")")}return true};browser.returnFile=function(c){var a=c.substr?c:browser.uploadURL+"/"+browser.dir+"/"+c.data("name");a=$.$.escapeDirs(a);if(this.opener.CKEditor){this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum,a,"");window.close()}else{if(this.opener.FCKeditor){window.opener.SetUrl(a);window.close()}else{if(this.opener.TinyMCE){var d=tinyMCEPopup.getWindowArg("window");d.document.getElementById(tinyMCEPopup.getWindowArg("input")).value=a;if(d.getImageData){d.getImageData()}if(typeof(d.ImageDialog)!="undefined"){if(d.ImageDialog.getImageData){d.ImageDialog.getImageData()}if(d.ImageDialog.showPreviewImage){d.ImageDialog.showPreviewImage(a)}}tinyMCEPopup.close()}else{if(this.opener.callBack){if(window.opener&&window.opener.KCFinder){this.opener.callBack(a);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBack(a)}}else{if(this.opener.callBackMultiple){if(window.opener&&window.opener.KCFinder){this.opener.callBackMultiple([a]);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBackMultiple([a])}}}}}}};browser.returnFiles=function(b){if(this.opener.callBackMultiple&&b.length){var a=[];$.each(b,function(d,c){a[d]=browser.uploadURL+"/"+browser.dir+"/"+$(c).data("name");a[d]=$.$.escapeDirs(a[d])});this.opener.callBackMultiple(a);if(window.opener){window.close()}}};browser.returnThumbnails=function(c){if(this.opener.callBackMultiple){var b=[];var a=0;$.each(c,function(e,d){if($(d).data("thumb")){b[a]=browser.thumbsURL+"/"+browser.dir+"/"+$(d).data("name");b[a]=$.$.escapeDirs(b[a++])}});this.opener.callBackMultiple(b);if(window.opener){window.close()}}};browser.menuFile=function(c,h){var f=c.data();var k=this.dir+"/"+f.name;var b=$(".file.selected").get();var g="";if(c.hasClass("selected")&&b.length&&(b.length>1)){var a=false;var d=0;var j;$.each(b,function(l,e){j=$(e).data();if(j.thumb){a=true}if(!f.writable){d++}});if(this.opener.callBackMultiple){g+=''+this.label("Select")+"";if(a){g+=''+this.label("Select Thumbnails")+""}}if(f.thumb||f.smallThumb||this.support.zip){g+=(g.length?'
':"");if(f.thumb||f.smallThumb){g+=''+this.label("View")+""}if(this.support.zip){g+=(g.length?'
':"")+''+this.label("Download")+""}}if(this.access.files.copy||this.access.files.move){g+=(g.length?'
':"")+''+this.label("Add to Clipboard")+""}if(this.access.files["delete"]){g+=(g.length?'
':"")+'"+this.label("Delete")+""}if(g.length){g='";$("#dialog").html(g);this.showMenu(h)}else{return}$('.menu a[href="kcact:pick"]').click(function(){browser.returnFiles(b);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){browser.returnThumbnails(b);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();var e=[];$.each(b,function(m,l){e[m]=$(l).data("name")});browser.post(browser.baseGetData("downloadSelected"),{dir:browser.dir,files:e});return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){browser.hideDialog();var e="";$.each(b,function(n,m){var o=$(m).data();var l=false;for(n=0;n div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(e){browser.confirm(browser.label("{count} selected files are not removable. Do you want to delete the rest?",{count:e}),l)}else{browser.confirm(browser.label("Are you sure you want to delete all selected files?"),l)}return false})}else{g+='";$("#dialog").html(g);this.showMenu(h);$('.menu a[href="kcact:pick"]').click(function(){browser.returnFile(c);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){var e=browser.thumbsURL+"/"+browser.dir+"/"+f.name;browser.returnFile(e);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){var e='
';$("#dialog").html(e);$("#downloadForm input").get(0).value=browser.dir;$("#downloadForm input").get(1).value=f.name;$("#downloadForm").submit();return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){for(i=0;i
');$("#dialog img").attr({src:url,title:n.name}).fadeIn("fast",function(){var q=$("#dialog").outerWidth();var s=$("#dialog").outerHeight();var r=$(window).width()-30;var t=$(window).height()-30;if((q>r)||(s>t)){if((r/t)>(q/s)){r=parseInt((q*t)/s)}else{if((r/t)<(q/s)){t=parseInt((s*r)/q)}}$("#dialog img").attr({width:r,height:t})}$("#dialog").unbind("click");$("#dialog").click(function(u){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(v){return !browser.selectAll(v)});if(browser.ssImage){browser.selectFile($(browser.ssImage),u)}});browser.showDialog();var p=[];$.each(browser.files,function(v,u){if(u.thumb||u.smallThumb){p[p.length]=u}});if(p.length){$.each(p,function(u,v){if(v.name==n.name){$(document).unbind("keydown");$(document).keydown(function(x){if(p.length>1){if(!browser.lock&&(x.keyCode==37)){var w=u?p[u-1]:p[p.length-1];browser.lock=true;e(w)}if(!browser.lock&&(x.keyCode==39)){var w=(u>=p.length-1)?p[0]:p[u+1];browser.lock=true;e(w)}}if(x.keyCode==27){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(y){return !browser.selectAll(y)})}})}})}})};if(m.complete){o()}else{m.onload=o}};e(f);return false})};browser.initFolders=function(){$("#folders").scroll(function(){browser.hideDialog()});$("div.folder > a").unbind();$("div.folder > a").bind("click",function(){browser.hideDialog();return false});$("div.folder > a > span.brace").unbind();$("div.folder > a > span.brace").click(function(){if($(this).hasClass("opened")||$(this).hasClass("closed")){browser.expandDir($(this).parent())}});$("div.folder > a > span.folder").unbind();$("div.folder > a > span.folder").click(function(){browser.changeDir($(this).parent())});$("div.folder > a > span.folder").rightClick(function(d,f){$.$.unselect();browser.menuDir($(d).parent(),f)});if($.agent.msie&&!$.agent.opera&&!$.agent.chromeframe&&(parseInt($.agent.msie)<8)){var b=$("div.folder").get();var a=$("body").get(0);var c;$.each(b,function(d,e){c=document.createElement("div");c.style.display="inline";c.style.margin=c.style.border=c.style.padding="0";c.innerHTML='
'+$(e).html()+"
";a.appendChild(c);$(e).css("width",$(c).innerWidth()+"px");a.removeChild(c)})}};browser.setTreeData=function(b,c){if(!c){c=""}else{if(c.length&&(c.substr(c.length-1,1)!="/")){c+="/"}}c+=b.name;var a='#folders a[href="kcdir:/'+$.$.escapeDirs(c)+'"]';$(a).data({name:b.name,path:c,readable:b.readable,writable:b.writable,removable:b.removable,hasDirs:b.hasDirs});$(a+" span.folder").addClass(b.current?"current":"regular");if(b.dirs&&b.dirs.length){$(a+" span.brace").addClass("opened");$.each(b.dirs,function(e,d){browser.setTreeData(d,c+"/")})}else{if(b.hasDirs){$(a+" span.brace").addClass("closed")}}};browser.buildTree=function(a,d){if(!d){d=""}d+=a.name;var c='
 '+$.$.htmlData(a.name)+"";if(a.dirs){c+='
';for(var b=0;b'+this.label("Loading folders...")+"
");$("#loadingDirs").css("display","none");$("#loadingDirs").show(200,function(){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("expand"),data:{dir:b},async:false,success:function(e){$("#loadingDirs").hide(200,function(){$("#loadingDirs").detach()});if(browser.check4errors(e)){return}var d="";$.each(e.dirs,function(g,f){d+='"});if(d.length){a.parent().append('
'+d+"
");var c=$(a.parent().children(".folders").first());c.css("display","none");$(c).show(500);$.each(e.dirs,function(g,f){browser.setTreeData(f,b)})}if(e.dirs.length){a.children(".brace").removeClass("closed");a.children(".brace").addClass("opened")}else{a.children(".brace").removeClass("opened");a.children(".brace").removeClass("closed")}browser.initFolders();browser.initDropUpload()},error:function(){$("#loadingDirs").detach();browser.alert(browser.label("Unknown error."))}})})}}}};browser.changeDir=function(a){if(a.children("span.folder").hasClass("regular")){$("div.folder > a > span.folder").removeClass("current");$("div.folder > a > span.folder").removeClass("regular");$("div.folder > a > span.folder").addClass("regular");a.children("span.folder").removeClass("regular");a.children("span.folder").addClass("current");$("#files").html(browser.label("Loading files..."));$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:a.data("path")},async:false,success:function(b){if(browser.check4errors(b)){return}browser.files=b.files;browser.orderFiles();browser.dir=a.data("path");browser.dirWritable=b.dirWritable;var c="KCFinder: /"+browser.dir;document.title=c;if(browser.opener.TinyMCE){tinyMCEPopup.editor.windowManager.setTitle(window,c)}browser.statusDir()},error:function(){$("#files").html(browser.label("Unknown error."))}})}};browser.statusDir=function(){for(var b=0,a=0;b"+this.label("Copy {count} files",{count:this.clipboard.length})+""}if(this.access.files.move){b+='"+this.label("Move {count} files",{count:this.clipboard.length})+""}if(this.access.files.copy||this.access.files.move){b+='
'}}b+=''+this.label("Refresh")+"";if(this.support.zip){b+='
'+this.label("Download")+""}if(this.access.dirs.create||this.access.dirs.rename||this.access.dirs["delete"]){b+='
'}if(this.access.dirs.create){b+='"+this.label("New Subfolder...")+""}if(this.access.dirs.rename){b+='"+this.label("Rename...")+""}if(this.access.dirs["delete"]){b+='"+this.label("Delete")+""}b+="
";$("#dialog").html(b);this.showMenu(d);$("div.folder > a > span.folder").removeClass("context");if(a.children("span.folder").hasClass("regular")){a.children("span.folder").addClass("context")}if(this.clipboard&&this.clipboard.length&&c.writable){$('.menu a[href="kcact:cpcbd"]').click(function(){browser.hideDialog();browser.copyClipboard(c.path);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){browser.hideDialog();browser.moveClipboard(c.path);return false})}$('.menu a[href="kcact:refresh"]').click(function(){browser.hideDialog();browser.refreshDir(a);return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.post(browser.baseGetData("downloadDir"),{dir:c.path});return false});$('.menu a[href="kcact:mkdir"]').click(function(f){if(!c.writable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newDir","",browser.baseGetData("newDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(){browser.refreshDir(a);browser.initDropUpload();if(!c.hasDirs){a.data("hasDirs",true);a.children("span.brace").addClass("closed")}});return false});$('.menu a[href="kcact:mvdir"]').click(function(f){if(!c.removable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newName",c.name,browser.baseGetData("renameDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(e){if(!e.name){browser.alert(browser.label("Unknown error."));return}var g=(c.path==browser.dir);a.children("span.folder").html($.$.htmlData(e.name));a.data("name",e.name);a.data("path",$.$.dirname(c.path)+"/"+e.name);if(g){browser.dir=a.data("path")}browser.initDropUpload()},true);return false});$('.menu a[href="kcact:rmdir"]').click(function(){if(!c.removable){return false}browser.hideDialog();browser.confirm("Are you sure you want to delete this folder and all its content?",function(e){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("deleteDir"),data:{dir:c.path},async:false,success:function(f){if(e){e()}if(browser.check4errors(f)){return}a.parent().hide(500,function(){var h=a.parent().parent();var g=h.parent().children("a").first();a.parent().detach();if(!h.children("div.folder").get(0)){g.children("span.brace").first().removeClass("opened");g.children("span.brace").first().removeClass("closed");g.parent().children(".folders").detach();g.data("hasDirs",false)}if(g.data("path")==browser.dir.substr(0,g.data("path").length)){browser.changeDir(g)}browser.initDropUpload()})},error:function(){if(e){e()}browser.alert(browser.label("Unknown error."))}})});return false})};browser.refreshDir=function(a){var b=a.data("path");if(a.children(".brace").hasClass("opened")||a.children(".brace").hasClass("closed")){a.children(".brace").removeClass("opened");a.children(".brace").addClass("closed")}a.parent().children(".folders").first().detach();if(b==browser.dir.substr(0,b.length)){browser.changeDir(a)}browser.expandDir(a);return true};browser.initClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var b=0;$.each(this.clipboard,function(c,d){b+=parseInt(d.size)});b=this.humanSize(b);$("#clipboard").html('
');var a=function(){$("#clipboard").css({left:$(window).width()-$("#clipboard").outerWidth()+"px",top:$(window).height()-$("#clipboard").outerHeight()+"px"})};a();$("#clipboard").css("display","block");$(window).unbind();$(window).resize(function(){browser.resize();a()})};browser.openClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}if($('.menu a[href="kcact:cpcbd"]').html()){$("#clipboard").removeClass("selected");this.hideDialog();return}var a='";setTimeout(function(){$("#clipboard").addClass("selected");$("#dialog").html(a);$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.downloadClipboard();return false});$('.menu a[href="kcact:cpcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.copyClipboard(browser.dir);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.moveClipboard(browser.dir);return false});$('.menu a[href="kcact:rmcbd"]').click(function(){browser.hideDialog();browser.confirm(browser.label("Are you sure you want to delete all files in the Clipboard?"),function(e){if(e){e()}browser.deleteClipboard()});return false});$('.menu a[href="kcact:clrcbd"]').click(function(){browser.hideDialog();browser.clearClipboard();return false});var c=$(window).width()-$("#dialog").outerWidth();var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();var d=b+$("#dialog").outerTopSpace();$(".menu .list").css("max-height",d+"px");var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();$("#dialog").css({left:(c-4)+"px",top:b+"px"});$("#dialog").fadeIn()},1)};browser.removeFromClipboard=function(a){if(!this.clipboard||!this.clipboard[a]){return false}if(this.clipboard.length==1){this.clearClipboard();this.hideDialog();return}if(a div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?",{count:a}),c)}else{c()}};browser.moveClipboard=function(b){if(!this.clipboard||!this.clipboard.length){return}var d=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?",{count:a}),c)}else{c()}};browser.deleteClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var c=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?",{count:a}),b)}else{b()}};browser.downloadClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var a=[];for(i=0;i a"),e="------multipartdropuploadboundary"+(new Date).getTime(),d,k=function(q){if(q.preventDefault){q.preventDefault()}$("#files").addClass("drag");return false},p=function(q){if(q.preventDefault){q.preventDefault()}return false},h=function(q){if(q.preventDefault){q.preventDefault()}$("#files").removeClass("drag");return false},j=function(s){if(s.preventDefault){s.preventDefault()}if(s.stopPropagation){s.stopPropagation()}$("#files").removeClass("drag");if(!$("#folders span.current").first().parent().data("writable")){browser.alert("Cannot write to upload folder.");return false}l+=s.dataTransfer.files.length;for(var r=0;r$(window).height()){d=$(window).height()-$(this).outerHeight()}if(c+$(this).outerWidth()>$(window).width()){c=$(window).width()-$(this).outerWidth()}$(this).css({top:d,left:c})};browser.showDialog=function(d){$("#dialog").css({left:0,top:0});this.shadow();if($("#dialog div.box")&&!$("#dialog div.title").get(0)){var a=$("#dialog div.box").html();var f=$("#dialog").data("title")?$("#dialog").data("title"):"";a='
'+f+"
"+a;$("#dialog div.box").html(a);$("#dialog div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#dialog div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#dialog div.title span.close").click(function(){browser.hideDialog();browser.hideAlert()})}$("#dialog").css("display","block");if(d){var c=d.pageX-parseInt($("#dialog").outerWidth()/2);var b=d.pageY-parseInt($("#dialog").outerHeight()/2);if(c<0){c=0}if(b<0){b=0}if(($("#dialog").outerWidth()+c)>$(window).width()){c=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+b)>$(window).height()){b=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:c+"px",top:b+"px"})}else{$("#dialog").css({left:parseInt(($(window).width()-$("#dialog").outerWidth())/2)+"px",top:parseInt(($(window).height()-$("#dialog").outerHeight())/2)+"px"})}$(document).unbind("keydown");$(document).keydown(function(g){if(g.keyCode==27){browser.hideDialog()}})};browser.hideDialog=function(){this.unshadow();if($("#clipboard").hasClass("selected")){$("#clipboard").removeClass("selected")}$("#dialog").css("display","none");$("div.folder > a > span.folder").removeClass("context");$("#dialog").html("");$("#dialog").data("title",null);$("#dialog").unbind();$("#dialog").click(function(){return false});$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});browser.hideAlert()};browser.showAlert=function(d){$("#alert").css({left:0,top:0});if(typeof d=="undefined"){d=true}if(d){this.shadow()}var c=parseInt(($(window).width()-$("#alert").outerWidth())/2),b=parseInt(($(window).height()-$("#alert").outerHeight())/2);var a=$(window).height();if(b<0){b=0}$("#alert").css({left:c+"px",top:b+"px",display:"block"});if($("#alert").outerHeight()>a){$("#alert div.message").css({height:a-$("#alert div.title").outerHeight()-$("#alert div.ok").outerHeight()-20+"px"})}$(document).unbind("keydown");$(document).keydown(function(f){if(f.keyCode==27){browser.hideDialog();browser.hideAlert();$(document).unbind("keydown");$(document).keydown(function(g){return !browser.selectAll(g)})}})};browser.hideAlert=function(a){if(typeof a=="undefined"){a=true}if(a){this.unshadow()}$("#alert").css("display","none");$("#alert").html("");$("#alert").data("title",null)};browser.alert=function(b,c){b=b.replace(/\r?\n/g,"
");var a=$("#alert").data("title")?$("#alert").data("title"):browser.label("Attention");$("#alert").html('
'+a+'
'+b+'
");$("#alert div.ok button").click(function(){browser.hideAlert(c)});$("#alert div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#alert div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#alert div.title span.close").click(function(){browser.hideAlert(c)});browser.showAlert(c)};browser.confirm=function(a,b){$("#dialog").data("title",browser.label("Question"));$("#dialog").html('
'+browser.label(a)+'
");browser.showDialog();$("#dialog div.buttons button").first().click(function(){browser.hideDialog()});$("#dialog div.buttons button").last().click(function(){if(b){b(function(){browser.hideDialog()})}else{browser.hideDialog()}});$("#dialog div.buttons button").get(1).focus()};browser.shadow=function(){$("#shadow").css("display","block")};browser.unshadow=function(){$("#shadow").css("display","none")};browser.showMenu=function(c){var b=c.pageX;var a=c.pageY;if(($("#dialog").outerWidth()+b)>$(window).width()){b=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+a)>$(window).height()){a=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:b+"px",top:a+"px",display:"none"});$("#dialog").fadeIn()};browser.fileNameDialog=function(e,post,inputName,inputValue,url,labels,callBack,selectAll){var html='

';$("#dialog").html(html);$("#dialog").data("title",this.label(labels.title));$('#dialog input[name="'+inputName+'"]').attr("value",inputValue);$("#dialog").unbind();$("#dialog").click(function(){return false});$("#dialog form").submit(function(){var name=this.elements[0];name.value=$.trim(name.value);if(name.value==""){browser.alert(browser.label(labels.errEmpty),false);name.focus();return}else{if(/[\/\\]/g.test(name.value)){browser.alert(browser.label(labels.errSlash),false);name.focus();return}else{if(name.value.substr(0,1)=="."){browser.alert(browser.label(labels.errDot),false);name.focus();return}}}eval("post."+inputName+" = name.value;");$.ajax({type:"POST",dataType:"json",url:url,data:post,async:false,success:function(data){if(browser.check4errors(data,false)){return}if(callBack){callBack(data)}browser.hideDialog()},error:function(){browser.alert(browser.label("Unknown error."),false)}});return false});browser.showDialog(e);$("#dialog").css("display","block");$('#dialog input[type="submit"]').click(function(){return $("#dialog form").submit()});var field=$('#dialog input[type="text"]');var value=field.attr("value");if(!selectAll&&/^(.+)\.[^\.]+$/.test(value)){value=value.replace(/^(.+)\.[^\.]+$/,"$1");field.selection(0,value.length)}else{field.get(0).focus();field.get(0).select()}};browser.orderFiles=function(callBack,selected){var order=$.$.kuki.get("order");var desc=($.$.kuki.get("orderDesc")=="on");if(!browser.files||!browser.files.sort){browser.files=[]}browser.files=browser.files.sort(function(a,b){var a1,b1,arr;if(!order){order="name"}if(order=="date"){a1=a.mtime;b1=b.mtime}else{if(order=="type"){a1=$.$.getFileExtension(a.name);b1=$.$.getFileExtension(b.name)}else{if(order=="size"){a1=a.size;b1=b.size}else{eval("a1 = a."+order+".toLowerCase(); b1 = b."+order+".toLowerCase();")}}}if((order=="size")||(order=="date")){if(a1b1){return desc?-1:1}}if(a1==b1){a1=a.name.toLowerCase();b1=b.name.toLowerCase();arr=[a1,b1];arr=arr.sort();return(arr[0]==a1)?-1:1}arr=[a1,b1];arr=arr.sort();if(arr[0]==a1){return desc?1:-1}return desc?-1:1});browser.showFiles(callBack,selected);browser.initFiles()};browser.humanSize=function(a){if(a<1024){a=a.toString()+" B"}else{if(a<1048576){a/=1024;a=parseInt(a).toString()+" KB"}else{if(a<1073741824){a/=1048576;a=parseInt(a).toString()+" MB"}else{if(a<1099511627776){a/=1073741824;a=parseInt(a).toString()+" GB"}else{a/=1099511627776;a=parseInt(a).toString()+" TB"}}}}return a};browser.baseGetData=function(a){var b="browse.php?type="+encodeURIComponent(this.type)+"&lng="+this.lang;if(a){b+="&act="+a}if(this.cms){b+="&cms="+this.cms}return b};browser.label=function(b,c){var a=this.labels[b]?this.labels[b]:b;if(c){$.each(c,function(d,e){a=a.replace("{"+d+"}",e)})}return a};browser.check4errors=function(a,c){if(!a.error){return false}var b;if(a.error.join){b=a.error.join("\n")}else{b=a.error}browser.alert(b,c);return true};browser.post=function(a,c){var b='
';$.each(c,function(d,e){if($.isArray(e)){$.each(e,function(g,f){b+=''})}else{b+=''}});b+="
";$("#dialog").html(b);$("#dialog").css("display","block");$("#postForm").get(0).submit()};browser.fadeFiles=function(){$("#files > div").css({opacity:"0.4",filter:"alpha(opacity=40)"})}; \ No newline at end of file diff --git a/js/000._jquery.js b/js/000._jquery.js index eb6a596..046e93a 100644 --- a/js/000._jquery.js +++ b/js/000._jquery.js @@ -1,18 +1,4 @@ -/*! - * jQuery JavaScript Library v1.6.1 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu May 12 15:04:36 2011 -0400 - */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,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=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,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=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};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=n.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.6.1",length:0,size:function(){return this.length},toArray:function(){return D.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)?C.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(),y.done(a);return this},eq:function(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(D.apply(this,arguments),"slice",D.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:C,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(;j0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw 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(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},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(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.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:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([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&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=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=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.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.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),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=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=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},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.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}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0: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=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?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]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},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.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)}})),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 x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem -)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.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]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),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]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.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!!k(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 bc[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=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||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=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":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=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=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(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.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:[]}},l.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&&(l.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.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[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}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.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 k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-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||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());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(W(c[0])||W(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),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.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 Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};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
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},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){return this.each(function(){f(this).wrapAll(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(arguments[0]);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(arguments[0]).toArray());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){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1>");try{for(var c=0,d=this.length;c1&&l0?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=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.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;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,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.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.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("
").append(c.replace(bO,"")).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||bP.test(this.nodeName)||bJ.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(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(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?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},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}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),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?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),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._Deferred(),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=bI.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.done,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(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.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]!=="*"?", */*; 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=b$(bV,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){status<2?w(-1,z):f.error(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(bE,"+")}}),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=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";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),m.text=h.responseText;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,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.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(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file +/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f +}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("').prependTo(document.body);$("#loading").html(this.label("Uploading file..."));$("#loading").css("display","inline");a.submit();$("#uploadResponse").load(function(){var b=$(this).contents().find("body").html();$("#loading").css("display","none");b=b.split("\n");var c=[],d=[];$.each(b,function(e,f){if(f.substr(0,1)=="/"){c[c.length]=f.substr(1,f.length-1)}else{d[d.length]=f}});if(d.length){browser.alert(d.join("\n"))}if(!c.length){c=null}browser.refresh(c);$("#upload").detach();setTimeout(function(){$("#uploadResponse").detach()},1);browser.initUploadButton()})};browser.maximize=function(f){if(window.opener){window.moveTo(0,0);b=screen.availWidth;i=screen.availHeight;if($.agent.opera){i-=50}window.resizeTo(b,i)}else{if(browser.opener.TinyMCE){var g,d,a;$("iframe",window.parent.document).each(function(){if(/^mce_\d+_ifr$/.test($(this).attr("id"))){a=parseInt($(this).attr("id").replace(/^mce_(\d+)_ifr$/,"$1"));g=$("#mce_"+a,window.parent.document);d=$("#mce_"+a+"_ifr",window.parent.document)}});if($(f).hasClass("selected")){$(f).removeClass("selected");g.css({left:browser.maximizeMCE.left+"px",top:browser.maximizeMCE.top+"px",width:browser.maximizeMCE.width+"px",height:browser.maximizeMCE.height+"px"});d.css({width:browser.maximizeMCE.width-browser.maximizeMCE.Hspace+"px",height:browser.maximizeMCE.height-browser.maximizeMCE.Vspace+"px"})}else{$(f).addClass("selected");browser.maximizeMCE={width:parseInt(g.css("width")),height:parseInt(g.css("height")),left:g.position().left,top:g.position().top,Hspace:parseInt(g.css("width"))-parseInt(d.css("width")),Vspace:parseInt(g.css("height"))-parseInt(d.css("height"))};var b=$(window.parent).width();var i=$(window.parent).height();g.css({left:$(window.parent).scrollLeft()+"px",top:$(window.parent).scrollTop()+"px",width:b+"px",height:i+"px"});d.css({width:b-browser.maximizeMCE.Hspace+"px",height:i-browser.maximizeMCE.Vspace+"px"})}}else{if($("iframe",window.parent.document).get(0)){var e=$('iframe[name="'+window.name+'"]',window.parent.document);var h=e.parent();var b,i;if($(f).hasClass("selected")){$(f).removeClass("selected");if(browser.maximizeThread){clearInterval(browser.maximizeThread);browser.maximizeThread=null}if(browser.maximizeW){browser.maximizeW=null}if(browser.maximizeH){browser.maximizeH=null}$.each($("*",window.parent.document).get(),function(j,k){k.style.display=browser.maximizeDisplay[j]});e.css({display:browser.maximizeCSS.display,position:browser.maximizeCSS.position,left:browser.maximizeCSS.left,top:browser.maximizeCSS.top,width:browser.maximizeCSS.width,height:browser.maximizeCSS.height});$(window.parent).scrollLeft(browser.maximizeLest);$(window.parent).scrollTop(browser.maximizeTop)}else{$(f).addClass("selected");browser.maximizeCSS={display:e.css("display"),position:e.css("position"),left:e.css("left"),top:e.css("top"),width:e.outerWidth()+"px",height:e.outerHeight()+"px"};browser.maximizeTop=$(window.parent).scrollTop();browser.maximizeLeft=$(window.parent).scrollLeft();browser.maximizeDisplay=[];$.each($("*",window.parent.document).get(),function(j,k){browser.maximizeDisplay[j]=$(k).css("display");$(k).css("display","none")});e.css("display","block");e.parents().css("display","block");var c=function(){b=$(window.parent).width();i=$(window.parent).height();if(!browser.maximizeW||(browser.maximizeW!=b)||!browser.maximizeH||(browser.maximizeH!=i)){browser.maximizeW=b;browser.maximizeH=i;e.css({width:b+"px",height:i+"px"});browser.resize()}};e.css("position","absolute");if((e.offset().left==e.position().left)&&(e.offset().top==e.position().top)){e.css({left:"0",top:"0"})}else{e.css({left:-e.offset().left+"px",top:-e.offset().top+"px"})}c();browser.maximizeThread=setInterval(c,250)}}}}};browser.refresh=function(a){this.fadeFiles();$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:browser.dir},async:false,success:function(b){if(browser.check4errors(b)){return}browser.dirWritable=b.dirWritable;browser.files=b.files?b.files:[];browser.orderFiles(null,a);browser.statusDir()},error:function(){$("#files > div").css({opacity:"",filter:""});$("#files").html(browser.label("Unknown error."))}})};browser.initSettings=function(){if(!this.shows.length){var d=$('#show input[type="checkbox"]').toArray();$.each(d,function(f,e){browser.shows[f]=e.name})}var a=this.shows;if(!$.$.kuki.isSet("showname")){$.$.kuki.set("showname","on");$.each(a,function(e,f){if(f!="name"){$.$.kuki.set("show"+f,"off")}})}$('#show input[type="checkbox"]').click(function(){var e=$(this).get(0).checked?"on":"off";$.$.kuki.set("show"+$(this).get(0).name,e);if($(this).get(0).checked){$("#files .file div."+$(this).get(0).name).css("display","block")}else{$("#files .file div."+$(this).get(0).name).css("display","none")}});$.each(a,function(e,g){var f=($.$.kuki.get("show"+g)=="on")?"checked":"";$('#show input[name="'+g+'"]').get(0).checked=f});if(!this.orders.length){var c=$('#order input[type="radio"]').toArray();$.each(c,function(f,e){browser.orders[f]=e.value})}var b=this.orders;if(!$.$.kuki.isSet("order")){$.$.kuki.set("order","name")}if(!$.$.kuki.isSet("orderDesc")){$.$.kuki.set("orderDesc","off")}$('#order input[value="'+$.$.kuki.get("order")+'"]').get(0).checked=true;$('#order input[name="desc"]').get(0).checked=($.$.kuki.get("orderDesc")=="on");$('#order input[type="radio"]').click(function(){$.$.kuki.set("order",$(this).get(0).value);browser.orderFiles()});$('#order input[name="desc"]').click(function(){$.$.kuki.set("orderDesc",$(this).get(0).checked?"on":"off");browser.orderFiles()});if(!$.$.kuki.isSet("view")){$.$.kuki.set("view","thumbs")}if($.$.kuki.get("view")=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}$('#view input[value="'+$.$.kuki.get("view")+'"]').get(0).checked=true;$("#view input").click(function(){var e=$(this).attr("value");if($.$.kuki.get("view")!=e){$.$.kuki.set("view",e);if(e=="list"){$("#show input").each(function(){this.checked=true});$("#show input").each(function(){this.disabled=true})}else{$.each(browser.shows,function(f,g){$('#show input[name="'+g+'"]').get(0).checked=($.$.kuki.get("show"+g)=="on")});$("#show input").each(function(){this.disabled=false})}}browser.refresh()})};browser.initFiles=function(){$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});$("#files").unbind();$("#files").scroll(function(){browser.hideDialog()});$(".file").unbind();$(".file").click(function(a){$.$.unselect();browser.selectFile($(this),a)});$("#files .file").rightClick(function(a,b){$.$.unselect();browser.menuFile($(a),b)});$(".file").dblclick(function(){$.$.unselect();browser.returnFile($(this))});$(".file").mouseup(function(){$.$.unselect()});$(".file").mouseout(function(){$.$.unselect()});$.each(this.shows,function(a,c){var b=($.$.kuki.get("show"+c)=="off")?"none":"block";$("#files .file div."+c).css("display",b)});this.statusDir()};browser.showFiles=function(b,a){this.fadeFiles();setTimeout(function(){var c="";$.each(browser.files,function(f,e){var d=[];$.each(e,function(h,j){d[d.length]=h+"|"+j});d=$.$.md5(d.join("|"));if($.$.kuki.get("view")=="list"){if(!f){c+='
'}var g=$.$.getFileExtension(e.name);if(e.thumb){g=".image"}else{if(!g.length||!e.smallIcon){g="."}}g="themes/"+browser.theme+"/img/files/small/"+g+".png";c+='";if(f==browser.files.length-1){c+="
'+$.$.htmlData(e.name)+''+e.date+''+browser.humanSize(e.size)+"
"}}else{if(e.thumb){var g=browser.baseGetData("thumb")+"&file="+encodeURIComponent(e.name)+"&dir="+encodeURIComponent(browser.dir)+"&stamp="+d}else{if(e.smallThumb){var g=browser.uploadURL+"/"+browser.dir+"/"+e.name;g=$.$.escapeDirs(g).replace(/\'/g,"%27")}else{var g=e.bigIcon?$.$.getFileExtension(e.name):".";if(!g.length){g="."}g="themes/"+browser.theme+"/img/files/big/"+g+".png"}}c+='
'+$.$.htmlData(e.name)+'
'+e.date+'
'+browser.humanSize(e.size)+"
"}});$("#files").html("
"+c+"
");$.each(browser.files,function(e,d){var f=$("#files .file").get(e);$(f).data(d);if($.$.inArray(d.name,a)||((typeof a!="undefined")&&!a.push&&(d.name==a))){$(f).addClass("selected")}});$("#files > div").css({opacity:"",filter:""});if(b){b()}browser.initFiles()},200)};browser.selectFile=function(b,f){if(f.ctrlKey||f.metaKey){if(b.hasClass("selected")){b.removeClass("selected")}else{b.addClass("selected")}var c=$(".file.selected").get();var a=0;if(!c.length){this.statusDir()}else{$.each(c,function(g,e){a+=parseInt($(e).data("size"))});a=this.humanSize(a);if(c.length>1){$("#fileinfo").html(c.length+" "+this.label("selected files")+" ("+a+")")}else{var d=$(c[0]).data();$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}}}else{var d=b.data();$(".file").removeClass("selected");b.addClass("selected");$("#fileinfo").html(d.name+" ("+this.humanSize(d.size)+", "+d.date+")")}};browser.selectAll=function(c){if((!c.ctrlKey&&!c.metaKey)||((c.keyCode!=65)&&(c.keyCode!=97))){return false}var b=$(".file").get();if(b.length){var a=0;$.each(b,function(e,d){if(!$(d).hasClass("selected")){$(d).addClass("selected")}a+=parseInt($(d).data("size"))});a=this.humanSize(a);$("#fileinfo").html(b.length+" "+this.label("selected files")+" ("+a+")")}return true};browser.returnFile=function(c){var a=c.substr?c:browser.uploadURL+"/"+browser.dir+"/"+c.data("name");a=$.$.escapeDirs(a);if(this.opener.CKEditor){this.opener.CKEditor.object.tools.callFunction(this.opener.CKEditor.funcNum,a,"");window.close()}else{if(this.opener.FCKeditor){window.opener.SetUrl(a);window.close()}else{if(this.opener.TinyMCE){var d=tinyMCEPopup.getWindowArg("window");d.document.getElementById(tinyMCEPopup.getWindowArg("input")).value=a;if(d.getImageData){d.getImageData()}if(typeof(d.ImageDialog)!="undefined"){if(d.ImageDialog.getImageData){d.ImageDialog.getImageData()}if(d.ImageDialog.showPreviewImage){d.ImageDialog.showPreviewImage(a)}}tinyMCEPopup.close()}else{if(this.opener.callBack){if(window.opener&&window.opener.KCFinder){this.opener.callBack(a);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBack(a)}}else{if(this.opener.callBackMultiple){if(window.opener&&window.opener.KCFinder){this.opener.callBackMultiple([a]);window.close()}if(window.parent&&window.parent.KCFinder){var b=$('#toolbar a[href="kcact:maximize"]');if(b.hasClass("selected")){this.maximize(b)}this.opener.callBackMultiple([a])}}}}}}};browser.returnFiles=function(b){if(this.opener.callBackMultiple&&b.length){var a=[];$.each(b,function(d,c){a[d]=browser.uploadURL+"/"+browser.dir+"/"+$(c).data("name");a[d]=$.$.escapeDirs(a[d])});this.opener.callBackMultiple(a);if(window.opener){window.close()}}};browser.returnThumbnails=function(c){if(this.opener.callBackMultiple){var b=[];var a=0;$.each(c,function(e,d){if($(d).data("thumb")){b[a]=browser.thumbsURL+"/"+browser.dir+"/"+$(d).data("name");b[a]=$.$.escapeDirs(b[a++])}});this.opener.callBackMultiple(b);if(window.opener){window.close()}}};browser.menuFile=function(c,h){var f=c.data();var k=this.dir+"/"+f.name;var b=$(".file.selected").get();var g="";if(c.hasClass("selected")&&b.length&&(b.length>1)){var a=false;var d=0;var j;$.each(b,function(l,e){j=$(e).data();if(j.thumb){a=true}if(!f.writable){d++}});if(this.opener.callBackMultiple){g+=''+this.label("Select")+"";if(a){g+=''+this.label("Select Thumbnails")+""}}if(f.thumb||f.smallThumb||this.support.zip){g+=(g.length?'
':"");if(f.thumb||f.smallThumb){g+=''+this.label("View")+""}if(this.support.zip){g+=(g.length?'
':"")+''+this.label("Download")+""}}if(this.access.files.copy||this.access.files.move){g+=(g.length?'
':"")+''+this.label("Add to Clipboard")+""}if(this.access.files["delete"]){g+=(g.length?'
':"")+'"+this.label("Delete")+""}if(g.length){g='";$("#dialog").html(g);this.showMenu(h)}else{return}$('.menu a[href="kcact:pick"]').click(function(){browser.returnFiles(b);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){browser.returnThumbnails(b);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();var e=[];$.each(b,function(m,l){e[m]=$(l).data("name")});browser.post(browser.baseGetData("downloadSelected"),{dir:browser.dir,files:e});return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){browser.hideDialog();var e="";$.each(b,function(n,m){var o=$(m).data();var l=false;for(n=0;n div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(e){browser.confirm(browser.label("{count} selected files are not removable. Do you want to delete the rest?",{count:e}),l)}else{browser.confirm(browser.label("Are you sure you want to delete all selected files?"),l)}return false})}else{g+='";$("#dialog").html(g);this.showMenu(h);$('.menu a[href="kcact:pick"]').click(function(){browser.returnFile(c);browser.hideDialog();return false});$('.menu a[href="kcact:pick_thumb"]').click(function(){var e=browser.thumbsURL+"/"+browser.dir+"/"+f.name;browser.returnFile(e);browser.hideDialog();return false});$('.menu a[href="kcact:download"]').click(function(){var e='
';$("#dialog").html(e);$("#downloadForm input").get(0).value=browser.dir;$("#downloadForm input").get(1).value=f.name;$("#downloadForm").submit();return false});$('.menu a[href="kcact:clpbrdadd"]').click(function(){for(i=0;i
');$("#dialog img").attr({src:url,title:n.name}).fadeIn("fast",function(){var q=$("#dialog").outerWidth();var s=$("#dialog").outerHeight();var r=$(window).width()-30;var t=$(window).height()-30;if((q>r)||(s>t)){if((r/t)>(q/s)){r=parseInt((q*t)/s)}else{if((r/t)<(q/s)){t=parseInt((s*r)/q)}}$("#dialog img").attr({width:r,height:t})}$("#dialog").unbind("click");$("#dialog").click(function(u){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(v){return !browser.selectAll(v)});if(browser.ssImage){browser.selectFile($(browser.ssImage),u)}});browser.showDialog();var p=[];$.each(browser.files,function(v,u){if(u.thumb||u.smallThumb){p[p.length]=u}});if(p.length){$.each(p,function(u,v){if(v.name==n.name){$(document).unbind("keydown");$(document).keydown(function(x){if(p.length>1){if(!browser.lock&&(x.keyCode==37)){var w=u?p[u-1]:p[p.length-1];browser.lock=true;e(w)}if(!browser.lock&&(x.keyCode==39)){var w=(u>=p.length-1)?p[0]:p[u+1];browser.lock=true;e(w)}}if(x.keyCode==27){browser.hideDialog();$(document).unbind("keydown");$(document).keydown(function(y){return !browser.selectAll(y)})}})}})}})};if(m.complete){o()}else{m.onload=o}};e(f);return false})};browser.initFolders=function(){$("#folders").scroll(function(){browser.hideDialog()});$("div.folder > a").unbind();$("div.folder > a").bind("click",function(){browser.hideDialog();return false});$("div.folder > a > span.brace").unbind();$("div.folder > a > span.brace").click(function(){if($(this).hasClass("opened")||$(this).hasClass("closed")){browser.expandDir($(this).parent())}});$("div.folder > a > span.folder").unbind();$("div.folder > a > span.folder").click(function(){browser.changeDir($(this).parent())});$("div.folder > a > span.folder").rightClick(function(d,f){$.$.unselect();browser.menuDir($(d).parent(),f)});if($.agent.msie&&!$.agent.opera&&!$.agent.chromeframe&&(parseInt($.agent.msie)<8)){var b=$("div.folder").get();var a=$("body").get(0);var c;$.each(b,function(d,e){c=document.createElement("div");c.style.display="inline";c.style.margin=c.style.border=c.style.padding="0";c.innerHTML='
'+$(e).html()+"
";a.appendChild(c);$(e).css("width",$(c).innerWidth()+"px");a.removeChild(c)})}};browser.setTreeData=function(b,c){if(!c){c=""}else{if(c.length&&(c.substr(c.length-1,1)!="/")){c+="/"}}c+=b.name;var a='#folders a[href="kcdir:/'+$.$.escapeDirs(c)+'"]';$(a).data({name:b.name,path:c,readable:b.readable,writable:b.writable,removable:b.removable,hasDirs:b.hasDirs});$(a+" span.folder").addClass(b.current?"current":"regular");if(b.dirs&&b.dirs.length){$(a+" span.brace").addClass("opened");$.each(b.dirs,function(e,d){browser.setTreeData(d,c+"/")})}else{if(b.hasDirs){$(a+" span.brace").addClass("closed")}}};browser.buildTree=function(a,d){if(!d){d=""}d+=a.name;var c='
 '+$.$.htmlData(a.name)+"";if(a.dirs){c+='
';for(var b=0;b'+this.label("Loading folders...")+"
");$("#loadingDirs").css("display","none");$("#loadingDirs").show(200,function(){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("expand"),data:{dir:b},async:false,success:function(e){$("#loadingDirs").hide(200,function(){$("#loadingDirs").detach()});if(browser.check4errors(e)){return}var d="";$.each(e.dirs,function(g,f){d+='"});if(d.length){a.parent().append('
'+d+"
");var c=$(a.parent().children(".folders").first());c.css("display","none");$(c).show(500);$.each(e.dirs,function(g,f){browser.setTreeData(f,b)})}if(e.dirs.length){a.children(".brace").removeClass("closed");a.children(".brace").addClass("opened")}else{a.children(".brace").removeClass("opened");a.children(".brace").removeClass("closed")}browser.initFolders();browser.initDropUpload()},error:function(){$("#loadingDirs").detach();browser.alert(browser.label("Unknown error."))}})})}}}};browser.changeDir=function(a){if(a.children("span.folder").hasClass("regular")){$("div.folder > a > span.folder").removeClass("current");$("div.folder > a > span.folder").removeClass("regular");$("div.folder > a > span.folder").addClass("regular");a.children("span.folder").removeClass("regular");a.children("span.folder").addClass("current");$("#files").html(browser.label("Loading files..."));$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("chDir"),data:{dir:a.data("path")},async:false,success:function(b){if(browser.check4errors(b)){return}browser.files=b.files;browser.orderFiles();browser.dir=a.data("path");browser.dirWritable=b.dirWritable;var c="KCFinder: /"+browser.dir;document.title=c;if(browser.opener.TinyMCE){tinyMCEPopup.editor.windowManager.setTitle(window,c)}browser.statusDir()},error:function(){$("#files").html(browser.label("Unknown error."))}})}};browser.statusDir=function(){for(var b=0,a=0;b"+this.label("Copy {count} files",{count:this.clipboard.length})+""}if(this.access.files.move){b+='"+this.label("Move {count} files",{count:this.clipboard.length})+""}if(this.access.files.copy||this.access.files.move){b+='
'}}b+=''+this.label("Refresh")+"";if(this.support.zip){b+='
'+this.label("Download")+""}if(this.access.dirs.create||this.access.dirs.rename||this.access.dirs["delete"]){b+='
'}if(this.access.dirs.create){b+='"+this.label("New Subfolder...")+""}if(this.access.dirs.rename){b+='"+this.label("Rename...")+""}if(this.access.dirs["delete"]){b+='"+this.label("Delete")+""}b+="
";$("#dialog").html(b);this.showMenu(d);$("div.folder > a > span.folder").removeClass("context");if(a.children("span.folder").hasClass("regular")){a.children("span.folder").addClass("context")}if(this.clipboard&&this.clipboard.length&&c.writable){$('.menu a[href="kcact:cpcbd"]').click(function(){browser.hideDialog();browser.copyClipboard(c.path);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){browser.hideDialog();browser.moveClipboard(c.path);return false})}$('.menu a[href="kcact:refresh"]').click(function(){browser.hideDialog();browser.refreshDir(a);return false});$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.post(browser.baseGetData("downloadDir"),{dir:c.path});return false});$('.menu a[href="kcact:mkdir"]').click(function(f){if(!c.writable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newDir","",browser.baseGetData("newDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(){browser.refreshDir(a);browser.initDropUpload();if(!c.hasDirs){a.data("hasDirs",true);a.children("span.brace").addClass("closed")}});return false});$('.menu a[href="kcact:mvdir"]').click(function(f){if(!c.removable){return false}browser.hideDialog();browser.fileNameDialog(f,{dir:c.path},"newName",c.name,browser.baseGetData("renameDir"),{title:"New folder name:",errEmpty:"Please enter new folder name.",errSlash:"Unallowable characters in folder name.",errDot:"Folder name shouldn't begins with '.'"},function(e){if(!e.name){browser.alert(browser.label("Unknown error."));return}var g=(c.path==browser.dir);a.children("span.folder").html($.$.htmlData(e.name));a.data("name",e.name);a.data("path",$.$.dirname(c.path)+"/"+e.name);if(g){browser.dir=a.data("path")}browser.initDropUpload()},true);return false});$('.menu a[href="kcact:rmdir"]').click(function(){if(!c.removable){return false}browser.hideDialog();browser.confirm("Are you sure you want to delete this folder and all its content?",function(e){$.ajax({type:"POST",dataType:"json",url:browser.baseGetData("deleteDir"),data:{dir:c.path},async:false,success:function(f){if(e){e()}if(browser.check4errors(f)){return}a.parent().hide(500,function(){var h=a.parent().parent();var g=h.parent().children("a").first();a.parent().detach();if(!h.children("div.folder").get(0)){g.children("span.brace").first().removeClass("opened");g.children("span.brace").first().removeClass("closed");g.parent().children(".folders").detach();g.data("hasDirs",false)}if(g.data("path")==browser.dir.substr(0,g.data("path").length)){browser.changeDir(g)}browser.initDropUpload()})},error:function(){if(e){e()}browser.alert(browser.label("Unknown error."))}})});return false})};browser.refreshDir=function(a){var b=a.data("path");if(a.children(".brace").hasClass("opened")||a.children(".brace").hasClass("closed")){a.children(".brace").removeClass("opened");a.children(".brace").addClass("closed")}a.parent().children(".folders").first().detach();if(b==browser.dir.substr(0,b.length)){browser.changeDir(a)}browser.expandDir(a);return true};browser.initClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var b=0;$.each(this.clipboard,function(c,d){b+=parseInt(d.size)});b=this.humanSize(b);$("#clipboard").html('
');var a=function(){$("#clipboard").css({left:$(window).width()-$("#clipboard").outerWidth()+"px",top:$(window).height()-$("#clipboard").outerHeight()+"px"})};a();$("#clipboard").css("display","block");$(window).unbind();$(window).resize(function(){browser.resize();a()})};browser.openClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}if($('.menu a[href="kcact:cpcbd"]').html()){$("#clipboard").removeClass("selected");this.hideDialog();return}var a='";setTimeout(function(){$("#clipboard").addClass("selected");$("#dialog").html(a);$('.menu a[href="kcact:download"]').click(function(){browser.hideDialog();browser.downloadClipboard();return false});$('.menu a[href="kcact:cpcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.copyClipboard(browser.dir);return false});$('.menu a[href="kcact:mvcbd"]').click(function(){if(!browser.dirWritable){return false}browser.hideDialog();browser.moveClipboard(browser.dir);return false});$('.menu a[href="kcact:rmcbd"]').click(function(){browser.hideDialog();browser.confirm(browser.label("Are you sure you want to delete all files in the Clipboard?"),function(e){if(e){e()}browser.deleteClipboard()});return false});$('.menu a[href="kcact:clrcbd"]').click(function(){browser.hideDialog();browser.clearClipboard();return false});var c=$(window).width()-$("#dialog").outerWidth();var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();var d=b+$("#dialog").outerTopSpace();$(".menu .list").css("max-height",d+"px");var b=$(window).height()-$("#dialog").outerHeight()-$("#clipboard").outerHeight();$("#dialog").css({left:(c-4)+"px",top:b+"px"});$("#dialog").fadeIn()},1)};browser.removeFromClipboard=function(a){if(!this.clipboard||!this.clipboard[a]){return false}if(this.clipboard.length==1){this.clearClipboard();this.hideDialog();return}if(a div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not readable. Do you want to copy the rest?",{count:a}),c)}else{c()}};browser.moveClipboard=function(b){if(!this.clipboard||!this.clipboard.length){return}var d=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not movable. Do you want to move the rest?",{count:a}),c)}else{c()}};browser.deleteClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var c=[];var a=0;for(i=0;i div").css({opacity:"",filter:""});browser.alert(browser.label("Unknown error."))}})};if(a){browser.confirm(browser.label("{count} files in the Clipboard are not removable. Do you want to delete the rest?",{count:a}),b)}else{b()}};browser.downloadClipboard=function(){if(!this.clipboard||!this.clipboard.length){return}var a=[];for(i=0;i a"),e="------multipartdropuploadboundary"+(new Date).getTime(),d,k=function(q){if(q.preventDefault){q.preventDefault()}$("#files").addClass("drag");return false},p=function(q){if(q.preventDefault){q.preventDefault()}return false},h=function(q){if(q.preventDefault){q.preventDefault()}$("#files").removeClass("drag");return false},j=function(s){if(s.preventDefault){s.preventDefault()}if(s.stopPropagation){s.stopPropagation()}$("#files").removeClass("drag");if(!$("#folders span.current").first().parent().data("writable")){browser.alert("Cannot write to upload folder.");return false}l+=s.dataTransfer.files.length;for(var r=0;r$(window).height()){d=$(window).height()-$(this).outerHeight()}if(c+$(this).outerWidth()>$(window).width()){c=$(window).width()-$(this).outerWidth()}$(this).css({top:d,left:c})};browser.showDialog=function(d){$("#dialog").css({left:0,top:0});this.shadow();if($("#dialog div.box")&&!$("#dialog div.title").get(0)){var a=$("#dialog div.box").html();var f=$("#dialog").data("title")?$("#dialog").data("title"):"";a='
'+f+"
"+a;$("#dialog div.box").html(a);$("#dialog div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#dialog div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#dialog div.title span.close").click(function(){browser.hideDialog();browser.hideAlert()})}$("#dialog").css("display","block");if(d){var c=d.pageX-parseInt($("#dialog").outerWidth()/2);var b=d.pageY-parseInt($("#dialog").outerHeight()/2);if(c<0){c=0}if(b<0){b=0}if(($("#dialog").outerWidth()+c)>$(window).width()){c=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+b)>$(window).height()){b=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:c+"px",top:b+"px"})}else{$("#dialog").css({left:parseInt(($(window).width()-$("#dialog").outerWidth())/2)+"px",top:parseInt(($(window).height()-$("#dialog").outerHeight())/2)+"px"})}$(document).unbind("keydown");$(document).keydown(function(g){if(g.keyCode==27){browser.hideDialog()}})};browser.hideDialog=function(){this.unshadow();if($("#clipboard").hasClass("selected")){$("#clipboard").removeClass("selected")}$("#dialog").css("display","none");$("div.folder > a > span.folder").removeClass("context");$("#dialog").html("");$("#dialog").data("title",null);$("#dialog").unbind();$("#dialog").click(function(){return false});$(document).unbind("keydown");$(document).keydown(function(a){return !browser.selectAll(a)});browser.hideAlert()};browser.showAlert=function(d){$("#alert").css({left:0,top:0});if(typeof d=="undefined"){d=true}if(d){this.shadow()}var c=parseInt(($(window).width()-$("#alert").outerWidth())/2),b=parseInt(($(window).height()-$("#alert").outerHeight())/2);var a=$(window).height();if(b<0){b=0}$("#alert").css({left:c+"px",top:b+"px",display:"block"});if($("#alert").outerHeight()>a){$("#alert div.message").css({height:a-$("#alert div.title").outerHeight()-$("#alert div.ok").outerHeight()-20+"px"})}$(document).unbind("keydown");$(document).keydown(function(f){if(f.keyCode==27){browser.hideDialog();browser.hideAlert();$(document).unbind("keydown");$(document).keydown(function(g){return !browser.selectAll(g)})}})};browser.hideAlert=function(a){if(typeof a=="undefined"){a=true}if(a){this.unshadow()}$("#alert").css("display","none");$("#alert").html("");$("#alert").data("title",null)};browser.alert=function(b,c){b=b.replace(/\r?\n/g,"
");var a=$("#alert").data("title")?$("#alert").data("title"):browser.label("Attention");$("#alert").html('
'+a+'
'+b+'
");$("#alert div.ok button").click(function(){browser.hideAlert(c)});$("#alert div.title span.close").mousedown(function(){$(this).addClass("clicked")});$("#alert div.title span.close").mouseup(function(){$(this).removeClass("clicked")});$("#alert div.title span.close").click(function(){browser.hideAlert(c)});browser.showAlert(c)};browser.confirm=function(a,b){$("#dialog").data("title",browser.label("Question"));$("#dialog").html('
'+browser.label(a)+'
");browser.showDialog();$("#dialog div.buttons button").first().click(function(){browser.hideDialog()});$("#dialog div.buttons button").last().click(function(){if(b){b(function(){browser.hideDialog()})}else{browser.hideDialog()}});$("#dialog div.buttons button").get(1).focus()};browser.shadow=function(){$("#shadow").css("display","block")};browser.unshadow=function(){$("#shadow").css("display","none")};browser.showMenu=function(c){var b=c.pageX;var a=c.pageY;if(($("#dialog").outerWidth()+b)>$(window).width()){b=$(window).width()-$("#dialog").outerWidth()}if(($("#dialog").outerHeight()+a)>$(window).height()){a=$(window).height()-$("#dialog").outerHeight()}$("#dialog").css({left:b+"px",top:a+"px",display:"none"});$("#dialog").fadeIn()};browser.fileNameDialog=function(e,post,inputName,inputValue,url,labels,callBack,selectAll){var html='

';$("#dialog").html(html);$("#dialog").data("title",this.label(labels.title));$('#dialog input[name="'+inputName+'"]').attr("value",inputValue);$("#dialog").unbind();$("#dialog").click(function(){return false});$("#dialog form").submit(function(){var name=this.elements[0];name.value=$.trim(name.value);if(name.value==""){browser.alert(browser.label(labels.errEmpty),false);name.focus();return}else{if(/[\/\\]/g.test(name.value)){browser.alert(browser.label(labels.errSlash),false);name.focus();return}else{if(name.value.substr(0,1)=="."){browser.alert(browser.label(labels.errDot),false);name.focus();return}}}eval("post."+inputName+" = name.value;");$.ajax({type:"POST",dataType:"json",url:url,data:post,async:false,success:function(data){if(browser.check4errors(data,false)){return}if(callBack){callBack(data)}browser.hideDialog()},error:function(){browser.alert(browser.label("Unknown error."),false)}});return false});browser.showDialog(e);$("#dialog").css("display","block");$('#dialog input[type="submit"]').click(function(){return $("#dialog form").submit()});var field=$('#dialog input[type="text"]');var value=field.attr("value");if(!selectAll&&/^(.+)\.[^\.]+$/.test(value)){value=value.replace(/^(.+)\.[^\.]+$/,"$1");field.selection(0,value.length)}else{field.get(0).focus();field.get(0).select()}};browser.orderFiles=function(callBack,selected){var order=$.$.kuki.get("order");var desc=($.$.kuki.get("orderDesc")=="on");if(!browser.files||!browser.files.sort){browser.files=[]}browser.files=browser.files.sort(function(a,b){var a1,b1,arr;if(!order){order="name"}if(order=="date"){a1=a.mtime;b1=b.mtime}else{if(order=="type"){a1=$.$.getFileExtension(a.name);b1=$.$.getFileExtension(b.name)}else{if(order=="size"){a1=a.size;b1=b.size}else{eval("a1 = a."+order+".toLowerCase(); b1 = b."+order+".toLowerCase();")}}}if((order=="size")||(order=="date")){if(a1b1){return desc?-1:1}}if(a1==b1){a1=a.name.toLowerCase();b1=b.name.toLowerCase();arr=[a1,b1];arr=arr.sort();return(arr[0]==a1)?-1:1}arr=[a1,b1];arr=arr.sort();if(arr[0]==a1){return desc?1:-1}return desc?-1:1});browser.showFiles(callBack,selected);browser.initFiles()};browser.humanSize=function(a){if(a<1024){a=a.toString()+" B"}else{if(a<1048576){a/=1024;a=parseInt(a).toString()+" KB"}else{if(a<1073741824){a/=1048576;a=parseInt(a).toString()+" MB"}else{if(a<1099511627776){a/=1073741824;a=parseInt(a).toString()+" GB"}else{a/=1099511627776;a=parseInt(a).toString()+" TB"}}}}return a};browser.baseGetData=function(a){var b="browse.php?type="+encodeURIComponent(this.type)+"&lng="+this.lang;if(a){b+="&act="+a}if(this.cms){b+="&cms="+this.cms}return b};browser.label=function(b,c){var a=this.labels[b]?this.labels[b]:b;if(c){$.each(c,function(d,e){a=a.replace("{"+d+"}",e)})}return a};browser.check4errors=function(a,c){if(!a.error){return false}var b;if(a.error.join){b=a.error.join("\n")}else{b=a.error}browser.alert(b,c);return true};browser.post=function(a,c){var b='
';$.each(c,function(d,e){if($.isArray(e)){$.each(e,function(g,f){b+=''})}else{b+=''}});b+="
";$("#dialog").html(b);$("#dialog").css("display","block");$("#postForm").get(0).submit()};browser.fadeFiles=function(){$("#files > div").css({opacity:"0.4",filter:"alpha(opacity=40)"})}; \ No newline at end of file +(function(g,d){function c(k,j){var l,e,n,m=k.nodeName.toLowerCase();return"area"===m?(l=k.parentNode,e=l.name,k.href&&e&&"map"===l.nodeName.toLowerCase()?(n=g("img[usemap=#"+e+"]")[0],!!n&&h(n)):!1):(/input|select|textarea|button|object/.test(m)?!k.disabled:"a"===m?k.href||j:j)&&h(k)}function h(a){return g.expr.filters.visible(a)&&!g(a).parents().addBack().filter(function(){return"hidden"===g.css(this,"visibility")}).length}var f=0,b=/^ui-id-\d+$/;g.ui=g.ui||{},g.extend(g.ui,{version:"1.10.4",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}}),g.fn.extend({focus:function(a){return function(e,j){return"number"==typeof e?this.each(function(){var i=this;setTimeout(function(){g(i).focus(),j&&j.call(i)},e)}):a.apply(this,arguments)}}(g.fn.focus),scrollParent:function(){var a;return a=g.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(g.css(this,"position"))&&/(auto|scroll)/.test(g.css(this,"overflow")+g.css(this,"overflow-y")+g.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(g.css(this,"overflow")+g.css(this,"overflow-y")+g.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!a.length?g(document):a},zIndex:function(j){if(j!==d){return this.css("zIndex",j)}if(this.length){for(var l,k,e=g(this[0]);e.length&&e[0]!==document;){if(l=e.css("position"),("absolute"===l||"relative"===l||"fixed"===l)&&(k=parseInt(e.css("zIndex"),10),!isNaN(k)&&0!==k)){return k}e=e.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++f)})},removeUniqueId:function(){return this.each(function(){b.test(this.id)&&g(this).removeAttr("id")})}}),g.extend(g.expr[":"],{data:g.expr.createPseudo?g.expr.createPseudo(function(a){return function(e){return !!g.data(e,a)}}):function(e,a,j){return !!g.data(e,j[3])},focusable:function(a){return c(a,!isNaN(g.attr(a,"tabindex")))},tabbable:function(a){var i=g.attr(a,"tabindex"),e=isNaN(i);return(e||i>=0)&&c(a,!e)}}),g("").outerWidth(1).jquery||g.each(["Width","Height"],function(j,p){function k(o,a,r,q){return g.each(e,function(){a-=parseFloat(g.css(o,"padding"+this))||0,r&&(a-=parseFloat(g.css(o,"border"+this+"Width"))||0),q&&(a-=parseFloat(g.css(o,"margin"+this))||0)}),a}var e="Width"===p?["Left","Right"]:["Top","Bottom"],m=p.toLowerCase(),l={innerWidth:g.fn.innerWidth,innerHeight:g.fn.innerHeight,outerWidth:g.fn.outerWidth,outerHeight:g.fn.outerHeight};g.fn["inner"+p]=function(a){return a===d?l["inner"+p].call(this):this.each(function(){g(this).css(m,k(this,a)+"px")})},g.fn["outer"+p]=function(n,a){return"number"!=typeof n?l["outer"+p].call(this,n):this.each(function(){g(this).css(m,k(this,n,!0,a)+"px")})}}),g.fn.addBack||(g.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),g("").data("a-b","a").removeData("a-b").data("a-b")&&(g.fn.removeData=function(a){return function(e){return arguments.length?a.call(this,g.camelCase(e)):a.call(this)}}(g.fn.removeData)),g.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),g.support.selectstart="onselectstart" in document.createElement("div"),g.fn.extend({disableSelection:function(){return this.bind((g.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),g.extend(g.ui,{plugin:{add:function(k,j,m){var l,e=g.ui[k].prototype;for(l in m){e.plugins[l]=e.plugins[l]||[],e.plugins[l].push([j,m[l]])}},call:function(l,j,a){var m,k=l.plugins[j];if(k&&l.element[0].parentNode&&11!==l.element[0].parentNode.nodeType){for(m=0;k.length>m;m++){l.options[k[m][0]]&&k[m][1].apply(l.element,a)}}}},hasScroll:function(e,a){if("hidden"===g(e).css("overflow")){return !1}var k=a&&"left"===a?"scrollLeft":"scrollTop",j=!1;return e[k]>0?!0:(e[k]=1,j=e[k]>0,e[k]=0,j)}})})(jQuery);(function(b,d){var a=0,c=Array.prototype.slice,f=b.cleanData;b.cleanData=function(j){for(var g,h=0;null!=(g=j[h]);h++){try{b(g).triggerHandler("remove")}catch(k){}}f(j)},b.widget=function(m,u,j){var g,t,e,p,k={},q=m.split(".")[0];m=m.split(".")[1],g=q+"-"+m,j||(j=u,u=b.Widget),b.expr[":"][g.toLowerCase()]=function(h){return !!b.data(h,g)},b[q]=b[q]||{},t=b[q][m],e=b[q][m]=function(l,h){return this._createWidget?(arguments.length&&this._createWidget(l,h),d):new e(l,h)},b.extend(e,t,{version:j.version,_proto:b.extend({},j),_childConstructors:[]}),p=new u,p.options=b.widget.extend({},p.options),b.each(j,function(h,l){return b.isFunction(l)?(k[h]=function(){var i=function(){return u.prototype[h].apply(this,arguments)},n=function(o){return u.prototype[h].apply(this,o)};return function(){var r,v=this._super,w=this._superApply;return this._super=i,this._superApply=n,r=l.apply(this,arguments),this._super=v,this._superApply=w,r}}(),d):(k[h]=l,d)}),e.prototype=b.widget.extend(p,{widgetEventPrefix:t?p.widgetEventPrefix||m:m},k,{constructor:e,namespace:q,widgetName:m,widgetFullName:g}),t?(b.each(t._childConstructors,function(n,h){var l=h.prototype;b.widget(l.namespace+"."+l.widgetName,e,h._proto)}),delete t._childConstructors):u._childConstructors.push(e),b.widget.bridge(m,e)},b.widget.extend=function(g){for(var m,l,e=c.call(arguments,1),k=0,j=e.length;j>k;k++){for(m in e[k]){l=e[k][m],e[k].hasOwnProperty(m)&&l!==d&&(g[m]=b.isPlainObject(l)?b.isPlainObject(g[m])?b.widget.extend({},g[m],l):b.widget.extend({},l):l)}}return g},b.widget.bridge=function(e,h){var g=h.prototype.widgetFullName||e;b.fn[e]=function(j){var m="string"==typeof j,k=c.call(arguments,1),i=this;return j=!m&&k.length?b.widget.extend.apply(null,[j].concat(k)):j,m?this.each(function(){var l,o=b.data(this,g);return o?b.isFunction(o[j])&&"_"!==j.charAt(0)?(l=o[j].apply(o,k),l!==o&&l!==d?(i=l&&l.jquery?i.pushStack(l.get()):l,!1):d):b.error("no such method '"+j+"' for "+e+" widget instance"):b.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+j+"'")}):this.each(function(){var l=b.data(this,g);l?l.option(j||{})._init():b.data(this,g,new h(j,this))}),i}},b.Widget=function(){},b.Widget._childConstructors=[],b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(h,g){g=b(g||this.defaultElement||this)[0],this.element=b(g),this.uuid=a++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=b.widget.extend({},this.options,this._getCreateOptions(),h),this.bindings=b(),this.hoverable=b(),this.focusable=b(),g!==this&&(b.data(g,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===g&&this.destroy()}}),this.document=b(g.style?g.ownerDocument:g.document||g),this.window=b(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:b.noop,_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(b.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:b.noop,widget:function(){return this.element},option:function(g,h){var l,k,e,j=g;if(0===arguments.length){return b.widget.extend({},this.options)}if("string"==typeof g){if(j={},l=g.split("."),g=l.shift(),l.length){for(k=j[g]=b.widget.extend({},this.options[g]),e=0;l.length-1>e;e++){k[l[e]]=k[l[e]]||{},k=k[l[e]]}if(g=l.pop(),1===arguments.length){return k[g]===d?null:k[g]}k[g]=h}else{if(1===arguments.length){return this.options[g]===d?null:this.options[g]}j[g]=h}}return this._setOptions(j),this},_setOptions:function(g){var h;for(h in g){this._setOption(h,g[h])}return this},_setOption:function(g,h){return this.options[g]=h,"disabled"===g&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!h).attr("aria-disabled",h),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(g,h,k){var j,e=this;"boolean"!=typeof g&&(k=h,h=g,g=!1),k?(h=j=b(h),this.bindings=this.bindings.add(h)):(k=h,h=this.element,j=this.widget()),b.each(k,function(s,p){function o(){return g||e.options.disabled!==!0&&!b(this).hasClass("ui-state-disabled")?("string"==typeof p?e[p]:p).apply(e,arguments):d}"string"!=typeof p&&(o.guid=p.guid=p.guid||o.guid||b.guid++);var i=s.match(/^(\w+)\s*(.*)$/),q=i[1]+e.eventNamespace,m=i[2];m?j.delegate(m,q,o):h.bind(q,o)})},_off:function(g,h){h=(h||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,g.unbind(h).undelegate(h)},_delay:function(h,k){function g(){return("string"==typeof h?j[h]:h).apply(j,arguments)}var j=this;return setTimeout(g,k||0)},_hoverable:function(g){this.hoverable=this.hoverable.add(g),this._on(g,{mouseenter:function(h){b(h.currentTarget).addClass("ui-state-hover")},mouseleave:function(h){b(h.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(g){this.focusable=this.focusable.add(g),this._on(g,{focusin:function(h){b(h.currentTarget).addClass("ui-state-focus")},focusout:function(h){b(h.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(k,h,j){var m,l,g=this.options[k];if(j=j||{},h=b.Event(h),h.type=(k===this.widgetEventPrefix?k:this.widgetEventPrefix+k).toLowerCase(),h.target=this.element[0],l=h.originalEvent){for(m in l){m in h||(h[m]=l[m])}}return this.element.trigger(h,j),!(b.isFunction(g)&&g.apply(this.element[0],[h].concat(j))===!1||h.isDefaultPrevented())}},b.each({show:"fadeIn",hide:"fadeOut"},function(h,g){b.Widget.prototype["_"+h]=function(i,l,k){"string"==typeof l&&(l={effect:l});var e,j=l?l===!0||"number"==typeof l?g:l.effect||g:h;l=l||{},"number"==typeof l&&(l={duration:l}),e=!b.isEmptyObject(l),l.complete=k,l.delay&&i.delay(l.delay),e&&b.effects&&b.effects.effect[j]?i[h](l):j!==h&&i[j]?i[j](l.duration,l.easing,k):i.queue(function(m){b(this)[h](),k&&k.call(i[0]),m()})}})})(jQuery);(function(a){var b=!1;a(document).mouseup(function(){b=!1}),a.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(d){return c._mouseDown(d)}).bind("click."+this.widgetName,function(d){return !0===a.data(d.target,c.widgetName+".preventClickEvent")?(a.removeData(d.target,c.widgetName+".preventClickEvent"),d.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(d){if(!b){this._mouseStarted&&this._mouseUp(d),this._mouseDownEvent=d;var e=this,f=1===d.which,c="string"==typeof this.options.cancel&&d.target.nodeName?a(d.target).closest(this.options.cancel).length:!1;return f&&!c&&this._mouseCapture(d)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(d)&&this._mouseDelayMet(d)&&(this._mouseStarted=this._mouseStart(d)!==!1,!this._mouseStarted)?(d.preventDefault(),!0):(!0===a.data(d.target,this.widgetName+".preventClickEvent")&&a.removeData(d.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(g){return e._mouseMove(g)},this._mouseUpDelegate=function(g){return e._mouseUp(g)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),d.preventDefault(),b=!0,!0)):!0}},_mouseMove:function(c){return a.ui.ie&&(!document.documentMode||9>document.documentMode)&&!c.button?this._mouseUp(c):this._mouseStarted?(this._mouseDrag(c),c.preventDefault()):(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==!1,this._mouseStarted?this._mouseDrag(c):this._mouseUp(c)),!this._mouseStarted)},_mouseUp:function(c){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target===this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),!1},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return !0}})})(jQuery);(function(C,x){function q(c,d,a){return[parseFloat(c[0])*(g.test(c[0])?d/100:1),parseFloat(c[1])*(g.test(c[1])?a/100:1)]}function D(c,a){return parseInt(C.css(c,a),10)||0}function k(c){var a=c[0];return 9===a.nodeType?{width:c.width(),height:c.height(),offset:{top:0,left:0}}:C.isWindow(a)?{width:c.width(),height:c.height(),offset:{top:c.scrollTop(),left:c.scrollLeft()}}:a.preventDefault?{width:0,height:0,offset:{top:a.pageY,left:a.pageX}}:{width:c.outerWidth(),height:c.outerHeight(),offset:c.offset()}}C.ui=C.ui||{};var A,j=Math.max,b=Math.abs,m=Math.round,v=/left|center|right/,z=/top|center|bottom/,B=/[\+\-]\d+(\.[\d]+)?%?/,y=/^\w+/,g=/%$/,w=C.fn.position;C.position={scrollbarWidth:function(){if(A!==x){return A}var a,c,e=C("
"),d=e.children()[0];return C("body").append(e),a=d.offsetWidth,e.css("overflow","scroll"),c=d.offsetWidth,a===c&&(c=e[0].clientWidth),e.remove(),A=a-c},getScrollInfo:function(h){var d=h.isWindow||h.isDocument?"":h.element.css("overflow-x"),f=h.isWindow||h.isDocument?"":h.element.css("overflow-y"),l="scroll"===d||"auto"===d&&h.widthQ?"left":O>0?"right":"center",vertical:0>N?"top":R>0?"bottom":"middle"};L>d&&d>b(O+Q)&&(M.horizontal="center"),H>i&&i>b(R+N)&&(M.vertical="middle"),M.important=j(b(O),b(Q))>j(b(R),b(N))?"horizontal":"vertical",l.using.call(this,P,M)}),I.offset(C.extend(G,{using:E}))})},C.ui.position={fit:{left:function(F,u){var o,G=u.within,d=G.isWindow?G.scrollLeft:G.offset.left,E=G.width,c=F.left-u.collisionPosition.marginLeft,f=d-c,p=c+u.collisionWidth-E-d;u.collisionWidth>E?f>0&&0>=p?(o=F.left+f+u.collisionWidth-E-d,F.left+=f-o):F.left=p>0&&0>=f?d:f>p?d+E-u.collisionWidth:d:f>0?F.left+=f:p>0?F.left-=p:F.left=j(F.left-c,F.left)},top:function(F,u){var o,G=u.within,d=G.isWindow?G.scrollTop:G.offset.top,E=u.within.height,c=F.top-u.collisionPosition.marginTop,f=d-c,p=c+u.collisionHeight-E-d;u.collisionHeight>E?f>0&&0>=p?(o=F.top+f+u.collisionHeight-E-d,F.top+=f-o):F.top=p>0&&0>=f?d:f>p?d+E-u.collisionHeight:d:f>0?F.top+=f:p>0?F.top-=p:F.top=j(F.top-c,F.top)}},flip:{left:function(P,K){var H,Q,F=K.within,N=F.offset.left+F.scrollLeft,E=F.width,G=F.isWindow?F.scrollLeft:F.offset.left,I=P.left-K.collisionPosition.marginLeft,M=I-G,O=I+K.collisionWidth-E-G,L="left"===K.my[0]?-K.elemWidth:"right"===K.my[0]?K.elemWidth:0,r="left"===K.at[0]?K.targetWidth:"right"===K.at[0]?-K.targetWidth:0,J=-2*K.offset[0];0>M?(H=P.left+L+r+J+K.collisionWidth-E-N,(0>H||b(M)>H)&&(P.left+=L+r+J)):O>0&&(Q=P.left-K.collisionPosition.marginLeft+L+r+J-G,(Q>0||O>b(Q))&&(P.left+=L+r+J))},top:function(Q,L){var H,R,F=L.within,O=F.offset.top+F.scrollTop,E=F.height,G=F.isWindow?F.scrollTop:F.offset.top,I=Q.top-L.collisionPosition.marginTop,N=I-G,P=I+L.collisionHeight-E-G,M="top"===L.my[1],r=M?-L.elemHeight:"bottom"===L.my[1]?L.elemHeight:0,K="top"===L.at[1]?L.targetHeight:"bottom"===L.at[1]?-L.targetHeight:0,J=-2*L.offset[1];0>N?(R=Q.top+r+K+J+L.collisionHeight-E-O,Q.top+r+K+J>N&&(0>R||b(N)>R)&&(Q.top+=r+K+J)):P>0&&(H=Q.top-L.collisionPosition.marginTop+r+K+J-G,Q.top+r+K+J>P&&(H>0||P>b(H))&&(Q.top+=r+K+J))}},flipfit:{left:function(){C.ui.position.flip.left.apply(this,arguments),C.ui.position.fit.left.apply(this,arguments)},top:function(){C.ui.position.flip.top.apply(this,arguments),C.ui.position.fit.top.apply(this,arguments)}}},function(){var l,d,f,t,c,p=document.getElementsByTagName("body")[0],h=document.createElement("div");l=document.createElement(p?"div":"body"),f={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},p&&C.extend(f,{position:"absolute",left:"-1000px",top:"-1000px"});for(c in f){l.style[c]=f[c]}l.appendChild(h),d=p||document.documentElement,d.insertBefore(l,d.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",t=C(h).offset().left,C.support.offsetFractions=t>10&&11>t,l.innerHTML="",d.removeChild(l)}()})(jQuery);(function(a){a.widget("ui.draggable",a.ui.mouse,{version:"1.10.4",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(c){var b=this.options;return this.helper||b.disabled||a(c.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(c),this.handle?(a(b.iframeFix===!0?"iframe":b.iframeFix).each(function(){a("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(c){var b=this.options;return this.helper=this._createHelper(c),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.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,a.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(c),this.originalPageX=c.pageX,this.originalPageY=c.pageY,b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt),this._setContainment(),this._trigger("start",c)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!b.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,c),this._mouseDrag(c,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,c),!0)},_mouseDrag:function(d,b){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(d),this.positionAbs=this._convertPositionTo("absolute"),!b){var c=this._uiHash();if(this._trigger("drag",d,c)===!1){return this._mouseUp({}),!1}this.position=c.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"),a.ui.ddmanager&&a.ui.ddmanager.drag(this,d),!1},_mouseStop:function(d){var b=this,c=!1;return a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,d)),this.dropped&&(c=this.dropped,this.dropped=!1),"original"!==this.options.helper||a.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!c||"valid"===this.options.revert&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)?a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",d)!==!1&&b._clear()}):this._trigger("stop",d)!==!1&&this._clear(),!1):!1},_mouseUp:function(b){return a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){return this.options.handle?!!a(b.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(d){var b=this.options,c=a.isFunction(b.helper)?a(b.helper.apply(this.element[0],[d])):"clone"===b.helper?this.element.clone().removeAttr("id"):this.element;return c.parents("body").length||c.appendTo("parent"===b.appendTo?this.element[0].parentNode:b.appendTo),c[0]===this.element[0]||/(fixed|absolute)/.test(c.css("position"))||c.css("position","absolute"),c},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left" in b&&(this.offset.click.left=b.left+this.margins.left),"right" in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top" in b&&(this.offset.click.top=b.top+this.margins.top),"bottom" in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){var b=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&a.ui.ie)&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}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 d,b,c,f=this.options;return f.containment?"window"===f.containment?(this.containment=[a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,a(window).scrollLeft()+a(window).width()-this.helperProportions.width-this.margins.left,a(window).scrollTop()+(a(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===f.containment?(this.containment=[0,0,a(document).width()-this.helperProportions.width-this.margins.left,(a(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):f.containment.constructor===Array?(this.containment=f.containment,undefined):("parent"===f.containment&&(f.containment=this.helper[0].parentNode),b=a(f.containment),c=b[0],c&&(d="hidden"!==b.css("overflow"),this.containment=[(parseInt(b.css("borderLeftWidth"),10)||0)+(parseInt(b.css("paddingLeft"),10)||0),(parseInt(b.css("borderTopWidth"),10)||0)+(parseInt(b.css("paddingTop"),10)||0),(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(b.css("borderRightWidth"),10)||0)-(parseInt(b.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(b.css("borderBottomWidth"),10)||0)-(parseInt(b.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=b),undefined):(this.containment=null,undefined)},_convertPositionTo:function(d,b){b||(b=this.position);var c="absolute"===d?1:-1,f="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&a.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:f.scrollTop(),left:f.scrollLeft()}),{top:b.top+this.offset.relative.top*c+this.offset.parent.top*c-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*c,left:b.left+this.offset.relative.left*c+this.offset.parent.left*c-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*c}},_generatePosition:function(k){var g,p,d,m,c=this.options,b="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&a.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=k.pageX,j=k.pageY;return this.offset.scroll||(this.offset.scroll={top:b.scrollTop(),left:b.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(p=this.relative_container.offset(),g=[this.containment[0]+p.left,this.containment[1]+p.top,this.containment[2]+p.left,this.containment[3]+p.top]):g=this.containment,k.pageX-this.offset.click.leftg[2]&&(f=g[2]+this.offset.click.left),k.pageY-this.offset.click.top>g[3]&&(j=g[3]+this.offset.click.top)),c.grid&&(d=c.grid[1]?this.originalPageY+Math.round((j-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY,j=g?d-this.offset.click.top>=g[1]||d-this.offset.click.top>g[3]?d:d-this.offset.click.top>=g[1]?d-c.grid[1]:d+c.grid[1]:d,m=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX,f=g?m-this.offset.click.left>=g[0]||m-this.offset.click.left>g[2]?m:m-this.offset.click.left>=g[0]?m-c.grid[0]:m+c.grid[0]:m)),{top:j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:f-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(d,b,c){return c=c||this._uiHash(),a.ui.plugin.call(this,d,[b,c]),"drag"===d&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,d,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.ui.plugin.add("draggable","connectToSortable",{start:function(f,c){var d=a(this).data("ui-draggable"),g=d.options,b=a.extend({},c,{item:d.element});d.sortables=[],a(g.connectToSortable).each(function(){var e=a.data(this,"ui-sortable");e&&!e.options.disabled&&(d.sortables.push({instance:e,shouldRevert:e.options.revert}),e.refreshPositions(),e._trigger("activate",f,b))})},stop:function(d,b){var c=a(this).data("ui-draggable"),f=a.extend({},b,{item:c.element});a.each(c.sortables,function(){this.instance.isOver?(this.instance.isOver=0,c.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(d),this.instance.options.helper=this.instance.options._helper,"original"===c.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",d,f))})},drag:function(d,b){var c=a(this).data("ui-draggable"),f=this;a.each(c.sortables,function(){var e=!1,g=this;this.instance.positionAbs=c.positionAbs,this.instance.helperProportions=c.helperProportions,this.instance.offset.click=c.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(e=!0,a.each(c.sortables,function(){return this.instance.positionAbs=c.positionAbs,this.instance.helperProportions=c.helperProportions,this.instance.offset.click=c.offset.click,this!==g&&this.instance._intersectsWith(this.instance.containerCache)&&a.contains(g.instance.element[0],this.instance.element[0])&&(e=!1),e})),e?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(f).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 b.helper[0]},d.target=this.instance.currentItem[0],this.instance._mouseCapture(d,!0),this.instance._mouseStart(d,!0,!0),this.instance.offset.click.top=c.offset.click.top,this.instance.offset.click.left=c.offset.click.left,this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top,c._trigger("toSortable",d),c.dropped=this.instance.element,c.currentItem=c.element,this.instance.fromOutside=c),this.instance.currentItem&&this.instance._mouseDrag(d)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",d,this.instance._uiHash(this.instance)),this.instance._mouseStop(d,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),c._trigger("fromSortable",d),c.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(){var c=a("body"),b=a(this).data("ui-draggable").options;c.css("cursor")&&(b._cursor=c.css("cursor")),c.css("cursor",b.cursor)},stop:function(){var b=a(this).data("ui-draggable").options;b._cursor&&a("body").css("cursor",b._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(d,b){var c=a(b.helper),f=a(this).data("ui-draggable").options;c.css("opacity")&&(f._opacity=c.css("opacity")),c.css("opacity",f.opacity)},stop:function(d,b){var c=a(this).data("ui-draggable").options;c._opacity&&a(b.helper).css("opacity",c._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("ui-draggable");b.scrollParent[0]!==document&&"HTML"!==b.scrollParent[0].tagName&&(b.overflowOffset=b.scrollParent.offset())},drag:function(d){var b=a(this).data("ui-draggable"),c=b.options,f=!1;b.scrollParent[0]!==document&&"HTML"!==b.scrollParent[0].tagName?(c.axis&&"x"===c.axis||(b.overflowOffset.top+b.scrollParent[0].offsetHeight-d.pageY=0;k--){t=w.snapElements[k].left,A=t+w.snapElements[k].width,C=w.snapElements[k].top,H=C+w.snapElements[k].height,t-E>K||z>A+E||C-E>I||j>H+E||!a.contains(w.snapElements[k].item.ownerDocument,w.snapElements[k].item)?(w.snapElements[k].snapping&&w.options.snap.release&&w.options.snap.release.call(w.element,F,a.extend(w._uiHash(),{snapItem:w.snapElements[k].item})),w.snapElements[k].snapping=!1):("inner"!==D.snapMode&&(q=E>=Math.abs(C-I),y=E>=Math.abs(H-j),J=E>=Math.abs(t-K),x=E>=Math.abs(A-z),q&&(B.position.top=w._convertPositionTo("relative",{top:C-w.helperProportions.height,left:0}).top-w.margins.top),y&&(B.position.top=w._convertPositionTo("relative",{top:H,left:0}).top-w.margins.top),J&&(B.position.left=w._convertPositionTo("relative",{top:0,left:t-w.helperProportions.width}).left-w.margins.left),x&&(B.position.left=w._convertPositionTo("relative",{top:0,left:A}).left-w.margins.left)),G=q||y||J||x,"outer"!==D.snapMode&&(q=E>=Math.abs(C-j),y=E>=Math.abs(H-I),J=E>=Math.abs(t-z),x=E>=Math.abs(A-K),q&&(B.position.top=w._convertPositionTo("relative",{top:C,left:0}).top-w.margins.top),y&&(B.position.top=w._convertPositionTo("relative",{top:H-w.helperProportions.height,left:0}).top-w.margins.top),J&&(B.position.left=w._convertPositionTo("relative",{top:0,left:t}).left-w.margins.left),x&&(B.position.left=w._convertPositionTo("relative",{top:0,left:A-w.helperProportions.width}).left-w.margins.left)),!w.snapElements[k].snapping&&(q||y||J||x||G)&&w.options.snap.snap&&w.options.snap.snap.call(w.element,F,a.extend(w._uiHash(),{snapItem:w.snapElements[k].item})),w.snapElements[k].snapping=q||y||J||x||G)}}}),a.ui.plugin.add("draggable","stack",{start:function(){var d,b=this.data("ui-draggable").options,c=a.makeArray(a(b.stack)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||0)-(parseInt(a(f).css("zIndex"),10)||0)});c.length&&(d=parseInt(a(c[0]).css("zIndex"),10)||0,a(c).each(function(e){a(this).css("zIndex",d+e)}),this.css("zIndex",d+c.length))}}),a.ui.plugin.add("draggable","zIndex",{start:function(d,b){var c=a(b.helper),f=a(this).data("ui-draggable").options;c.css("zIndex")&&(f._zIndex=c.css("zIndex")),c.css("zIndex",f.zIndex)},stop:function(d,b){var c=a(this).data("ui-draggable").options;c._zIndex&&a(b.helper).css("zIndex",c._zIndex)}})})(jQuery);(function(a){function b(d,f,c){return d>f&&f+c>d}a.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var f,c=this.options,d=c.accept;this.isover=!1,this.isout=!0,this.accept=a.isFunction(d)?d:function(e){return e.is(d)},this.proportions=function(){return arguments.length?(f=arguments[0],undefined):f?f:f={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},a.ui.ddmanager.droppables[c.scope]=a.ui.ddmanager.droppables[c.scope]||[],a.ui.ddmanager.droppables[c.scope].push(this),c.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var d=0,c=a.ui.ddmanager.droppables[this.options.scope];c.length>d;d++){c[d]===this&&c.splice(d,1)}this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(d,c){"accept"===d&&(this.accept=a.isFunction(c)?c:function(e){return e.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",d,this.ui(c))},_deactivate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",d,this.ui(c))},_over:function(d){var c=a.ui.ddmanager.current;c&&(c.currentItem||c.element)[0]!==this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",d,this.ui(c)))},_out:function(d){var c=a.ui.ddmanager.current;c&&(c.currentItem||c.element)[0]!==this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",d,this.ui(c)))},_drop:function(f,c){var d=c||a.ui.ddmanager.current,g=!1;return d&&(d.currentItem||d.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var h=a.data(this,"ui-droppable");return h.options.greedy&&!h.options.disabled&&h.options.scope===d.options.scope&&h.accept.call(h.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(h,{offset:h.element.offset()}),h.options.tolerance)?(g=!0,!1):undefined}),g?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",f,this.ui(d)),this.element):!1):!1},ui:function(c){return{draggable:c.currentItem||c.element,helper:c.helper,position:c.position,offset:c.positionAbs}}}),a.ui.intersect=function(z,m,A){if(!m.offset){return !1}var j,x,g=(z.positionAbs||z.position.absolute).left,e=(z.positionAbs||z.position.absolute).top,k=g+z.helperProportions.width,q=e+z.helperProportions.height,w=m.offset.left,y=m.offset.top,v=w+m.proportions().width,f=y+m.proportions().height;switch(A){case"fit":return g>=w&&v>=k&&e>=y&&f>=q;case"intersect":return g+z.helperProportions.width/2>w&&v>k-z.helperProportions.width/2&&e+z.helperProportions.height/2>y&&f>q-z.helperProportions.height/2;case"pointer":return j=(z.positionAbs||z.position.absolute).left+(z.clickOffset||z.offset.click).left,x=(z.positionAbs||z.position.absolute).top+(z.clickOffset||z.offset.click).top,b(x,y,m.proportions().height)&&b(j,w,m.proportions().width);case"touch":return(e>=y&&f>=e||q>=y&&f>=q||y>e&&q>f)&&(g>=w&&v>=g||k>=w&&v>=k||w>g&&k>v);default:return !1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(h,d){var f,k,c=a.ui.ddmanager.droppables[h.options.scope]||[],j=d?d.type:null,g=(h.currentItem||h.element).find(":data(ui-droppable)").addBack();a:for(f=0;c.length>f;f++){if(!(c[f].options.disabled||h&&!c[f].accept.call(c[f].element[0],h.currentItem||h.element))){for(k=0;g.length>k;k++){if(g[k]===c[f].element[0]){c[f].proportions().height=0;continue a}}c[f].visible="none"!==c[f].element.css("display"),c[f].visible&&("mousedown"===j&&c[f]._activate.call(c[f],d),c[f].offset=c[f].element.offset(),c[f].proportions({width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}))}}},drop:function(f,c){var d=!1;return a.each((a.ui.ddmanager.droppables[f.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&a.ui.intersect(f,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],f.currentItem||f.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,c)))}),d},dragStart:function(d,c){d.element.parentsUntil("body").bind("scroll.droppable",function(){d.options.refreshPositions||a.ui.ddmanager.prepareOffsets(d,c)})},drag:function(d,c){d.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(d,c),a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var f,i,e,h=a.ui.intersect(d,this,this.options.tolerance),g=!h&&this.isover?"isout":h&&!this.isover?"isover":null;g&&(this.options.greedy&&(i=this.options.scope,e=this.element.parents(":data(ui-droppable)").filter(function(){return a.data(this,"ui-droppable").options.scope===i}),e.length&&(f=a.data(e[0],"ui-droppable"),f.greedyChild="isover"===g)),f&&"isover"===g&&(f.isover=!1,f.isout=!0,f._out.call(f,c)),this[g]=!0,this["isout"===g?"isover":"isout"]=!1,this["isover"===g?"_over":"_out"].call(this,c),f&&"isout"===g&&(f.isout=!1,f.isover=!0,f._over.call(f,c)))}})},dragStop:function(d,c){d.element.parentsUntil("body").unbind("scroll.droppable"),d.options.refreshPositions||a.ui.ddmanager.prepareOffsets(d,c)}}})(jQuery);(function(b){function c(d){return parseInt(d,10)||0}function a(d){return !isNaN(parseInt(d,10))}b.widget("ui.resizable",b.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var j,f,g,l,d,k=this,h=this.options;if(this.element.addClass("ui-resizable"),b.extend(this,{_aspectRatio:!!h.aspectRatio,aspectRatio:h.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(b("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=h.handles||(b(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String){for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),j=this.handles.split(","),this.handles={},f=0;j.length>f;f++){g=b.trim(j[f]),d="ui-resizable-"+g,l=b("
"),l.css({zIndex:h.zIndex}),"se"===g&&l.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[g]=".ui-resizable-"+g,this.element.append(l)}}this._renderAxis=function(q){var o,p,r,m;q=q||this.element;for(o in this.handles){this.handles[o].constructor===String&&(this.handles[o]=b(this.handles[o],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(p=b(this.handles[o],this.element),m=/sw|ne|nw|se|n|s/.test(o)?p.outerHeight():p.outerWidth(),r=["padding",/ne|nw|n/.test(o)?"Top":/se|sw|s/.test(o)?"Bottom":/^e$/.test(o)?"Right":"Left"].join(""),q.css(r,m),this._proportionallyResize()),b(this.handles[o]).length}},this._renderAxis(this.element),this._handles=b(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){k.resizing||(this.className&&(l=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),k.axis=l&&l[1]?l[1]:"se")}),h.autoHide&&(this._handles.hide(),b(this.element).addClass("ui-resizable-autohide").mouseenter(function(){h.disabled||(b(this).removeClass("ui-resizable-autohide"),k._handles.show())}).mouseleave(function(){h.disabled||k.resizing||(b(this).addClass("ui-resizable-autohide"),k._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var f,d=function(g){b(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(d(this.element),f=this.element,this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")}).insertAfter(f),f.remove()),this.originalElement.css("resize",this.originalResizeStyle),d(this.originalElement),this},_mouseCapture:function(g){var d,f,h=!1;for(d in this.handles){f=b(this.handles[d])[0],(f===g.target||b.contains(f,g.target))&&(h=!0)}return !this.options.disabled&&h},_mouseStart:function(e){var g,l,d,k=this.options,j=this.element.position(),f=this.element;return this.resizing=!0,/absolute/.test(f.css("position"))?f.css({position:"absolute",top:f.css("top"),left:f.css("left")}):f.is(".ui-draggable")&&f.css({position:"absolute",top:j.top,left:j.left}),this._renderProxy(),g=c(this.helper.css("left")),l=c(this.helper.css("top")),k.containment&&(g+=b(k.containment).scrollLeft()||0,l+=b(k.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:l},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:l},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof k.aspectRatio?k.aspectRatio:this.originalSize.width/this.originalSize.height||1,d=b(".ui-resizable-"+this.axis).css("cursor"),b("body").css("cursor","auto"===d?this.axis+"-resize":d),f.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(v){var q,A=this.helper,k={},y=this.originalMousePosition,j=this.axis,f=this.position.top,t=this.position.left,m=this.size.width,x=this.size.height,z=v.pageX-y.left||0,w=v.pageY-y.top||0,g=this._change[j];return g?(q=g.apply(this,[v,z,w]),this._updateVirtualBoundaries(v.shiftKey),(this._aspectRatio||v.shiftKey)&&(q=this._updateRatio(q,v)),q=this._respectSize(q,v),this._updateCache(q),this._propagate("resize",v),this.position.top!==f&&(k.top=this.position.top+"px"),this.position.left!==t&&(k.left=this.position.left+"px"),this.size.width!==m&&(k.width=this.size.width+"px"),this.size.height!==x&&(k.height=this.size.height+"px"),A.css(k),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),b.isEmptyObject(k)||this._trigger("resize",v,this.ui()),!1):!1},_mouseStop:function(p){this.resizing=!1;var k,u,g,t,f,d,m,j=this.options,q=this;return this._helper&&(k=this._proportionallyResizeElements,u=k.length&&/textarea/i.test(k[0].nodeName),g=u&&b.ui.hasScroll(k[0],"left")?0:q.sizeDiff.height,t=u?0:q.sizeDiff.width,f={width:q.helper.width()-t,height:q.helper.height()-g},d=parseInt(q.element.css("left"),10)+(q.position.left-q.originalPosition.left)||null,m=parseInt(q.element.css("top"),10)+(q.position.top-q.originalPosition.top)||null,j.animate||this.element.css(b.extend(f,{top:m,left:d})),q.helper.height(q.size.height),q.helper.width(q.size.width),this._helper&&!j.animate&&this._proportionallyResize()),b("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",p),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(f){var i,g,k,d,j,h=this.options;j={minWidth:a(h.minWidth)?h.minWidth:0,maxWidth:a(h.maxWidth)?h.maxWidth:1/0,minHeight:a(h.minHeight)?h.minHeight:0,maxHeight:a(h.maxHeight)?h.maxHeight:1/0},(this._aspectRatio||f)&&(i=j.minHeight*this.aspectRatio,k=j.minWidth/this.aspectRatio,g=j.maxHeight*this.aspectRatio,d=j.maxWidth/this.aspectRatio,i>j.minWidth&&(j.minWidth=i),k>j.minHeight&&(j.minHeight=k),j.maxWidth>g&&(j.maxWidth=g),j.maxHeight>d&&(j.maxHeight=d)),this._vBoundaries=j},_updateCache:function(d){this.offset=this.helper.offset(),a(d.left)&&(this.position.left=d.left),a(d.top)&&(this.position.top=d.top),a(d.height)&&(this.size.height=d.height),a(d.width)&&(this.size.width=d.width)},_updateRatio:function(d){var g=this.position,f=this.size,h=this.axis;return a(d.height)?d.width=d.height*this.aspectRatio:a(d.width)&&(d.height=d.width/this.aspectRatio),"sw"===h&&(d.left=g.left+(f.width-d.width),d.top=null),"nw"===h&&(d.top=g.top+(f.height-d.height),d.left=g.left+(f.width-d.width)),d},_respectSize:function(v){var k=this._vBoundaries,w=this.axis,g=a(v.width)&&k.maxWidth&&k.maxWidthv.width,d=a(v.height)&&k.minHeight&&k.minHeight>v.height,j=this.originalPosition.left+this.originalSize.width,i=this.position.top+this.size.height,m=/sw|nw|w/.test(w),q=/nw|ne|n/.test(w);return f&&(v.width=k.minWidth),d&&(v.height=k.minHeight),g&&(v.width=k.maxWidth),p&&(v.height=k.maxHeight),f&&m&&(v.left=j-k.minWidth),g&&m&&(v.left=j-k.maxWidth),d&&q&&(v.top=i-k.minHeight),p&&q&&(v.top=i-k.maxHeight),v.width||v.height||v.left||!v.top?v.width||v.height||v.top||!v.left||(v.left=null):v.top=null,v},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var g,j,f,h,k,d=this.helper||this.element;for(g=0;this._proportionallyResizeElements.length>g;g++){if(k=this._proportionallyResizeElements[g],!this.borderDif){for(this.borderDif=[],f=[k.css("borderTopWidth"),k.css("borderRightWidth"),k.css("borderBottomWidth"),k.css("borderLeftWidth")],h=[k.css("paddingTop"),k.css("paddingRight"),k.css("paddingBottom"),k.css("paddingLeft")],j=0;f.length>j;j++){this.borderDif[j]=(parseInt(f[j],10)||0)+(parseInt(h[j],10)||0)}}k.css({height:d.height()-this.borderDif[0]-this.borderDif[2]||0,width:d.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var f=this.element,d=this.options;this.elementOffset=f.offset(),this._helper?(this.helper=this.helper||b("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++d.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(d,f){return{width:this.originalSize.width+f}},w:function(f,h){var d=this.originalSize,g=this.originalPosition;return{left:g.left+h,width:d.width-h}},n:function(f,h,d){var g=this.originalSize,j=this.originalPosition;return{top:j.top+d,height:g.height-d}},s:function(f,g,d){return{height:this.originalSize.height+d}},se:function(g,d,f){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,d,f]))},sw:function(g,d,f){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,d,f]))},ne:function(g,d,f){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,d,f]))},nw:function(g,d,f){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,d,f]))}},_propagate:function(f,d){b.ui.plugin.call(this,f,[d,this.ui()]),"resize"!==f&&this._trigger(f,d,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),b.ui.plugin.add("resizable","animate",{stop:function(p){var k=b(this).data("ui-resizable"),u=k.options,g=k._proportionallyResizeElements,t=g.length&&/textarea/i.test(g[0].nodeName),f=t&&b.ui.hasScroll(g[0],"left")?0:k.sizeDiff.height,d=t?0:k.sizeDiff.width,m={width:k.size.width-d,height:k.size.height-f},j=parseInt(k.element.css("left"),10)+(k.position.left-k.originalPosition.left)||null,q=parseInt(k.element.css("top"),10)+(k.position.top-k.originalPosition.top)||null;k.element.animate(b.extend(m,q&&j?{top:q,left:j}:{}),{duration:u.animateDuration,easing:u.animateEasing,step:function(){var e={width:parseInt(k.element.css("width"),10),height:parseInt(k.element.css("height"),10),top:parseInt(k.element.css("top"),10),left:parseInt(k.element.css("left"),10)};g&&g.length&&b(g[0]).css({width:e.width,height:e.height}),k._updateCache(e),k._propagate("resize",p)}})}}),b.ui.plugin.add("resizable","containment",{start:function(){var m,y,j,w,g,e,q,k=b(this).data("ui-resizable"),v=k.options,x=k.element,t=v.containment,f=t instanceof b?t.get(0):/parent/.test(t)?x.parent().get(0):t;f&&(k.containerElement=b(f),/document/.test(t)||t===document?(k.containerOffset={left:0,top:0},k.containerPosition={left:0,top:0},k.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}):(m=b(f),y=[],b(["Top","Right","Left","Bottom"]).each(function(d,h){y[d]=c(m.css("padding"+h))}),k.containerOffset=m.offset(),k.containerPosition=m.position(),k.containerSize={height:m.innerHeight()-y[3],width:m.innerWidth()-y[1]},j=k.containerOffset,w=k.containerSize.height,g=k.containerSize.width,e=b.ui.hasScroll(f,"left")?f.scrollWidth:g,q=b.ui.hasScroll(f)?f.scrollHeight:w,k.parentData={element:f,left:j.left,top:j.top,width:e,height:q}))},resize:function(q){var m,y,j,w,g=b(this).data("ui-resizable"),f=g.options,p=g.containerOffset,k=g.position,v=g._aspectRatio||q.shiftKey,x={top:0,left:0},t=g.containerElement;t[0]!==document&&/static/.test(t.css("position"))&&(x=p),k.left<(g._helper?p.left:0)&&(g.size.width=g.size.width+(g._helper?g.position.left-p.left:g.position.left-x.left),v&&(g.size.height=g.size.width/g.aspectRatio),g.position.left=f.helper?p.left:0),k.top<(g._helper?p.top:0)&&(g.size.height=g.size.height+(g._helper?g.position.top-p.top:g.position.top),v&&(g.size.width=g.size.height*g.aspectRatio),g.position.top=g._helper?p.top:0),g.offset.left=g.parentData.left+g.position.left,g.offset.top=g.parentData.top+g.position.top,m=Math.abs((g._helper?g.offset.left-x.left:g.offset.left-x.left)+g.sizeDiff.width),y=Math.abs((g._helper?g.offset.top-x.top:g.offset.top-p.top)+g.sizeDiff.height),j=g.containerElement.get(0)===g.element.parent().get(0),w=/relative|absolute/.test(g.containerElement.css("position")),j&&w&&(m-=Math.abs(g.parentData.left)),m+g.size.width>=g.parentData.width&&(g.size.width=g.parentData.width-m,v&&(g.size.height=g.size.width/g.aspectRatio)),y+g.size.height>=g.parentData.height&&(g.size.height=g.parentData.height-y,v&&(g.size.width=g.size.height*g.aspectRatio))},stop:function(){var p=b(this).data("ui-resizable"),k=p.options,t=p.containerOffset,g=p.containerPosition,q=p.containerElement,f=b(p.helper),d=f.offset(),m=f.outerWidth()-p.sizeDiff.width,j=f.outerHeight()-p.sizeDiff.height;p._helper&&!k.animate&&/relative/.test(q.css("position"))&&b(this).css({left:d.left-g.left-t.left,width:m,height:j}),p._helper&&!k.animate&&/static/.test(q.css("position"))&&b(this).css({left:d.left-g.left-t.left,width:m,height:j})}}),b.ui.plugin.add("resizable","alsoResize",{start:function(){var g=b(this).data("ui-resizable"),d=g.options,f=function(h){b(h).each(function(){var i=b(this);i.data("ui-resizable-alsoresize",{width:parseInt(i.width(),10),height:parseInt(i.height(),10),left:parseInt(i.css("left"),10),top:parseInt(i.css("top"),10)})})};"object"!=typeof d.alsoResize||d.alsoResize.parentNode?f(d.alsoResize):d.alsoResize.length?(d.alsoResize=d.alsoResize[0],f(d.alsoResize)):b.each(d.alsoResize,function(e){f(e)})},resize:function(l,f){var j=b(this).data("ui-resizable"),p=j.options,d=j.originalSize,m=j.originalPosition,k={height:j.size.height-d.height||0,width:j.size.width-d.width||0,top:j.position.top-m.top||0,left:j.position.left-m.left||0},g=function(i,h){b(i).each(function(){var r=b(this),t=b(this).data("ui-resizable-alsoresize"),q={},s=h&&h.length?h:r.parents(f.originalElement[0]).length?["width","height"]:["width","height","top","left"];b.each(s,function(o,u){var n=(t[u]||0)+(k[u]||0);n&&n>=0&&(q[u]=n||null)}),r.css(q)})};"object"!=typeof p.alsoResize||p.alsoResize.nodeType?g(p.alsoResize):b.each(p.alsoResize,function(h,i){g(h,i)})},stop:function(){b(this).removeData("resizable-alsoresize")}}),b.ui.plugin.add("resizable","ghost",{start:function(){var g=b(this).data("ui-resizable"),d=g.options,f=g.size;g.ghost=g.originalElement.clone(),g.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof d.ghost?d.ghost:""),g.ghost.appendTo(g.helper)},resize:function(){var d=b(this).data("ui-resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=b(this).data("ui-resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),b.ui.plugin.add("resizable","grid",{resize:function(){var C=b(this).data("ui-resizable"),y=C.options,I=C.size,t=C.originalSize,F=C.originalPosition,q=C.axis,j="number"==typeof y.grid?[y.grid,y.grid]:y.grid,z=j[0]||1,x=j[1]||1,E=Math.round((I.width-t.width)/z)*z,H=Math.round((I.height-t.height)/x)*x,D=t.width+E,k=t.height+H,B=y.maxWidth&&D>y.maxWidth,A=y.maxHeight&&k>y.maxHeight,w=y.minWidth&&y.minWidth>D,G=y.minHeight&&y.minHeight>k;y.grid=j,w&&(D+=z),G&&(k+=x),B&&(D-=z),A&&(k-=x),/^(se|s|e)$/.test(q)?(C.size.width=D,C.size.height=k):/^(ne)$/.test(q)?(C.size.width=D,C.size.height=k,C.position.top=F.top-H):/^(sw)$/.test(q)?(C.size.width=D,C.size.height=k,C.position.left=F.left-E):(k-x>0?(C.size.height=k,C.position.top=F.top-H):(C.size.height=x,C.position.top=F.top+t.height-x),D-z>0?(C.size.width=D,C.position.left=F.left-E):(C.size.width=z,C.position.left=F.left+t.width-z))}})})(jQuery);(function(a){a.widget("ui.selectable",a.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var c,b=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var f=a(this),d=f.offset();a.data(this,"selectable-item",{element:this,$element:f,left:d.left,top:d.top,right:d.left+f.outerWidth(),bottom:d.top+f.outerHeight(),startselected:!1,selected:f.hasClass("ui-selected"),selecting:f.hasClass("ui-selecting"),unselecting:f.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(d){var b=this,c=this.options;this.opos=[d.pageX,d.pageY],this.options.disabled||(this.selectees=a(c.filter,this.element[0]),this._trigger("start",d),a(c.appendTo).append(this.helper),this.helper.css({left:d.pageX,top:d.pageY,width:0,height:0}),c.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=!0,d.metaKey||d.ctrlKey||(e.$element.removeClass("ui-selected"),e.selected=!1,e.$element.addClass("ui-unselecting"),e.unselecting=!0,b._trigger("unselecting",d,{unselecting:e.element}))}),a(d.target).parents().addBack().each(function(){var e,f=a.data(this,"selectable-item");return f?(e=!d.metaKey&&!d.ctrlKey||!f.$element.hasClass("ui-selected"),f.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),f.unselecting=!e,f.selecting=e,f.selected=e,e?b._trigger("selecting",d,{selecting:f.element}):b._trigger("unselecting",d,{unselecting:f.element}),!1):undefined}))},_mouseDrag:function(h){if(this.dragged=!0,!this.options.disabled){var d,f=this,k=this.options,c=this.opos[0],j=this.opos[1],g=h.pageX,b=h.pageY;return c>g&&(d=g,g=c,c=d),j>b&&(d=b,b=j,j=d),this.helper.css({left:c,top:j,width:g-c,height:b-j}),this.selectees.each(function(){var e=a.data(this,"selectable-item"),l=!1;e&&e.element!==f.element[0]&&("touch"===k.tolerance?l=!(e.left>g||c>e.right||e.top>b||j>e.bottom):"fit"===k.tolerance&&(l=e.left>c&&g>e.right&&e.top>j&&b>e.bottom),l?(e.selected&&(e.$element.removeClass("ui-selected"),e.selected=!1),e.unselecting&&(e.$element.removeClass("ui-unselecting"),e.unselecting=!1),e.selecting||(e.$element.addClass("ui-selecting"),e.selecting=!0,f._trigger("selecting",h,{selecting:e.element}))):(e.selecting&&((h.metaKey||h.ctrlKey)&&e.startselected?(e.$element.removeClass("ui-selecting"),e.selecting=!1,e.$element.addClass("ui-selected"),e.selected=!0):(e.$element.removeClass("ui-selecting"),e.selecting=!1,e.startselected&&(e.$element.addClass("ui-unselecting"),e.unselecting=!0),f._trigger("unselecting",h,{unselecting:e.element}))),e.selected&&(h.metaKey||h.ctrlKey||e.startselected||(e.$element.removeClass("ui-selected"),e.selected=!1,e.$element.addClass("ui-unselecting"),e.unselecting=!0,f._trigger("unselecting",h,{unselecting:e.element})))))}),!1}},_mouseStop:function(c){var b=this;return this.dragged=!1,a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,b._trigger("unselected",c,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,b._trigger("selected",c,{selected:d.element})}),this._trigger("stop",c),this.helper.remove(),!1}})})(jQuery);(function(b){function c(f,g,d){return f>g&&g+d>f}function a(d){return/left|right/.test(d.css("float"))||/inline|table-cell/.test(d.css("display"))}b.widget("ui.sortable",b.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var d=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===d.axis||a(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var d=this.items.length-1;d>=0;d--){this.items[d].item.removeData(this.widgetName+"-item")}return this},_setOption:function(f,d){"disabled"===f?(this.options[f]=d,this.widget().toggleClass("ui-sortable-disabled",!!d)):b.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(g,d){var f=null,j=!1,h=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(g),b(g.target).parents().each(function(){return b.data(this,h.widgetName+"-item")===h?(f=b(this),!1):undefined}),b.data(g.target,h.widgetName+"-item")===h&&(f=b(g.target)),f?!this.options.handle||d||(b(this.options.handle,f).find("*").addBack().each(function(){this===g.target&&(j=!0)}),j)?(this.currentItem=f,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(h,f,g){var k,j,d=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(h),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},b.extend(this.offset,{click:{left:h.pageX-this.offset.left,top:h.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(h),this.originalPageX=h.pageX,this.originalPageY=h.pageY,d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),d.containment&&this._setContainment(),d.cursor&&"auto"!==d.cursor&&(j=this.document.find("body"),this.storedCursor=j.css("cursor"),j.css("cursor",d.cursor),this.storedStylesheet=b("").appendTo(j)),d.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",d.opacity)),d.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",d.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",h,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!g){for(k=this.containers.length-1;k>=0;k--){this.containers[k]._trigger("activate",h,this._uiHash(this))}}return b.ui.ddmanager&&(b.ui.ddmanager.current=this),b.ui.ddmanager&&!d.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,h),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(h),!0},_mouseDrag:function(j){var f,g,l,k,d=this.options,h=!1;for(this.position=this._generatePosition(j),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-j.pageY=0;f--){if(g=this.items[f],l=g.item[0],k=this._intersectsWithPointer(g),k&&g.instance===this.currentContainer&&l!==this.currentItem[0]&&this.placeholder[1===k?"next":"prev"]()[0]!==l&&!b.contains(this.placeholder[0],l)&&("semi-dynamic"===this.options.type?!b.contains(this.element[0],l):!0)){if(this.direction=1===k?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(g)){break}this._rearrange(j,g),this._trigger("change",j,this._uiHash());break}}return this._contactContainers(j),b.ui.ddmanager&&b.ui.ddmanager.drag(this,j),this._trigger("sort",j,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(h,f){if(h){if(b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,h),this.options.revert){var g=this,k=this.placeholder.offset(),j=this.options.axis,d={};j&&"x"!==j||(d.left=k.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),j&&"y"!==j||(d.top=k.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,b(this.helper).animate(d,parseInt(this.options.revert,10)||500,function(){g._clear(h)})}else{this._clear(h,f)}return !1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",null,this._uiHash(this)),this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",null,this._uiHash(this)),this.containers[d].containerCache.over=0)}}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),b.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):b(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(g){var d=this._getItemsAsjQuery(g&&g.connected),f=[];return g=g||{},b(d).each(function(){var e=(b(g.item||this).attr(g.attribute||"id")||"").match(g.expression||/(.+)[\-=_](.+)/);e&&f.push((g.key||e[1]+"[]")+"="+(g.key&&g.expression?e[1]:e[2]))}),!f.length&&g.key&&f.push(g.key+"="),f.join("&")},toArray:function(g){var d=this._getItemsAsjQuery(g&&g.connected),f=[];return g=g||{},d.each(function(){f.push(b(g.item||this).attr(g.attribute||"id")||"")}),f},_intersectsWith:function(B){var w=this.positionAbs.left,q=w+this.helperProportions.width,C=this.positionAbs.top,k=C+this.helperProportions.height,j=B.left,z=j+B.width,f=B.top,v=f+B.height,m=this.offset.click.top,y=this.offset.click.left,A="x"===this.options.axis||C+m>f&&v>C+m,x="y"===this.options.axis||w+y>j&&z>w+y,g=A&&x;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>B[this.floating?"width":"height"]?g:w+this.helperProportions.width/2>j&&z>q-this.helperProportions.width/2&&C+this.helperProportions.height/2>f&&v>k-this.helperProportions.height/2},_intersectsWithPointer:function(f){var e="x"===this.options.axis||c(this.positionAbs.top+this.offset.click.top,f.top,f.height),g="y"===this.options.axis||c(this.positionAbs.left+this.offset.click.left,f.left,f.width),j=e&&g,h=this._getDragVerticalDirection(),d=this._getDragHorizontalDirection();return j?this.floating?d&&"right"===d||"down"===h?2:1:h&&("down"===h?2:1):!1},_intersectsWithSides:function(e){var d=c(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),f=c(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),h=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return this.floating&&g?"right"===g&&f||"left"===g&&!f:h&&("down"===h&&d||"up"===h&&!d)},_getDragVerticalDirection:function(){var d=this.positionAbs.top-this.lastPositionAbs.top;return 0!==d&&(d>0?"down":"up")},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return 0!==d&&(d>0?"right":"left")},refresh:function(d){return this._refreshItems(d),this.refreshPositions(),this},_connectWith:function(){var d=this.options;return d.connectWith.constructor===String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(p){function k(){d.push(this)}var t,g,f,q,d=[],m=[],j=this._connectWith();if(j&&p){for(t=j.length-1;t>=0;t--){for(f=b(j[t]),g=f.length-1;g>=0;g--){q=b.data(f[g],this.widgetFullName),q&&q!==this&&!q.options.disabled&&m.push([b.isFunction(q.options.items)?q.options.items.call(q.element):b(q.options.items,q.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),q])}}}for(m.push([b.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),t=m.length-1;t>=0;t--){m[t][0].each(k)}return b(d)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=b.grep(this.items,function(f){for(var e=0;d.length>e;e++){if(d[e]===f.item[0]){return !1}}return !0})},_refreshItems:function(q){this.items=[],this.containers=[this];var m,y,j,g,w,f,p,k,v=this.items,x=[[b.isFunction(this.options.items)?this.options.items.call(this.element[0],q,{item:this.currentItem}):b(this.options.items,this.element),this]],t=this._connectWith();if(t&&this.ready){for(m=t.length-1;m>=0;m--){for(j=b(t[m]),y=j.length-1;y>=0;y--){g=b.data(j[y],this.widgetFullName),g&&g!==this&&!g.options.disabled&&(x.push([b.isFunction(g.options.items)?g.options.items.call(g.element[0],q,{item:this.currentItem}):b(g.options.items,g.element),g]),this.containers.push(g))}}}for(m=x.length-1;m>=0;m--){for(w=x[m][1],f=x[m][0],y=0,k=f.length;k>y;y++){p=b(f[y]),p.data(this.widgetName+"-item",w),v.push({item:p,instance:w,width:0,height:0,left:0,top:0})}}},refreshPositions:function(g){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var d,f,j,h;for(d=this.items.length-1;d>=0;d--){f=this.items[d],f.instance!==this.currentContainer&&this.currentContainer&&f.item[0]!==this.currentItem[0]||(j=this.options.toleranceElement?b(this.options.toleranceElement,f.item):f.item,g||(f.width=j.outerWidth(),f.height=j.outerHeight()),h=j.offset(),f.left=h.left,f.top=h.top)}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(d=this.containers.length-1;d>=0;d--){h=this.containers[d].element.offset(),this.containers[d].containerCache.left=h.left,this.containers[d].containerCache.top=h.top,this.containers[d].containerCache.width=this.containers[d].element.outerWidth(),this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}return this},_createPlaceholder:function(g){g=g||this;var d,f=g.options;f.placeholder&&f.placeholder.constructor!==String||(d=f.placeholder,f.placeholder={element:function(){var e=g.currentItem[0].nodeName.toLowerCase(),h=b("<"+e+">",g.document[0]).addClass(d||g.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===e?g.currentItem.children().each(function(){b(" ",g.document[0]).attr("colspan",b(this).attr("colspan")||1).appendTo(h)}):"img"===e&&h.attr("src",g.currentItem.attr("src")),d||h.css("visibility","hidden"),h},update:function(e,h){(!d||f.forcePlaceholderSize)&&(h.height()||h.height(g.currentItem.innerHeight()-parseInt(g.currentItem.css("paddingTop")||0,10)-parseInt(g.currentItem.css("paddingBottom")||0,10)),h.width()||h.width(g.currentItem.innerWidth()-parseInt(g.currentItem.css("paddingLeft")||0,10)-parseInt(g.currentItem.css("paddingRight")||0,10)))}}),g.placeholder=b(f.placeholder.element.call(g.element,g.currentItem)),g.currentItem.after(g.placeholder),f.placeholder.update(g,g.placeholder)},_contactContainers:function(A){var k,j,y,e,q,m,x,z,w,i,v=null,t=null;for(k=this.containers.length-1;k>=0;k--){if(!b.contains(this.currentItem[0],this.containers[k].element[0])){if(this._intersectsWith(this.containers[k].containerCache)){if(v&&b.contains(this.containers[k].element[0],v.element[0])){continue}v=this.containers[k],t=k}else{this.containers[k].containerCache.over&&(this.containers[k]._trigger("out",A,this._uiHash(this)),this.containers[k].containerCache.over=0)}}}if(v){if(1===this.containers.length){this.containers[t].containerCache.over||(this.containers[t]._trigger("over",A,this._uiHash(this)),this.containers[t].containerCache.over=1)}else{for(y=10000,e=null,i=v.floating||a(this.currentItem),q=i?"left":"top",m=i?"width":"height",x=this.positionAbs[q]+this.offset.click[q],j=this.items.length-1;j>=0;j--){b.contains(this.containers[t].element[0],this.items[j].item[0])&&this.items[j].item[0]!==this.currentItem[0]&&(!i||c(this.positionAbs.top+this.offset.click.top,this.items[j].top,this.items[j].height))&&(z=this.items[j].item.offset()[q],w=!1,Math.abs(z-x)>Math.abs(z+this.items[j][m]-x)&&(w=!0,z+=this.items[j][m]),y>Math.abs(z-x)&&(y=Math.abs(z-x),e=this.items[j],this.direction=w?"up":"down"))}if(!e&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[t]){return}e?this._rearrange(A,e,null,!0):this._rearrange(A,null,this.containers[t].element,!0),this._trigger("change",A,this._uiHash()),this.containers[t]._trigger("change",A,this._uiHash(this)),this.currentContainer=this.containers[t],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[t]._trigger("over",A,this._uiHash(this)),this.containers[t].containerCache.over=1}}},_createHelper:function(g){var d=this.options,f=b.isFunction(d.helper)?b(d.helper.apply(this.element[0],[g,this.currentItem])):"clone"===d.helper?this.currentItem.clone():this.currentItem;return f.parents("body").length||b("parent"!==d.appendTo?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(f[0]),f[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!f[0].style.width||d.forceHelperSize)&&f.width(this.currentItem.width()),(!f[0].style.height||d.forceHelperSize)&&f.height(this.currentItem.height()),f},_adjustOffsetFromHelper:function(d){"string"==typeof d&&(d=d.split(" ")),b.isArray(d)&&(d={left:+d[0],top:+d[1]||0}),"left" in d&&(this.offset.click.left=d.left+this.margins.left),"right" in d&&(this.offset.click.left=this.helperProportions.width-d.right+this.margins.left),"top" in d&&(this.offset.click.top=d.top+this.margins.top),"bottom" in d&&(this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])&&(d.left+=this.scrollParent.scrollLeft(),d.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&b.ui.ie)&&(d={top:0,left:0}),{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var d=this.currentItem.position();return{top:d.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var g,d,f,h=this.options;"parent"===h.containment&&(h.containment=this.helper[0].parentNode),("document"===h.containment||"window"===h.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b("document"===h.containment?document:window).width()-this.helperProportions.width-this.margins.left,(b("document"===h.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(h.containment)||(g=b(h.containment)[0],d=b(h.containment).offset(),f="hidden"!==b(g).css("overflow"),this.containment=[d.left+(parseInt(b(g).css("borderLeftWidth"),10)||0)+(parseInt(b(g).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(b(g).css("borderTopWidth"),10)||0)+(parseInt(b(g).css("paddingTop"),10)||0)-this.margins.top,d.left+(f?Math.max(g.scrollWidth,g.offsetWidth):g.offsetWidth)-(parseInt(b(g).css("borderLeftWidth"),10)||0)-(parseInt(b(g).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(f?Math.max(g.scrollHeight,g.offsetHeight):g.offsetHeight)-(parseInt(b(g).css("borderTopWidth"),10)||0)-(parseInt(b(g).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(g,d){d||(d=this.position);var f="absolute"===g?1:-1,j="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(j[0].tagName);return{top:d.top+this.offset.relative.top*f+this.offset.parent.top*f-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:j.scrollTop())*f,left:d.left+this.offset.relative.left*f+this.offset.parent.left*f-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:j.scrollLeft())*f}},_generatePosition:function(l){var f,j,p=this.options,m=l.pageX,d=l.pageY,k="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,g=/(html|body)/i.test(k[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(l.pageX-this.offset.click.leftthis.containment[2]&&(m=this.containment[2]+this.offset.click.left),l.pageY-this.offset.click.top>this.containment[3]&&(d=this.containment[3]+this.offset.click.top)),p.grid&&(f=this.originalPageY+Math.round((d-this.originalPageY)/p.grid[1])*p.grid[1],d=this.containment?f-this.offset.click.top>=this.containment[1]&&f-this.offset.click.top<=this.containment[3]?f:f-this.offset.click.top>=this.containment[1]?f-p.grid[1]:f+p.grid[1]:f,j=this.originalPageX+Math.round((m-this.originalPageX)/p.grid[0])*p.grid[0],m=this.containment?j-this.offset.click.left>=this.containment[0]&&j-this.offset.click.left<=this.containment[2]?j:j-this.offset.click.left>=this.containment[0]?j-p.grid[0]:j+p.grid[0]:j)),{top:d-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():g?0:k.scrollTop()),left:m-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():g?0:k.scrollLeft())}},_rearrange:function(f,h,d,g){d?d[0].appendChild(this.placeholder[0]):h.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?h.item[0]:h.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var j=this.counter;this._delay(function(){j===this.counter&&this.refreshPositions(!g)})},_clear:function(f,h){function d(l,m,k){return function(e){k._trigger(l,e,m._uiHash(m))}}this.reverting=!1;var g,j=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(g in this._storedCSS){("auto"===this._storedCSS[g]||"static"===this._storedCSS[g])&&(this._storedCSS[g]="")}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(this.fromOutside&&!h&&j.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||h||j.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(h||(j.push(function(e){this._trigger("remove",e,this._uiHash())}),j.push(function(e){return function(i){e._trigger("receive",i,this._uiHash(this))}}.call(this,this.currentContainer)),j.push(function(e){return function(i){e._trigger("update",i,this._uiHash(this))}}.call(this,this.currentContainer)))),g=this.containers.length-1;g>=0;g--){h||j.push(d("deactivate",this,this.containers[g])),this.containers[g].containerCache.over&&(j.push(d("out",this,this.containers[g])),this.containers[g].containerCache.over=0)}if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!h){for(this._trigger("beforeStop",f,this._uiHash()),g=0;j.length>g;g++){j[g].call(this,f)}this._trigger("stop",f,this._uiHash())}return this.fromOutside=!1,!1}if(h||this._trigger("beforeStop",f,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!h){for(g=0;j.length>g;g++){j[g].call(this,f)}this._trigger("stop",f,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){b.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(f){var d=f||this;return{helper:d.helper,placeholder:d.placeholder||b([]),position:d.position,originalPosition:d.originalPosition,offset:d.positionAbs,item:d.currentItem,sender:f?f.element:null}}})})(jQuery);(function(f){var d=0,c={},b={};c.height=c.paddingTop=c.paddingBottom=c.borderTopWidth=c.borderBottomWidth="hide",b.height=b.paddingTop=b.paddingBottom=b.borderTopWidth=b.borderBottomWidth="show",f.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var a=this.options;this.prevShow=this.prevHide=f(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),a.collapsible||a.active!==!1&&null!=a.active||(a.active=0),this._processPanels(),0>a.active&&(a.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():f(),content:this.active.length?this.active.next():f()}},_createIcons:function(){var a=this.options.icons;a&&(f("").addClass("ui-accordion-header-icon ui-icon "+a.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(a.header).addClass(a.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var a;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),a=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&a.css("height","")},_setOption:function(g,a){return"active"===g?(this._activate(a),undefined):("event"===g&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(a)),this._super(g,a),"collapsible"!==g||a||this.options.active!==!1||this._activate(0),"icons"===g&&(this._destroyIcons(),a&&this._createIcons()),"disabled"===g&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!a),undefined)},_keydown:function(h){if(!h.altKey&&!h.ctrlKey){var g=f.ui.keyCode,e=this.headers.length,j=this.headers.index(h.target),k=!1;switch(h.keyCode){case g.RIGHT:case g.DOWN:k=this.headers[(j+1)%e];break;case g.LEFT:case g.UP:k=this.headers[(j-1+e)%e];break;case g.SPACE:case g.ENTER:this._eventHandler(h);break;case g.HOME:k=this.headers[0];break;case g.END:k=this.headers[e-1]}k&&(f(h.target).attr("tabIndex",-1),f(k).attr("tabIndex",0),k.focus(),h.preventDefault())}},_panelKeyDown:function(a){a.keyCode===f.ui.keyCode.UP&&a.ctrlKey&&f(a.currentTarget).prev().focus()},refresh:function(){var a=this.options;this._processPanels(),a.active===!1&&a.collapsible===!0||!this.headers.length?(a.active=!1,this.active=f()):a.active===!1?this._activate(0):this.active.length&&!f.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(a.active=!1,this.active=f()):this._activate(Math.max(0,a.active-1)):a.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var g,e=this.options,h=e.heightStyle,k=this.element.parent(),j=this.accordionId="ui-accordion-"+(this.element.attr("id")||++d);this.active=this._findActive(e.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(o){var m=f(this),l=m.attr("id"),p=m.next(),q=p.attr("id");l||(l=j+"-header-"+o,m.attr("id",l)),q||(q=j+"-panel-"+o,p.attr("id",q)),m.attr("aria-controls",q),p.attr("aria-labelledby",l)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===h?(g=k.height(),this.element.siblings(":visible").each(function(){var l=f(this),i=l.css("position");"absolute"!==i&&"fixed"!==i&&(g-=l.outerHeight(!0))}),this.headers.each(function(){g-=f(this).outerHeight(!0)}),this.headers.next().each(function(){f(this).height(Math.max(0,g-f(this).innerHeight()+f(this).height()))}).css("overflow","auto")):"auto"===h&&(g=0,this.headers.next().each(function(){g=Math.max(g,f(this).css("height","").height())}).height(g))},_activate:function(e){var a=this._findActive(e)[0];a!==this.active[0]&&(a=a||this.active[0],this._eventHandler({target:a,currentTarget:a,preventDefault:f.noop}))},_findActive:function(a){return"number"==typeof a?this.headers.eq(a):f()},_setupEvents:function(e){var a={keydown:"_keydown"};e&&f.each(e.split(" "),function(h,g){a[g]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,a),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(q){var k=this.options,p=this.active,u=f(q.currentTarget),j=u[0]===p[0],e=j&&k.collapsible,g=e?f():u.next(),l=p.next(),m={oldHeader:p,oldPanel:l,newHeader:e?f():u,newPanel:g};q.preventDefault(),j&&!k.collapsible||this._trigger("beforeActivate",q,m)===!1||(k.active=e?!1:this.headers.index(u),this.active=j?f():u,this._toggle(m),p.removeClass("ui-accordion-header-active ui-state-active"),k.icons&&p.children(".ui-accordion-header-icon").removeClass(k.icons.activeHeader).addClass(k.icons.header),j||(u.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),k.icons&&u.children(".ui-accordion-header-icon").removeClass(k.icons.header).addClass(k.icons.activeHeader),u.next().addClass("ui-accordion-content-active")))},_toggle:function(h){var g=h.newPanel,e=this.prevShow.length?this.prevShow:h.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=g,this.prevHide=e,this.options.animate?this._animate(g,e,h):(e.hide(),g.show(),this._toggleComplete(h)),e.attr({"aria-hidden":"true"}),e.prev().attr("aria-selected","false"),g.length&&e.length?e.prev().attr({tabIndex:-1,"aria-expanded":"false"}):g.length&&this.headers.filter(function(){return 0===f(this).attr("tabIndex")}).attr("tabIndex",-1),g.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(m,y,z){var i,a,g,k=this,p=0,q=m.length&&(!y.length||m.index()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var d,c,e,g=this.element[0].nodeName.toLowerCase(),b="textarea"===g,f="input"===g;this.isMultiLine=b?!0:f?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[b||f?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){return d=!0,e=!0,c=!0,undefined}d=!1,e=!1,c=!1;var h=a.ui.keyCode;switch(i.keyCode){case h.PAGE_UP:d=!0,this._move("previousPage",i);break;case h.PAGE_DOWN:d=!0,this._move("nextPage",i);break;case h.UP:d=!0,this._keyEvent("previous",i);break;case h.DOWN:d=!0,this._keyEvent("next",i);break;case h.ENTER:case h.NUMPAD_ENTER:this.menu.active&&(d=!0,i.preventDefault(),this.menu.select(i));break;case h.TAB:this.menu.active&&this.menu.select(i);break;case h.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:c=!0,this._searchTimeout(i)}},keypress:function(h){if(d){return d=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&h.preventDefault(),undefined}if(!c){var i=a.ui.keyCode;switch(h.keyCode){case i.PAGE_UP:this._move("previousPage",h);break;case i.PAGE_DOWN:this._move("nextPage",h);break;case i.UP:this._keyEvent("previous",h);break;case i.DOWN:this._keyEvent("next",h)}}},input:function(h){return e?(e=!1,h.preventDefault(),undefined):(this._searchTimeout(h),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(h){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(h),this._change(h),undefined)}}),this._initSource(),this.menu=a("