diff --git a/admin/functions.php b/admin/functions.php index 585a5b0..4b7d4e9 100644 --- a/admin/functions.php +++ b/admin/functions.php @@ -7,6 +7,7 @@ function end_chmod($dir, $chm) { $per = substr($pdir, -3); if ($per != $chm) return "".$dir." не имеет нужных разрешений для записи на сервере.
Установите нужные атрибуты CHMOD - ".$chm.""; } + return; } ?> \ No newline at end of file diff --git a/admin/modules/blocks.php b/admin/modules/blocks.php index 3e21e0b..cf3c0a4 100644 --- a/admin/modules/blocks.php +++ b/admin/modules/blocks.php @@ -4,7 +4,16 @@ $prefix = "orbital"; -$allowed_modules = array( +// This change is made to list all PHPs in tracker root, to make +// manual adding of pages to block system obsolete +// Howewer, you can use array below to map filename to some human-readable name +$existing_modules = str_replace('.php', '', glob('*.php')); +$allowed_modules = array_combine($existing_modules, array_map( +function ($el) { + return "{$el}"; +}, $existing_modules)); + +$allowed_modules = array_merge($allowed_modules, array( "admincp" => "Админка", "browse" => "Обзор", "forums" => "Форум", @@ -24,8 +33,8 @@ "login" => "Вход", "mybonus" => "Мой Бонус", "invite" => "Приглашения", - "bookmarks" => "Закладки" -); + "bookmarks" => "Закладки", +)); function BlocksNavi() { global $admin_file; @@ -307,7 +316,7 @@ function BlocksEdit($bid) { $i++; $cel = ""; foreach ($where_mas as $key => $val) { - if ($val == $name) $cel = " checked"; + if ($val == $name) { $cel = " checked"; $title = "$title"; } // Just to highlight selected pages on block edit, due to many checkboxes now... } $title = str_replace("_", " ", $title); echo "$title"; diff --git a/admin/modules/faq.php b/admin/modules/faq.php index 614b18e..feb8239 100644 --- a/admin/modules/faq.php +++ b/admin/modules/faq.php @@ -54,8 +54,8 @@ function FaqAdmin() { print(""); } if ($faq_categ[$id]["items"][$id2][flag] == "0") $status = "Скрыто"; - elseif ($faq_categ[$id]["items"][$id2][flag] == "2") $status = "\"Updated\""; - elseif ($faq_categ[$id]["items"][$id2][flag] == "3") $status = "\"Новое\""; + elseif ($faq_categ[$id]["items"][$id2][flag] == "2") $status = "\"Updated\""; + elseif ($faq_categ[$id]["items"][$id2][flag] == "3") $status = "\"Новое\""; else $status = "Обычный"; print("". $faq_categ[$id]["items"][$id2]["question"] ."". $status ."E / D\n"); } @@ -90,7 +90,7 @@ function FaqAction() { global $admin_file; if ($_GET["action"] == "reorder") { foreach($_POST["order"] as $id => $position) - sql_query("UPDATE `faq` SET `order`='$position' WHERE id=".sqlesc((int)$id)) or sqlerr(__FILE__,__LINE__); + sql_query("UPDATE `faq` SET `order` = ".sqlesc($position)." WHERE id = ".sqlesc((int)$id)) or sqlerr(__FILE__,__LINE__); header("Location: $admin_file.php?op=FaqAdmin"); } diff --git a/announce.php b/announce.php index 00b3fd2..d180125 100644 --- a/announce.php +++ b/announce.php @@ -45,7 +45,7 @@ } foreach (array('port','downloaded','uploaded','left') as $x) - $GLOBALS[$x] = 0 + $_GET[$x]; + $GLOBALS[$x] = intval($_GET[$x]); if (get_magic_quotes_gpc()) { $info_hash = stripslashes($info_hash); diff --git a/blocks/block-online.php b/blocks/block-online.php index 88cb961..535b4d4 100644 --- a/blocks/block-online.php +++ b/blocks/block-online.php @@ -4,7 +4,9 @@ exit; } -global $CURUSER, $use_sessions; +global $CURUSER, $use_sessions, $tracker_lang; + +$blocktitle = $tracker_lang['whos_online']; $a = mysql_fetch_array(sql_query("SELECT id, username FROM users WHERE status='confirmed' ORDER BY id DESC LIMIT 1")); @@ -24,11 +26,10 @@ $users = $guests = $staff = $total = 0; -while (list($uid, $uname, $class) = mysql_fetch_row($result)) { - - $parsed = array(); - $parsed_id = array(); +$parsed = array(); +$parsed_id = array(); +while (list($uid, $uname, $class) = mysql_fetch_row($result)) { if (!empty($uname) && !in_array($uname, $parsed)) { $parsed[] = $uname; $title_who[] = "".get_user_class_color($class, $uname).""; diff --git a/blocks/block-releases.php b/blocks/block-releases.php index fadd558..e38a63a 100644 --- a/blocks/block-releases.php +++ b/blocks/block-releases.php @@ -26,8 +26,8 @@ $content .= ""; $content .= ""; $content .= ""; - $content .= ""; - $content .= ""; + $content .= ""; + $content .= ""; $content .= ""; $content .= "
".htmlspecialchars_uni($release["name"]).(get_user_class() >= UC_MODERATOR ? " - [Редактировать][Удалить]" : "")."
".(!empty($catname) ? "\"$catname\"" : "").format_comment($release["top"])."

".format_comment($release["center"])."

".format_comment($release["bottom"])."
".($release["imdb"] ? "[IMDB] " : "")."[Детали]
".(!empty($catimage) ? "\"$catname\"" : "$catname").format_comment($release["top"])."

".format_comment($release["center"])."

".format_comment($release["bottom"])."
".($release["imdb"] ? "[IMDB] " : "")."[Детали]
"; $content .= ""; diff --git a/blocks/block-search.php b/blocks/block-search.php index 041c957..4ddcafa 100644 --- a/blocks/block-search.php +++ b/blocks/block-search.php @@ -6,6 +6,8 @@ global $tracker_lang; +$blocktitle = $tracker_lang['search']; + $content = ' -
 '.$tracker_lang['torrents'].' diff --git a/blocks/block-stats.php b/blocks/block-stats.php index 1bcf880..3aa0192 100644 --- a/blocks/block-stats.php +++ b/blocks/block-stats.php @@ -1,10 +1,15 @@
- - - - - - - + + + + + + +
".$tracker_lang['users_registered']."\"Парни\"$male\"Девушки\"$female
".$tracker_lang['total'].": $registered
Мест на трекере$maxusers
".$tracker_lang['users_unconfirmed']."$unverified
".$tracker_lang['users_warned']." $warned_users
".$tracker_lang['users_disabled']." $disabled
".$tracker_lang['users_uploaders']."$uploaders
".$tracker_lang['users_vips']."$vip
{$tracker_lang['users_registered']}\"{$tracker_lang['stats_male']}\"$male\"{$tracker_lang['stats_female']}\"$female
{$tracker_lang['total']}: {$registered}
{$tracker_lang['stats_maxusers']}{$maxusers}
{$tracker_lang['users_unconfirmed']}{$unverified}
{$tracker_lang['users_warned']} {$warned_users}
{$tracker_lang['users_disabled']} {$disabled}
{$tracker_lang['users_uploaders']}{$uploaders}
{$tracker_lang['users_vips']}{$vip}
- - -"; +
".$tracker_lang['tracker_torrents']."$torrents
".$tracker_lang['tracker_dead_torrents']."$dead
".$tracker_lang['tracker_peers']."$peers
+ + +"; if (isset($peers)) { -$content .= " - -"; +$content .= " + +"; } +$content .= " +"; + $content .= "
{$tracker_lang['tracker_torrents']}{$torrents}
{$tracker_lang['tracker_dead_torrents']}{$dead}
{$tracker_lang['tracker_peers']}{$peers}
".$tracker_lang['tracker_seeders']."  $seeders
".$tracker_lang['tracker_leechers']."  $leechers
".$tracker_lang['tracker_seed_peer']."$ratio
{$tracker_lang['tracker_seeders']}  {$seeders}
{$tracker_lang['tracker_leechers']}  {$leechers}
{$tracker_lang['tracker_seed_peer']}{$ratio}
{$tracker_lang['external_seeders']}  {$external_seeders}
{$tracker_lang['external_leechers']}  {$external_leechers}
diff --git a/bookmarks.php b/bookmarks.php index 73a89dd..701d9f1 100644 --- a/bookmarks.php +++ b/bookmarks.php @@ -50,7 +50,7 @@ list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "bookmarks.php?"); -$res = sql_query("SELECT bookmarks.id AS bookmarkid, users.username, users.class, users.id AS owner, torrents.id, torrents.name, torrents.type, torrents.comments, torrents.leechers, torrents.seeders, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, torrents.save_as, torrents.numfiles, torrents.added, torrents.filename, torrents.size, torrents.views, torrents.visible, torrents.free, torrents.hits, torrents.times_completed, torrents.category FROM bookmarks INNER JOIN torrents ON bookmarks.torrentid = torrents.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN categories ON torrents.category = categories.id WHERE bookmarks.userid = ".sqlesc($CURUSER["id"])." ORDER BY torrents.id DESC $limit") or sqlerr(__FILE__, __LINE__); +$res = sql_query("SELECT bookmarks.id AS bookmarkid, users.username, users.class, users.id AS owner, torrents.id, torrents.name, torrents.info_hash, torrents.type, torrents.comments, (torrents.leechers + torrents.remote_leechers) AS leechers, (torrents.seeders + torrents.remote_seeders) AS seeders, torrents.multitracker, torrents.last_mt_update, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, torrents.save_as, torrents.numfiles, torrents.added, torrents.filename, torrents.size, torrents.views, torrents.visible, torrents.free, torrents.hits, torrents.times_completed, torrents.category FROM bookmarks INNER JOIN torrents ON bookmarks.torrentid = torrents.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN categories ON torrents.category = categories.id WHERE bookmarks.userid = ".sqlesc($CURUSER["id"])." ORDER BY torrents.id DESC $limit") or sqlerr(__FILE__, __LINE__); print("
"); print($pagertop); diff --git a/browse.php b/browse.php index b9533ec..8729396 100644 --- a/browse.php +++ b/browse.php @@ -38,46 +38,78 @@ $searchstr = ''; if (isset($_GET['search'])) - $searchstr = (string) unesc($_GET["search"]); + $searchstr = (string)unesc($_GET["search"]); $cleansearchstr = htmlspecialchars_uni($searchstr); if (empty($cleansearchstr)) - unset($cleansearchstr); + unset($cleansearchstr); // sorting by MarkoStamcar if (isset($_GET['sort']) && isset($_GET['type'])) { - $column = ''; - $ascdesc = ''; - - switch ($_GET['sort']) { - case '1': $column = "name"; break; - case '2': $column = "numfiles"; break; - case '3': $column = "comments"; break; - case '4': $column = "added"; break; - case '5': $column = "size"; break; - case '6': $column = "times_completed"; break; - case '7': $column = "seeders"; break; - case '8': $column = "leechers"; break; - case '9': $column = "owner"; break; - case '10': if (get_user_class() >= UC_MODERATOR) $column = "moderatedby"; break; - default: $column = "id"; break; - } - - switch ($_GET['type']) { - case 'asc': $ascdesc = "ASC"; $linkascdesc = "asc"; break; - case 'desc': $ascdesc = "DESC"; $linkascdesc = "desc"; break; - default: $ascdesc = "DESC"; $linkascdesc = "desc"; break; - } - - - $orderby = "ORDER BY torrents." . $column . " " . $ascdesc; - $pagerlink = "sort=" . intval($_GET['sort']) . "&type=" . $linkascdesc . "&"; + $column = ''; + $ascdesc = ''; + + switch ($_GET['sort']) { + case '1': + $column = "name"; + break; + case '2': + $column = "numfiles"; + break; + case '3': + $column = "comments"; + break; + case '4': + $column = "added"; + break; + case '5': + $column = "size"; + break; + case '6': + $column = "times_completed"; + break; + case '7': + $column = "seeders"; + break; + case '8': + $column = "leechers"; + break; + case '9': + $column = "owner"; + break; + case '10': + if (get_user_class() >= UC_MODERATOR) + $column = "moderatedby"; + break; + default: + $column = "id"; + break; + } + + switch ($_GET['type']) { + case 'asc': + $ascdesc = "ASC"; + $linkascdesc = "asc"; + break; + case 'desc': + $ascdesc = "DESC"; + $linkascdesc = "desc"; + break; + default: + $ascdesc = "DESC"; + $linkascdesc = "desc"; + break; + } + + + $orderby = "ORDER BY t." . $column . " " . $ascdesc; + $pagerlink = "sort=" . intval($_GET['sort']) . "&type=" . $linkascdesc . "&"; } else { - $orderby = "ORDER BY torrents.sticky ASC, torrents.id DESC"; - $pagerlink = ""; + $orderby = "ORDER BY t.not_sticky DESC, t.id DESC"; + $pagerlink = ""; } @@ -87,269 +119,269 @@ $incldead = 0; if (isset($_GET['incldead'])) { - if ($_GET["incldead"] == 1) { - $addparam .= "incldead=1&"; - if (!isset($CURUSER) || get_user_class() < UC_ADMINISTRATOR) - $wherea[] = "banned != 'yes'"; - } - elseif ($_GET["incldead"] == 2) { - $addparam .= "incldead=2&"; - $wherea[] = "visible = 'no'"; - } - elseif ($_GET["incldead"] == 3) { - $addparam .= "incldead=3&"; - $wherea[] = "free = 'yes'"; - $wherea[] = "visible = 'yes'"; - } - elseif ($_GET["incldead"] == 4) { - $addparam .= "incldead=4&"; - $wherea[] = "seeders = 0"; - $wherea[] = "visible = 'yes'"; - } - $incldead = (int) $_GET['incldead']; + if ($_GET["incldead"] == 1) { + $addparam .= "incldead=1&"; + if (!isset($CURUSER) || get_user_class() < UC_ADMINISTRATOR) + $wherea[] = "banned != 'yes'"; + } elseif ($_GET["incldead"] == 2) { + $addparam .= "incldead=2&"; + $wherea[] = "visible = 'no'"; + } elseif ($_GET["incldead"] == 3) { + $addparam .= "incldead=3&"; + $wherea[] = "free = 'yes'"; + $wherea[] = "visible = 'yes'"; + } elseif ($_GET["incldead"] == 4) { + $addparam .= "incldead=4&"; + $wherea[] = "seeders = 0"; + $wherea[] = "visible = 'yes'"; + } + $incldead = (int)$_GET['incldead']; } else - $wherea[] = "visible = 'yes'"; + $wherea[] = "visible = 'yes'"; if (isset($_GET['cat'])) - $category = (int) $_GET["cat"]; -else - $category = 0; + $category = (int)$_GET["cat"]; else + $category = 0; if (isset($_GET['all'])) - $all = $_GET["all"]; -else - $all = false; + $all = $_GET["all"]; else + $all = false; if (!$all) -if (!$_GET && $CURUSER["notifs"]) { - $all = True; - foreach ($cats as $cat) { - $all &= $cat[id]; - if (strpos($CURUSER["notifs"], "[cat" . $cat[id] . "]") !== false) { - $wherecatina[] = $cat[id]; - $addparam .= "c$cat[id]=1&"; - } - } -} elseif ($category) { - if (!is_valid_id($category)) - stderr($tracker_lang['error'], "Invalid category ID."); - $wherecatina[] = $category; - $addparam .= "cat=$category&"; -} else { - $all = true; - foreach ($cats as $cat) { - $all &= $_GET["cr$car[id]"]; - if (isset($_GET["c$cat[id]"])) { - $wherecatina[] = $cat[id]; - $addparam .= "c$cat[id]=1&"; - } - } -} + if (!$_GET && $CURUSER["notifs"]) { + $all = True; + foreach ($cats as $cat) { + $all &= $cat[id]; + if (strpos($CURUSER["notifs"], "[cat" . $cat[id] . "]") !== false) { + $wherecatina[] = $cat[id]; + $addparam .= "c$cat[id]=1&"; + } + } + } elseif ($category) { + if (!is_valid_id($category)) + stderr($tracker_lang['error'], "Invalid category ID."); + $wherecatina[] = $category; + $addparam .= "cat=$category&"; + } else { + $all = true; + foreach ($cats as $cat) { + $all &= $_GET["cr$car[id]"]; + if (isset($_GET["c$cat[id]"])) { + $wherecatina[] = $cat[id]; + $addparam .= "c$cat[id]=1&"; + } + } + } if ($all) { - $wherecatina = array(); - $addparam = ""; + $wherecatina = array(); + $addparam = ""; } if (count($wherecatina) > 1) - $wherecatin = implode(",",$wherecatina); -elseif (count($wherecatina) == 1) - $wherea[] = "category = $wherecatina[0]"; + $wherecatin = implode(",", $wherecatina); elseif (count($wherecatina) == 1) + $wherea[] = "category = $wherecatina[0]"; $wherebase = $wherea; if (isset($cleansearchstr)) { - $wherea[] = "torrents.name LIKE '%" . sqlwildcardesc($searchstr) . "%'"; - $addparam .= "search=" . urlencode($searchstr) . "&"; + $wherea[] = "t.name LIKE '%" . sqlwildcardesc($searchstr) . "%'"; + $addparam .= "search=" . urlencode($searchstr) . "&"; } $where = implode(" AND ", $wherea); if (isset($wherecatin) && !empty($wherecatin)) - $where .= ($where ? " AND " : "") . "category IN (" . $wherecatin . ")"; + $where .= ($where ? " AND " : "") . "t.category IN (" . $wherecatin . ")"; if ($where != "") - $where = "WHERE $where"; + $where = "WHERE $where"; -$res = sql_query("SELECT COUNT(*) FROM torrents $where") or die(mysql_error()); +$res = sql_query("SELECT COUNT(*) FROM torrents AS t $where") or die(mysql_error()); $row = mysql_fetch_array($res); $count = $row[0]; $num_torrents = $count; if (!$count && isset($cleansearchstr)) { - $wherea = $wherebase; - //$orderby = "ORDER BY id DESC"; - $searcha = explode(" ", $cleansearchstr); - $sc = 0; - foreach ($searcha as $searchss) { - if (strlen($searchss) <= 1) - continue; - $sc++; - if ($sc > 5) - break; - $ssa = array(); - $ssa[] = "torrents.name LIKE '%" . sqlwildcardesc($searchss) . "%'"; - } - if ($sc) { - $where = implode(" AND ", $wherea); - if ($where != "") - $where = "WHERE $where"; - $res = sql_query("SELECT COUNT(*) FROM torrents $where"); - $row = mysql_fetch_array($res); - $count = $row[0]; - } + $wherea = $wherebase; + //$orderby = "ORDER BY id DESC"; + $searcha = explode(" ", $cleansearchstr); + $sc = 0; + foreach ($searcha as $searchss) { + if (strlen($searchss) <= 1) + continue; + $sc++; + if ($sc > 5) + break; + $ssa = array(); + $ssa[] = "t.name LIKE '%" . sqlwildcardesc($searchss) . "%'"; + } + if ($sc) { + $where = implode(" AND ", $wherea); + if ($where != "") + $where = "WHERE $where"; + $res = sql_query("SELECT COUNT(*) FROM torrents AS t $where"); + $row = mysql_fetch_array($res); + $count = $row[0]; + } } $torrentsperpage = $CURUSER["torrentsperpage"]; if (!$torrentsperpage) - $torrentsperpage = 25; + $torrentsperpage = 25; -if ($count) -{ +if ($count) { if ($addparam != "") { - if ($pagerlink != "") { - if ($addparam{strlen($addparam)-1} != ";") { // & = & - $addparam = $addparam . "&" . $pagerlink; - } else { - $addparam = $addparam . $pagerlink; - } - } + if ($pagerlink != "") { + if ($addparam{strlen($addparam) - 1} != ";") { // & = & + $addparam = $addparam . "&" . $pagerlink; + } else { + $addparam = $addparam . $pagerlink; + } + } } else { - $addparam = $pagerlink; + $addparam = $pagerlink; } - list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "browse.php?" . $addparam); - $query = "SELECT torrents.id, torrents.moderated, torrents.moderatedby, torrents.category, torrents.leechers, torrents.seeders, torrents.free, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.sticky, torrents.owner," . - "IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, categories.name AS cat_name, categories.image AS cat_pic, users.username, users.class".($CURUSER ? ", EXISTS(SELECT * FROM readtorrents WHERE readtorrents.userid = ".sqlesc($CURUSER["id"])." AND readtorrents.torrentid = torrents.id) AS readtorrent" : ", 1 AS readtorrent")." FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit"; - $res = sql_query($query) or die(mysql_error()); -} -else - unset($res); + list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "browse.php?" . $addparam); + $query = "SELECT t.id, t.moderated, t.moderatedby, t.category, (t.leechers + t.remote_leechers) AS leechers, (t.seeders + t.remote_seeders) AS seeders, t.multitracker, t.last_mt_update, t.free, t.name, t.info_hash, t.times_completed, t.size, t.added, t.comments, t.numfiles, t.filename, t.not_sticky, t.owner," . "IF(t.numratings < $minvotes, NULL, ROUND(t.ratingsum / t.numratings, 1)) AS rating, c.name AS cat_name, c.image AS cat_pic, u.username, u.class" . ($CURUSER ? ", EXISTS(SELECT * FROM readtorrents WHERE readtorrents.userid = " . sqlesc($CURUSER["id"]) . " AND readtorrents.torrentid = t.id) AS readtorrent" : ", 1 AS readtorrent") . " FROM torrents AS t LEFT JOIN categories AS c ON t.category = c.id LEFT JOIN users AS u ON t.owner = u.id $where $orderby $limit"; + $res = sql_query($query) or die(mysql_error()); +} else + unset($res); if (isset($cleansearchstr)) - stdhead($tracker_lang['search_results_for']." \"$cleansearchstr\""); -else - stdhead($tracker_lang['browse']); + stdhead($tracker_lang['search_results_for'] . " \"$cleansearchstr\""); else + stdhead($tracker_lang['browse']); ?> - + - - - + \n"); + print(''); -print(""); +echo ''; if ($num_torrents) { - print(""); + echo ''; - torrenttable($res, "index"); + torrenttable($res, "index"); - print(""); + echo ''; -} -else { - if (isset($cleansearchstr)) { - print("\n"); - //print("

Попробуйте изменить запрос поиска.

\n"); - } - else { - print("\n"); - //print("

Извините, данная категория пустая.

\n"); - } +} else { + if (isset($cleansearchstr)) { + print("\n"); + //print("

Попробуйте изменить запрос поиска.

\n"); + } else { + print("\n"); + //print("

Извините, данная категория пустая.

\n"); + } } -print("
Список торрентов
- -
- - - - -
- +
- -" : ""); - print("\n"); - $i++; -} - -$alllink = ""; - -$ncats = count($cats); -$nrows = ceil($ncats/$catsperrow); -$lastrowcols = $ncats % $catsperrow; - -if ($lastrowcols != 0) -{ - if ($catsperrow - $lastrowcols != 1) - { - print(""); - } -} -?> + -
" . htmlspecialchars_uni($cat['name']) . " Список торрентов
-
-
-: - - - - - -
- - - -
+
+ +
+ + + + + + + +
+ + + + " : ""); + print("\n"); + $i++; + } + + $alllink = ""; + + $ncats = count($cats); + $nrows = ceil($ncats / $catsperrow); + $lastrowcols = $ncats % $catsperrow; + + if ($lastrowcols != 0) { + if ($catsperrow - $lastrowcols != 1) { + print(""); + } + } + ?> + +
" . htmlspecialchars_uni($cat['name']) . " 
+
+
+ : + + + + + +
+ + + +
".$tracker_lang['search_results_for']." \"" . htmlspecialchars_uni($searchstr) . "\"
' . $tracker_lang['search_results_for'] . ' "' . htmlspecialchars_uni($searchstr) . '"
"); - print($pagertop); - print("
'; + echo $pagertop; + echo '
"); - print($pagerbottom); - print("
'; + echo $pagerbottom; + echo '
".$tracker_lang['nothing_found']."
".$tracker_lang['nothing_found']."
" . $tracker_lang['nothing_found'] . "
" . $tracker_lang['nothing_found'] . "
"); +echo '
'; stdfoot(); diff --git a/comment.php b/comment.php index 03fbdee..8cb97bc 100644 --- a/comment.php +++ b/comment.php @@ -57,6 +57,8 @@ $newid = mysql_insert_id(); + sql_query('INSERT INTO comments_parsed (cid, text_hash, text_parsed) VALUES ('.implode(', ', array_map('sqlesc', array($newid, md5($text), format_comment($text)))).')') or sqlerr(__FILE__,__LINE__); + sql_query("UPDATE torrents SET comments = comments + 1 WHERE id = $torrentid"); /////////////////СЛЕЖЕНИЕ ЗА КОММЕНТАМИ///////////////// @@ -188,12 +190,15 @@ if ($text == "") stderr($tracker_lang['error'], $tracker_lang['comment_cant_be_empty']); + $orig_text = $text; $text = sqlesc($text); $editedat = sqlesc(get_date_time()); sql_query("UPDATE comments SET text=$text, editedat=$editedat, editedby=$CURUSER[id] WHERE id=$commentid") or sqlerr(__FILE__, __LINE__); + sql_query('REPLACE INTO comments_parsed (cid, text_hash, text_parsed) VALUES ('.implode(', ', array_map('sqlesc', array($commentid, md5($orig_text), format_comment($orig_text)))).')') or sqlerr(__FILE__,__LINE__); + if ($returnto) header("Location: $returnto"); else diff --git a/contactus.php b/contactus.php new file mode 100644 index 0000000..7806175 --- /dev/null +++ b/contactus.php @@ -0,0 +1,140 @@ +НЕ было отправлено администрации, из-за непредвиденной ошибки сервера.', 'error'); + stdfoot(); + +} else { + stdhead('Связаться с нами'); + if ($use_captcha) { + include_once("include/captcha.php"); + $hash = create_captcha(); + } +?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Связаться с нами +
+ Ваш Email: + + +
+ Тема: + + +
+ Сообщение: + + +
+ Код безопасности: + + +

Пожалуйста, введите текст изображенный на картинке внизу.
Этот процесс предотвращает автоматическую регистрацию.

+ Captcha
+ Код чувствителен к регистру
+ Кликните два раза на картинке, что-бы обновить картинку. + +
+ + +
+
+ \ No newline at end of file diff --git a/details.php b/details.php index f584fd8..53d5621 100644 --- a/details.php +++ b/details.php @@ -28,460 +28,566 @@ require_once("include/bittorrent.php"); dbconn(false); -loggedinorreturn(); +if (!$allow_guests_details) + loggedinorreturn(); function getagent($httpagent, $peer_id = "") { - if (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]\_B([0-9][0-9|*])(.+)$)/", $httpagent, $matches)) - return "Azureus/$matches[1]"; - elseif (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]\_CVS)/", $httpagent, $matches)) - return "Azureus/$matches[1]"; - elseif (preg_match("/^Java\/([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) - return "Azureus/<2.0.7.0"; - elseif (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) - return "Azureus/$matches[1]"; - elseif (preg_match("/BitTorrent\/S-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) - return "Shadow's/$matches[1]"; - elseif (preg_match("/BitTorrent\/U-([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) - return "UPnP/$matches[1]"; - elseif (preg_match("/^BitTor(rent|nado)\\/T-(.+)$/", $httpagent, $matches)) - return "BitTornado/$matches[2]"; - elseif (preg_match("/^BitTornado\\/T-(.+)$/", $httpagent, $matches)) - return "BitTornado/$matches[1]"; - elseif (preg_match("/^BitTorrent\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) - return "ABC/$matches[1]"; - elseif (preg_match("/^ABC ([0-9]+\.[0-9]+(\.[0-9]+)*)\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) - return "ABC/$matches[1]"; - elseif (preg_match("/^Python-urllib\/.+?, BitTorrent\/([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) - return "BitTorrent/$matches[1]"; - elseif (preg_match("/^BitTorrent\/brst(.+)/", $httpagent, $matches)) - return "Burst"; - elseif (preg_match("/^RAZA (.+)$/", $httpagent, $matches)) - return "Shareaza/$matches[1]"; - elseif (preg_match("/Rufus\/([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) - return "Rufus/$matches[1]"; - elseif (preg_match("/^Python-urllib\\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) - return "G3 Torrent"; - elseif (preg_match("/MLDonkey\/([0-9]+).([0-9]+).([0-9]+)*/", $httpagent, $matches)) - return "MLDonkey/$matches[1].$matches[2].$matches[3]"; - elseif (preg_match("/ed2k_plugin v([0-9]+\\.[0-9]+).*/", $httpagent, $matches)) - return "eDonkey/$matches[1]"; - elseif (preg_match("/uTorrent\/([0-9]+)([0-9]+)([0-9]+)([0-9A-Z]+)/", $httpagent, $matches)) - return "µTorrent/$matches[1].$matches[2].$matches[3].$matches[4]"; - elseif (preg_match("/CT([0-9]+)([0-9]+)([0-9]+)([0-9]+)/", $peer_id, $matches)) - return "cTorrent/$matches[1].$matches[2].$matches[3].$matches[4]"; - elseif (preg_match("/Transmission\/([0-9]+).([0-9]+)/", $httpagent, $matches)) - return "Transmission/$matches[1].$matches[2]"; - elseif (preg_match("/KT([0-9]+)([0-9]+)([0-9]+)([0-9]+)/", $peer_id, $matches)) - return "KTorrent/$matches[1].$matches[2].$matches[3].$matches[4]"; - elseif (preg_match("/rtorrent\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) - return "rTorrent/$matches[1]"; - elseif (preg_match("/^ABC\/Tribler_ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) - return "Tribler/$matches[1]"; - elseif (preg_match("/^BitsOnWheels( |\/)([0-9]+\\.[0-9]+).*/", $httpagent, $matches)) - return "BitsOnWheels/$matches[2]"; - elseif (preg_match("/BitTorrentPlus\/(.+)$/", $httpagent, $matches)) - return "BitTorrent Plus!/$matches[1]"; - elseif (preg_match("/^Deadman Walking/", $httpagent)) - return "Deadman Walking"; - elseif (preg_match("/^eXeem( |\/)([0-9]+\\.[0-9]+).*/", $httpagent, $matches)) - return "eXeem$matches[1]$matches[2]"; - elseif (preg_match("/^libtorrent\/(.+)$/", $httpagent, $matches)) - return "libtorrent/$matches[1]"; - elseif (substr($peer_id, 0, 12) == "d0c") - return "Mainline"; - elseif (substr($peer_id, 0, 1) == "M") - return "Mainline/Decoded"; - elseif (substr($peer_id, 0, 3) == "-BB") - return "BitBuddy"; - elseif (substr($peer_id, 0, 8) == "-AR1001-") - return "Arctic Torrent/1.2.3"; - elseif (substr($peer_id, 0, 6) == "exbc\08") - return "BitComet/0.56"; - elseif (substr($peer_id, 0, 6) == "exbc\09") - return "BitComet/0.57"; - elseif (substr($peer_id, 0, 6) == "exbc\0:") - return "BitComet/0.58"; - elseif (substr($peer_id, 0, 4) == "-BC0") - return "BitComet/0.".substr($peer_id, 5, 2); - elseif (substr($peer_id, 0, 7) == "exbc\0L") - return "BitLord/1.0"; - elseif (substr($peer_id, 0, 7) == "exbcL") - return "BitLord/1.1"; - elseif (substr($peer_id, 0, 3) == "346") - return "TorrenTopia"; - elseif (substr($peer_id, 0, 8) == "-MP130n-") - return "MooPolice"; - elseif (substr($peer_id, 0, 8) == "-SZ2210-") - return "Shareaza/2.2.1.0"; - elseif (preg_match("/^0P3R4H/", $httpagent)) - return "Opera BT Client"; - elseif (substr($peer_id, 0, 6) == "A310--") - return "ABC/3.1"; - elseif (preg_match("/^XBT Client/", $httpagent)) - return "XBT Client"; - elseif (preg_match("/^BitTorrent\/BitSpirit$/", $httpagent)) - return "BitSpirit"; - elseif (preg_match("/^DansClient/", $httpagent)) - return "XanTorrent"; - else - return "Unknown"; + if (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]\_B([0-9][0-9|*])(.+)$)/", $httpagent, $matches)) + return "Azureus/$matches[1]"; + elseif (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]\_CVS)/", $httpagent, $matches)) + return "Azureus/$matches[1]"; + elseif (preg_match("/^Java\/([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) + return "Azureus/<2.0.7.0"; + elseif (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) + return "Azureus/$matches[1]"; + elseif (preg_match("/BitTorrent\/S-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) + return "Shadow's/$matches[1]"; + elseif (preg_match("/BitTorrent\/U-([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) + return "UPnP/$matches[1]"; + elseif (preg_match("/^BitTor(rent|nado)\\/T-(.+)$/", $httpagent, $matches)) + return "BitTornado/$matches[2]"; + elseif (preg_match("/^BitTornado\\/T-(.+)$/", $httpagent, $matches)) + return "BitTornado/$matches[1]"; + elseif (preg_match("/^BitTorrent\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) + return "ABC/$matches[1]"; + elseif (preg_match("/^ABC ([0-9]+\.[0-9]+(\.[0-9]+)*)\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) + return "ABC/$matches[1]"; + elseif (preg_match("/^Python-urllib\/.+?, BitTorrent\/([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) + return "BitTorrent/$matches[1]"; + elseif (preg_match("/^BitTorrent\/brst(.+)/", $httpagent, $matches)) + return "Burst"; + elseif (preg_match("/^RAZA (.+)$/", $httpagent, $matches)) + return "Shareaza/$matches[1]"; + elseif (preg_match("/Rufus\/([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches)) + return "Rufus/$matches[1]"; + elseif (preg_match("/^Python-urllib\\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) + return "G3 Torrent"; + elseif (preg_match("/MLDonkey\/([0-9]+).([0-9]+).([0-9]+)*/", $httpagent, $matches)) + return "MLDonkey/$matches[1].$matches[2].$matches[3]"; + elseif (preg_match("/ed2k_plugin v([0-9]+\\.[0-9]+).*/", $httpagent, $matches)) + return "eDonkey/$matches[1]"; + elseif (preg_match("/uTorrent\/([0-9]+)([0-9]+)([0-9]+)([0-9A-Z]+)/", $httpagent, $matches)) + return "µTorrent/$matches[1].$matches[2].$matches[3].$matches[4]"; + elseif (preg_match("/CT([0-9]+)([0-9]+)([0-9]+)([0-9]+)/", $peer_id, $matches)) + return "cTorrent/$matches[1].$matches[2].$matches[3].$matches[4]"; + elseif (preg_match("/Transmission\/([0-9]+).([0-9]+)/", $httpagent, $matches)) + return "Transmission/$matches[1].$matches[2]"; + elseif (preg_match("/KT([0-9]+)([0-9]+)([0-9]+)([0-9]+)/", $peer_id, $matches)) + return "KTorrent/$matches[1].$matches[2].$matches[3].$matches[4]"; + elseif (preg_match("/rtorrent\/([0-9]+\\.[0-9]+(\\.[0-9]+)*)/", $httpagent, $matches)) + return "rTorrent/$matches[1]"; + elseif (preg_match("/^ABC\/Tribler_ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches)) + return "Tribler/$matches[1]"; + elseif (preg_match("/^BitsOnWheels( |\/)([0-9]+\\.[0-9]+).*/", $httpagent, $matches)) + return "BitsOnWheels/$matches[2]"; + elseif (preg_match("/BitTorrentPlus\/(.+)$/", $httpagent, $matches)) + return "BitTorrent Plus!/$matches[1]"; + elseif (preg_match("/^Deadman Walking/", $httpagent)) + return "Deadman Walking"; + elseif (preg_match("/^eXeem( |\/)([0-9]+\\.[0-9]+).*/", $httpagent, $matches)) + return "eXeem$matches[1]$matches[2]"; + elseif (preg_match("/^libtorrent\/(.+)$/", $httpagent, $matches)) + return "libtorrent/$matches[1]"; + elseif (substr($peer_id, 0, 12) == "d0c") + return "Mainline"; + elseif (substr($peer_id, 0, 1) == "M") + return "Mainline/Decoded"; + elseif (substr($peer_id, 0, 3) == "-BB") + return "BitBuddy"; + elseif (substr($peer_id, 0, 8) == "-AR1001-") + return "Arctic Torrent/1.2.3"; + elseif (substr($peer_id, 0, 6) == "exbc\08") + return "BitComet/0.56"; + elseif (substr($peer_id, 0, 6) == "exbc\09") + return "BitComet/0.57"; + elseif (substr($peer_id, 0, 6) == "exbc\0:") + return "BitComet/0.58"; + elseif (substr($peer_id, 0, 4) == "-BC0") + return "BitComet/0." . substr($peer_id, 5, 2); + elseif (substr($peer_id, 0, 7) == "exbc\0L") + return "BitLord/1.0"; + elseif (substr($peer_id, 0, 7) == "exbcL") + return "BitLord/1.1"; + elseif (substr($peer_id, 0, 3) == "346") + return "TorrenTopia"; + elseif (substr($peer_id, 0, 8) == "-MP130n-") + return "MooPolice"; + elseif (substr($peer_id, 0, 8) == "-SZ2210-") + return "Shareaza/2.2.1.0"; + elseif (preg_match("/^0P3R4H/", $httpagent)) + return "Opera BT Client"; + elseif (substr($peer_id, 0, 6) == "A310--") + return "ABC/3.1"; + elseif (preg_match("/^XBT Client/", $httpagent)) + return "XBT Client"; + elseif (preg_match("/^BitTorrent\/BitSpirit$/", $httpagent)) + return "BitSpirit"; + elseif (preg_match("/^DansClient/", $httpagent)) + return "XanTorrent"; + else + return "Unknown"; } -function dltable($name, $arr, $torrent) -{ - - global $tracker_lang; - $s = "" . count($arr) . " $name\n"; - if (!count($arr)) - return $s; - $s .= "\n"; - $s .= "\n"; - $s .= "" . - "". - "". - "". - "" . - "" . - "" . - "" . - "" . - "" . - "\n"; - $now = time(); - //$moderator = (isset($CURUSER) && get_user_class() >= UC_MODERATOR); // Redundant - $mod = (get_user_class() >= UC_MODERATOR); - foreach ($arr as $e) { - // user/ip/port - // check if anyone has this ip - $s .= "\n"; - if ($e["username"]) - $s .= "\n"; - else - $s .= "\n"; - $secs = max(10, ($e["la"]) - $e["pa"]); - $s .= "\n"; - $s .= "\n"; - $s .= "\n"; - $s .= "\n"; - //if ($e["seeder"] == "no") - $s .= "\n"; - /*else - $s .= "\n";*/ - if ($e["downloaded"]) { - $ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000; - $s .= "\n"; - } else - if ($e["uploaded"]) - $s .= "\n"; - else - $s .= "\n"; - $s .= "\n"; - $s .= "\n"; - $s .= "\n"; - $s .= "\n"; - $s .= "\n"; - } - $s .= "
".$tracker_lang['user']."".$tracker_lang['port_open']."".$tracker_lang['uploaded']."".$tracker_lang['ul_speed']."".$tracker_lang['downloaded']."".$tracker_lang['dl_speed']."".$tracker_lang['ratio']."".$tracker_lang['completed']."".$tracker_lang['connected']."".$tracker_lang['idle']."".$tracker_lang['client']."
".get_user_class_color($e["class"], $e["username"])."".($mod ? " [IP]" : "")."" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . "" . ($e['connectable'] == "yes" ? "".$tracker_lang['yes']."" : "".$tracker_lang['no']."") . "" . mksize($e["uploaded"]) . "" . mksize($e["uploadoffset"] / $secs) . "/s" . mksize($e["downloaded"]) . "" . mksize($e["downloadoffset"] / $secs) . "/s" . mksize($e["downloadoffset"] / max(1, $e["finishedat"] - $e["st"])) . "/s" . number_format($ratio, 3) . "Inf.---" . sprintf("%.2f%%", 100 * (1 - ($e["to_go"] / $torrent["size"]))) . "" . mkprettytime($now - $e["st"]) . "" . mkprettytime($now - $e["la"]) . "" . htmlspecialchars_uni(getagent($e["agent"], $e["peer_id"])) . "
\n"; - return $s; +function dltable($name, $arr, $torrent) { + global $tracker_lang; + $s = "" . count($arr) . " $name\n"; + if (!count($arr)) + return $s; + $s .= "\n"; + $s .= "\n"; + $s .= "" . + "". + "". + "". + "" . + "" . + "" . + "" . + "" . + "" . + "\n"; + $now = time(); + //$moderator = (isset($CURUSER) && get_user_class() >= UC_MODERATOR); // Redundant + $mod = (get_user_class() >= UC_MODERATOR); + foreach ($arr as $e) { + // user/ip/port + // check if anyone has this ip + $s .= "\n"; + if ($e["username"]) + $s .= "\n"; + else + $s .= "\n"; + $secs = max(10, ($e["la"]) - $e["pa"]); + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + //if ($e["seeder"] == "no") + $s .= "\n"; + /*else + $s .= "\n";*/ + if ($e["downloaded"]) { + $ratio = floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000; + $s .= "\n"; + } else + if ($e["uploaded"]) + $s .= "\n"; + else + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + $s .= "\n"; + } + $s .= "
{$tracker_lang['user']}{$tracker_lang['port_open']}{$tracker_lang['uploaded']}{$tracker_lang['ul_speed']}{$tracker_lang['downloaded']}{$tracker_lang['dl_speed']}{$tracker_lang['ratio']}{$tracker_lang['completed']}{$tracker_lang['connected']}{$tracker_lang['idle']}{$tracker_lang['client']}
".get_user_class_color($e["class"], $e["username"])."".($mod ? " [IP]" : "")."" . ($mod ? $e["ip"] : preg_replace('/\.\d+$/', ".xxx", $e["ip"])) . "" . ($e['connectable'] == "yes" ? "{$tracker_lang['yes']}" : "{$tracker_lang['no']}") . "" . mksize($e["uploaded"]) . "" . mksize($e["uploadoffset"] / $secs) . "/s" . mksize($e["downloaded"]) . "" . mksize($e["downloadoffset"] / $secs) . "/s" . mksize($e["downloadoffset"] / max(1, $e["finishedat"] - $e["st"])) . "/s" . number_format($ratio, 3) . "Inf.---" . sprintf("%.2f%%", 100 * (1 - ($e["to_go"] / $torrent["size"]))) . "" . mkprettytime($now - $e["st"]) . "" . mkprettytime($now - $e["la"]) . "" . htmlspecialchars_uni(getagent($e["agent"], $e["peer_id"])) . "
\n"; + return $s; } $id = intval($_GET["id"]); if (!isset($id) || !$id) - die(); + die(); -$res = sql_query("SELECT t.free, t.seeders, t.banned, t.leechers, t.info_hash, t.filename, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(t.last_action) AS lastseed, t.numratings, t.name, IF(t.numratings < $minvotes, NULL, ROUND(t.ratingsum / t.numratings, 1)) AS rating, t.owner, t.save_as, t.descr, t.visible, t.size, t.added, t.views, t.hits, t.times_completed, t.id, t.type, t.numfiles, t.image1, t.image2, t.image3, t.image4, t.image5, c.name AS cat_name, u.username FROM torrents AS t LEFT JOIN categories AS c ON t.category = c.id LEFT JOIN users AS u ON t.owner = u.id WHERE t.id = $id") - or sqlerr(__FILE__, __LINE__); +$res = sql_query("SELECT td.descr_hash, td.descr_parsed, t.multitracker, t.last_mt_update, t.keywords, t.description, t.free, t.seeders, t.banned, t.leechers, t.info_hash, t.filename, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(t.last_action) AS lastseed, t.numratings, t.name, IF(t.numratings < $minvotes, NULL, ROUND(t.ratingsum / t.numratings, 1)) AS rating, t.owner, t.save_as, t.descr, t.visible, t.size, t.added, t.views, t.hits, t.times_completed, t.id, t.type, t.numfiles, t.image1, t.image2, t.image3, t.image4, t.image5, c.name AS cat_name, u.username FROM torrents AS t LEFT JOIN categories AS c ON t.category = c.id LEFT JOIN users AS u ON t.owner = u.id LEFT JOIN torrents_descr AS td ON td.tid = $id WHERE t.id = $id") or sqlerr(__FILE__, __LINE__); $row = mysql_fetch_array($res); +$keywords = $row['keywords']; +$description = $row['description']; + sql_query("INSERT INTO readtorrents (userid, torrentid) VALUES (".sqlesc($CURUSER["id"]).", ".sqlesc($id).")")/* or sqlerr(__FILE__,__LINE__)*/; $owned = $moderator = 0; - if (get_user_class() >= UC_MODERATOR) - $owned = $moderator = 1; - elseif ($CURUSER["id"] == $row["owner"]) - $owned = 1; +if (get_user_class() >= UC_MODERATOR) + $owned = $moderator = 1; +elseif ($CURUSER["id"] == $row["owner"]) + $owned = 1; //} if (!$row || ($row["banned"] == "yes" && !$moderator)) stderr($tracker_lang['error'], $tracker_lang['no_torrent_with_such_id']); -else { - if (isset($_GET["hit"])) { - sql_query("UPDATE torrents SET views = views + 1 WHERE id = $id"); - if (isset($_GET["tocomm"])) - header("Location: $DEFAULTBASEURL/details.php?id=$id&page=0#startcomments"); - elseif (isset($_GET["filelist"])) - header("Location: $DEFAULTBASEURL/details.php?id=$id&filelist=1#filelist"); - elseif (isset($_GET["toseeders"])) - header("Location: $DEFAULTBASEURL/details.php?id=$id&dllist=1#seeders"); - elseif (isset($_GET["todlers"])) - header("Location: $DEFAULTBASEURL/details.php?id=$id&dllist=1#leechers"); - else - header("Location: $DEFAULTBASEURL/details.php?id=$id"); - exit(); - } - - if (!isset($_GET["page"])) { - stdhead($tracker_lang['torrent_details']." \"" . $row["name"] . "\""); - - if ($CURUSER["id"] == $row["owner"] || get_user_class() >= UC_MODERATOR) - $owned = 1; - else - $owned = 0; - - $spacer = "       "; - - $prive = ""; - $s=$row["name"]; - - print("\n"); - print(""); - $url = "edit.php?id=" . $row["id"]; - if (isset($_GET["returnto"])) { - $addthis = "&returnto=" . urlencode($_GET["returnto"]); - $url .= $addthis; - $keepget .= $addthis; - } - $editlink = "a href=\"$url\" class=\"sublink\""; - - $s = "" . $row["name"] . ""; - if ($owned) - $s .= " $spacer<$editlink>[".$tracker_lang['edit']."]"; - - switch ($row['free']) { - case 'yes': - $freepic = "\"".$tracker_lang['golden']."\" "; - break; - case 'silver': - $freepic = "\"".$tracker_lang['silver']."\" "; - break; - case 'no': - $freepic = ''; - } - - tr ("{$row["cat_name"]}", $freepic.$s, 1, 1, "10%"); - - function hex_esc($matches) { - return sprintf("%02x", ord($matches[0])); - } - - tr($tracker_lang['info_hash'], $row["info_hash"]); - - if ($row["image1"] != "") { - if ($row["image1"] != "") - $img1 = ""; - tr('Постер', $img1, 1); + +if (isset($_GET["hit"])) { + sql_query("UPDATE torrents SET views = views + 1 WHERE id = $id"); + if (isset($_GET["tocomm"])) + header("Location: $DEFAULTBASEURL/details.php?id=$id&page=0#startcomments"); + elseif (isset($_GET["filelist"])) + header("Location: $DEFAULTBASEURL/details.php?id=$id&filelist=1#filelist"); + elseif (isset($_GET["toseeders"])) + header("Location: $DEFAULTBASEURL/details.php?id=$id&dllist=1#seeders"); + elseif (isset($_GET["todlers"])) + header("Location: $DEFAULTBASEURL/details.php?id=$id&dllist=1#leechers"); + else + header("Location: $DEFAULTBASEURL/details.php?id=$id"); + exit(); +} + +if (!isset($_GET["page"])) { + stdhead($tracker_lang['torrent_details']." \"".htmlspecialchars_decode($row["name"])."\""); + + if ($CURUSER["id"] == $row["owner"] || get_user_class() >= UC_MODERATOR) + $owned = 1; + else + $owned = 0; + + if ($row['multitracker'] == 'yes') { + $announces_a = $announces_urls = array(); + $announces_r = sql_query('SELECT url, seeders, leechers, last_update, state, error FROM torrents_scrape WHERE tid = '.$id); + while ($announce = mysql_fetch_array($announces_r)) { + $announces_a[] = $announce; + $announces_urls[] = $announce['url']; + } + unset($announce); + } + + $spacer = "       "; + $s = ""; + + print("
:: ".$tracker_lang['torrent_details']."
Добавить в избранное
\n"); + print(""); + $url = "edit.php?id=" . $row["id"]; + if (isset($_GET["returnto"])) { + $addthis = "&returnto=" . urlencode($_GET["returnto"]); + $url .= $addthis; + $keepget .= $addthis; + } + $editlink = "a href=\"$url\" class=\"sublink\""; + $right_links = array(); + + $right_links[] = "\"{$tracker_lang['download']}\""; + if ($row['multitracker'] == 'yes') + $right_links[] = "\"{$tracker_lang['magnet']}\""; + $right_links[] = "\"{$tracker_lang['bookmark']}\""; + + if (count($right_links)) + $s .= ''.implode(' ', $right_links).''; + + $s .= "{$row["name"]}"; + + if ($owned) + $s .= " $spacer<$editlink>[{$tracker_lang['edit']}]"; + + switch ($row['free']) { + case 'yes': + $freepic = "\"{$tracker_lang['golden']}\" "; + break; + case 'silver': + $freepic = "\"{$tracker_lang['silver']}\" "; + break; + case 'no': + $freepic = ''; + } + + tr ("{$row["cat_name"]}", $freepic.$s, 1, 1, "10%"); + + function hex_esc($matches) { + return sprintf("%02x", ord($matches[0])); + } + + tr($tracker_lang['info_hash'], $row["info_hash"]); + + if ($row["image1"] != "") { + if ($row["image1"] != "") + $img1 = ""; + tr($tracker_lang['details_poster'], $img1, 1); + } + + if (!empty($row["descr"])) { + if (md5($row['descr']) == $row['descr_hash']) + $descr = $row['descr_parsed']; + else { + $descr = format_comment($row['descr']); + sql_query('INSERT INTO torrents_descr (tid, descr_hash, descr_parsed) VALUES ('.implode(', ', array_map('sqlesc', array($id, md5($row['descr']), $descr))).')') or sqlerr(__FILE__,__LINE__); + } + tr($tracker_lang['description'], $descr, 1, 1); + } + + $images = array(); + + for ($i = 2; $i <= 5; $i++) { + if ($row['image'.$i]) + $images[] = ''; + } + if (count($images)) + tr($tracker_lang['images'], implode('  ', $images), 1); + + if ($row["visible"] == "no") + tr($tracker_lang['visible'], "{$tracker_lang['no']} ({$tracker_lang['dead']})", 1); + if ($moderator) + tr($tracker_lang['banned'], ($row["banned"] == 'no' ? $tracker_lang['no'] : $tracker_lang['yes']) ); + + if (isset($row["cat_name"])) + tr($tracker_lang['type'], $row["cat_name"]); + else + tr($tracker_lang['type'], "({$tracker_lang['no_choose']})"); + + tr($tracker_lang['seeder'], "{$tracker_lang['seeder_last_seen']} " . mkprettytime($row['lastseed']) . " {$tracker_lang['ago']}"); + tr($tracker_lang['size'], mksize($row['size']) . " (" . number_format($row['size']) . " {$tracker_lang['bytes']})"); + + /*$s = ""; + $s .= "
:: {$tracker_lang['torrent_details']}
{$tracker_lang['bookmark']}
"; + if (!isset($row["rating"])) { + if ($minvotes > 1) { + $s .= sprintf($tracker_lang['not_enough_votes'], $minvotes); + if ($row["numratings"]) + $s .= sprintf($tracker_lang['only_votes'], $row["numratings"]); + else + $s .= $tracker_lang['none_voted']; + $s .= ")"; + } else + $s .= $tracker_lang['no_votes']; + } else { + $rpic = ratingpic($row["rating"]); + if (!isset($rpic)) + $s .= "invalid?"; + else + $s .= "$rpic ({$row["rating"]} {$tracker_lang['from']} 5 {$tracker_lang['with']} {$row["numratings"]} {$tracker_lang['votes']})"; + } + $s .= "\n"; + $s .= "$spacer"; + if (!isset($CURUSER)) + $s .= "(Log in to rate it)"; else { + $ratings = array(5 => $tracker_lang['vote_5'], + 4 => $tracker_lang['vote_4'], + 3 => $tracker_lang['vote_3'], + 2 => $tracker_lang['vote_2'], + 1 => $tracker_lang['vote_1'],); + if (!$owned || $moderator) { + $xres = sql_query("SELECT rating, added FROM ratings WHERE torrent = $id AND user = " . $CURUSER["id"]); + $xrow = mysql_fetch_array($xres); + if ($xrow) + $s .= "({$tracker_lang['you_have_voted_for_this_torrent']} \"{$xrow["rating"]} - {$ratings[$xrow["rating"]]}\")"; else { + $s .= "
\n"; + $s .= "\n"; + $s .= ""; + $s .= "
\n"; + } + } + } + $s .= "
"; - if (!empty($row["descr"])) - tr($tracker_lang['description'], format_comment($row["descr"]), 1, 1); +?> + +'; - } - if (count($images)) - tr($tracker_lang['images'], implode('  ', $images), 1); - - if ($row["visible"] == "no") - tr($tracker_lang['visible'], "".$tracker_lang['no']." (".$tracker_lang['dead'].")", 1); - if ($moderator) - tr($tracker_lang['banned'], ($row["banned"] == 'no' ? $tracker_lang['no'] : $tracker_lang['yes']) ); - - if (isset($row["cat_name"])) - tr($tracker_lang['type'], $row["cat_name"]); - else - tr($tracker_lang['type'], "(".$tracker_lang['no_choose'].")"); - - tr($tracker_lang['seeder'], $tracker_lang['seeder_last_seen']." ".mkprettytime($row["lastseed"]) . " ".$tracker_lang['ago']); - tr($tracker_lang['size'],mksize($row["size"]) . " (" . number_format($row["size"]) . " ".$tracker_lang['bytes'].")"); - - $s = ""; - $s .= "
"; - if (!isset($row["rating"])) { - if ($minvotes > 1) { - $s .= sprintf($tracker_lang['not_enough_votes'], $minvotes); - if ($row["numratings"]) - $s .= sprintf($tracker_lang['only_votes'], $row["numratings"]); - else - $s .= $tracker_lang['none_voted']; - $s .= ")"; - } - else - $s .= $tracker_lang['no_votes']; - } - else { - $rpic = ratingpic($row["rating"]); - if (!isset($rpic)) - $s .= "invalid?"; - else - $s .= "$rpic (" . $row["rating"] . " ".$tracker_lang['from']." 5 ".$tracker_lang['with']." " . $row["numratings"] . " ".$tracker_lang['votes'].")"; - } - $s .= "\n"; - $s .= "$spacer"; - if (!isset($CURUSER)) - $s .= "(Log in to rate it)"; - else { - $ratings = array( - 5 => $tracker_lang['vote_5'], - 4 => $tracker_lang['vote_4'], - 3 => $tracker_lang['vote_3'], - 2 => $tracker_lang['vote_2'], - 1 => $tracker_lang['vote_1'], - ); - if (!$owned || $moderator) { - $xres = sql_query("SELECT rating, added FROM ratings WHERE torrent = $id AND user = " . $CURUSER["id"]); - $xrow = mysql_fetch_array($xres); - if ($xrow) - $s .= "(".$tracker_lang['you_have_voted_for_this_torrent']." \"" . $xrow["rating"] . " - " . $ratings[$xrow["rating"]] . "\")"; - else { - $s .= "
\n"; - $s .= "\n"; - $s .= ""; - $s .= "
\n"; - } - } - } - $s .= "
"; - tr($tracker_lang['rating'], $s, 1); - - tr($tracker_lang['added'], $row["added"]); - tr($tracker_lang['views'], $row["views"]); - tr($tracker_lang['hits'], $row["hits"]); - tr($tracker_lang['snatched'], $row["times_completed"] . " ".$tracker_lang['times']); - - $keepget = ""; - $uprow = (isset($row["username"]) ? ("" . htmlspecialchars_uni($row["username"]) . "") : "Аноним"); + if ($CURUSER) { +?> + + +
+ + + + + + +
+SELECTOR; + + $is_voted = mysql_fetch_array(sql_query('SELECT rating FROM ratings WHERE torrent = ' . $id . ' AND user = ' . $CURUSER['id'])); + if (mysql_error()) + sqlerr(); + if ($is_voted) { + $stars .= ratingpic($row['rating']) . "(" . $row["rating"] . " " . $tracker_lang['from'] . " 5 ".$tracker_lang['with'] . " " . $row["numratings"] . " " . getWord($row["numratings"], array($tracker_lang['votes_1'], $tracker_lang['votes_2'], $tracker_lang['votes_3'])).")".' Ваша оценка ' . $is_voted['rating'] . ' - ' . $tracker_lang['vote_' . $is_voted['rating']] . ''; + } else { + $stars .= $rating_selector; + } + tr($tracker_lang['rating'], $stars, 1); + } + + tr($tracker_lang['added'], $row["added"]); + tr($tracker_lang['views'], $row["views"]); + tr($tracker_lang['hits'], $row["hits"]); + tr($tracker_lang['snatched'], $row["times_completed"] . " ".$tracker_lang['times']); + + $keepget = ""; + $uprow = (isset($row["username"]) ? ("" . htmlspecialchars_uni($row["username"]) . "") : "{$tracker_lang['details_anonymous']}"); /* - if ($owned) - $uprow .= " $spacer<$editlink>[".$tracker_lang['edit']."]"; +if ($owned) + $uprow .= " $spacer<$editlink>[{$tracker_lang['edit']}]"; */ - tr($tracker_lang['uploaded'], $uprow.' '.$tracker_lang['respect'].'  '.$tracker_lang['antirespect'].'', 1); - - if ($row["type"] == "multi") { - if (!$_GET["filelist"]) - tr($tracker_lang['files']."
[".$tracker_lang['open_list']."]", $row["numfiles"] . " ".$tracker_lang['files_l'], 1); - else { - tr($tracker_lang['files'], $row["numfiles"] . " ".$tracker_lang['files_l'], 1); - - $s = "\n"; - - $subres = sql_query("SELECT * FROM files WHERE torrent = $id ORDER BY id"); - $s.="\n"; - while ($subrow = mysql_fetch_array($subres)) { - $s .= "\n"; - } - - $s .= "
".$tracker_lang['path']."".$tracker_lang['size']."
" . $subrow["filename"] . - "" . mksize($subrow["size"]) . "
\n"; - tr("".$tracker_lang['file_list']."
[".$tracker_lang['close_list']."]", $s, 1); - } - } - - if (!isset($_GET["dllist"])) { - /* - $subres = sql_query("SELECT seeder, COUNT(*) FROM peers WHERE torrent = $id GROUP BY seeder"); - $resarr = array(yes => 0, no => 0); - $sum = 0; - while ($subrow = mysql_fetch_array($subres)) { - $resarr[$subrow[0]] = $subrow[1]; - $sum += $subrow[1]; - } - tr("Peers
[See full list]", $resarr["yes"] . " seeder(s), " . $resarr["no"] . " leecher(s) = $sum peer(s) total", 1); - */ - tr($tracker_lang['downloading']."
[".$tracker_lang['open_list']."]", $row["seeders"] . " ".$tracker_lang['seeders_l'].", " . $row["leechers"] . " ".$tracker_lang['leechers_l']." = " . ($row["seeders"] + $row["leechers"]) . " ".$tracker_lang['peers_l'], 1); - } else { - $downloaders = array(); - $seeders = array(); - $subres = sql_query("SELECT seeder, finishedat, downloadoffset, uploadoffset, peers.ip, port, peers.uploaded, peers.downloaded, to_go, UNIX_TIMESTAMP(started) AS st, connectable, agent, peer_id, UNIX_TIMESTAMP(last_action) AS la, UNIX_TIMESTAMP(prev_action) AS pa, userid, users.username, users.class FROM peers INNER JOIN users ON peers.userid = users.id WHERE torrent = $id") or sqlerr(__FILE__, __LINE__); - while ($subrow = mysql_fetch_array($subres)) { - if ($subrow["seeder"] == "yes") - $seeders[] = $subrow; - else - $downloaders[] = $subrow; - } - - function leech_sort($a,$b) { - if ( isset( $_GET["usort"] ) ) return seed_sort($a,$b); - $x = $a["to_go"]; - $y = $b["to_go"]; - if ($x == $y) - return 0; - if ($x < $y) - return -1; - return 1; - } - function seed_sort($a,$b) { - $x = $a["uploaded"]; - $y = $b["uploaded"]; - if ($x == $y) - return 0; - if ($x < $y) - return 1; - return -1; - } - - usort($seeders, "seed_sort"); - usort($downloaders, "leech_sort"); - - tr("".$tracker_lang['details_seeding']."
[".$tracker_lang['close_list']."]", dltable($tracker_lang['details_seeding'], $seeders, $row), 1); - tr("".$tracker_lang['details_leeching']."
[".$tracker_lang['close_list']."]", dltable($tracker_lang['details_leeching'], $downloaders, $row), 1); - } - - if ($row["times_completed"] > 0) { - $res = sql_query("SELECT users.id, users.username, users.title, users.uploaded, users.downloaded, users.donor, users.enabled, users.warned, users.last_access, users.class, snatched.startdat, snatched.last_action, snatched.completedat, snatched.seeder, snatched.userid, snatched.uploaded AS sn_up, snatched.downloaded AS sn_dn FROM snatched INNER JOIN users ON snatched.userid = users.id WHERE snatched.finished='yes' AND snatched.torrent =" . sqlesc($id) . " ORDER BY users.class DESC $limit") or sqlerr(__FILE__,__LINE__); - $snatched_full = "\n"; - $snatched_full .= ""; - - while ($arr = mysql_fetch_assoc($res)) { - //start Global - if ($arr["downloaded"] > 0) { - $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2); - // $ratio = "$ratio"; - } - else if ($arr["uploaded"] > 0) - $ratio = "Inf."; - else - $ratio = "---"; - $uploaded = mksize($arr["uploaded"]); - $downloaded = mksize($arr["downloaded"]); - //start torrent - if ($arr["sn_dn"] > 0) { - $ratio2 = number_format($arr["sn_up"] / $arr["sn_dn"], 2); - $ratio2 = "$ratio2"; - } - else - if ($arr["sn_up"] > 0) - $ratio2 = "Inf."; - else - $ratio2 = "---"; - $uploaded2 = mksize($arr["sn_up"]); - $downloaded2 = mksize($arr["sn_dn"]); - //end - //$highlight = $CURUSER["id"] == $arr["id"] ? " bgcolor=#00A527" : "";; - $snatched_small[] = "".get_user_class_color($arr["class"], $arr["username"])." ($ratio)"; - $snatched_full .= "\n"; - } - $snatched_full .= "
ЮзерРаздалСкачалРейтингНачал / ЗакончилДействиеСидируетЛС
".get_user_class_color($arr["class"], $arr["username"])."".get_user_icons($arr)."$uploaded Общего
$uploaded2 Торрент
$downloaded Общего
$downloaded2 Торрент
$ratio Общего
$ratio2 Торрент
" . $arr["startdat"] . "
" . $arr["completedat"] . "
" . $arr["last_action"] . "" . ($arr["seeder"] == "yes" ? "Да" : "Нет") . - "
\n"; - ?>= 2)) - $reseed_button = "
"; - if (!$_GET["snatched"]==1) - tr("Скачавшие
[Посмотреть список]", '', 1); - else - tr("Скачавшие
[Cпрятать список]", $snatched_full,1); - } +tr($tracker_lang['uploaded'], $uprow.' '.$tracker_lang['respect'].'  '.$tracker_lang['antirespect'].'', 1); + +if ($row["type"] == "multi") { + if (!$_GET["filelist"]) + tr($tracker_lang['files'] . "
[{$tracker_lang['open_list']}]", $row["numfiles"] . " " . $tracker_lang['files_l'], 1); + else { + tr($tracker_lang['files'], $row["numfiles"] . " ".$tracker_lang['files_l'], 1); - tr($tracker_lang['torrent_info'], "".$tracker_lang['show_data']."", 1); + $s = "\n"; + + $subres = sql_query("SELECT * FROM files WHERE torrent = $id ORDER BY id"); + $s.="\n"; + while ($subrow = mysql_fetch_array($subres)) { + $s .= "\n"; + } + + $s .= "
{$tracker_lang['path']}{$tracker_lang['size']}
".iconv('utf-8', 'windows-1251', $subrow["filename"])."" . mksize($subrow["size"]) . "
\n"; + tr("{$tracker_lang['file_list']}
[{$tracker_lang['close_list']}]", $s, 1); + } +} + +if (!isset($_GET["dllist"])) { + tr($tracker_lang['downloading']."
[{$tracker_lang['open_list']}]", $row["seeders"] . " {$tracker_lang['seeders_l']}, {$row["leechers"]} {$tracker_lang['leechers_l']} = " . ($row["seeders"] + $row["leechers"]) . " ".$tracker_lang['peers_l'], 1); +} else { + $downloaders = array(); + $seeders = array(); + $subres = sql_query("SELECT seeder, finishedat, downloadoffset, uploadoffset, peers.ip, port, peers.uploaded, peers.downloaded, to_go, UNIX_TIMESTAMP(started) AS st, connectable, agent, peer_id, UNIX_TIMESTAMP(last_action) AS la, UNIX_TIMESTAMP(prev_action) AS pa, userid, users.username, users.class FROM peers INNER JOIN users ON peers.userid = users.id WHERE torrent = $id") or sqlerr(__FILE__, __LINE__); + while ($subrow = mysql_fetch_array($subres)) { + if ($subrow["seeder"] == "yes") + $seeders[] = $subrow; + else + $downloaders[] = $subrow; + } + + function leech_sort($a, $b) { + if (isset($_GET["usort"])) + return seed_sort($a, $b); + $x = $a["to_go"]; + $y = $b["to_go"]; + if ($x == $y) + return 0; + if ($x < $y) + return -1; + return 1; + } + + function seed_sort($a, $b) { + $x = $a["uploaded"]; + $y = $b["uploaded"]; + if ($x == $y) + return 0; + if ($x < $y) + return 1; + return -1; + } + + usort($seeders, "seed_sort"); + usort($downloaders, "leech_sort"); + + tr("{$tracker_lang['details_seeding']}
[{$tracker_lang['close_list']}]", dltable($tracker_lang['details_seeding'], $seeders, $row), 1); + tr("{$tracker_lang['details_leeching']}
[{$tracker_lang['close_list']}]", dltable($tracker_lang['details_leeching'], $downloaders, $row), 1); +} + +if ($row["multitracker"] == 'yes') { + if (count($announces_a)) { + foreach ($announces_a as $announce) { + if ($announce['state'] == 'ok') + $anns[] = '
  • ' . $announce['url'] . ' - раздающие: ' . $announce['seeders'] . ', качающие: ' . $announce['leechers'] . ''; + else + $anns[] = '
  • ' . $announce['url'] . ' - не работает, ошибка: ' . $announce['error'] . ''; + } + if (strtotime($row['last_mt_update']) < (TIMENOW - 3600) && $CURUSER) + $update_link = '
    Данные могли устареть. ' . $tracker_lang['details_update_multitracker'] . ''; + if ($row['last_mt_update'] == '0000-00-00 00:00:00') + $update_link .= '
    ' . $tracker_lang['details_update_last_mt_update'] . ' ' . $tracker_lang['never'] . ''; + else + $update_link .= '
    ' . $tracker_lang['details_update_last_mt_update'] . ' ' . get_et(strtotime($row['last_mt_update'])) . ' ' . $tracker_lang['ago']; + tr($tracker_lang['details_multitracker'], '
    ' . $update_link . '
    ', 1); + } else + tr($tracker_lang['details_multitracker'], 'WTF? Multitracker = YES, but no announces', 1); +} + +if ($row["times_completed"] > 0) { + $res = sql_query("SELECT users.id, users.username, users.title, users.uploaded, users.downloaded, users.donor, users.enabled, users.warned, users.last_access, users.class, snatched.startdat, snatched.last_action, snatched.completedat, snatched.seeder, snatched.userid, snatched.uploaded AS sn_up, snatched.downloaded AS sn_dn FROM snatched INNER JOIN users ON snatched.userid = users.id WHERE snatched.finished='yes' AND snatched.torrent =" . sqlesc($id) . " ORDER BY users.class DESC $limit") or sqlerr(__FILE__,__LINE__); + $snatched_full = "\n"; + $snatched_full .= ""; + + while ($arr = mysql_fetch_assoc($res)) { + //start Global + if ($arr["downloaded"] > 0) { + $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 2); + // $ratio = "$ratio"; + } + else if ($arr["uploaded"] > 0) + $ratio = "Inf."; + else + $ratio = "---"; + $uploaded = mksize($arr["uploaded"]); + $downloaded = mksize($arr["downloaded"]); + //start torrent + if ($arr["sn_dn"] > 0) { + $ratio2 = number_format($arr["sn_up"] / $arr["sn_dn"], 2); + $ratio2 = "$ratio2"; + } + else + if ($arr["sn_up"] > 0) + $ratio2 = "Inf."; + else + $ratio2 = "---"; + $uploaded2 = mksize($arr["sn_up"]); + $downloaded2 = mksize($arr["sn_dn"]); + //end + //$highlight = $CURUSER["id"] == $arr["id"] ? " bgcolor=#00A527" : "";; + $snatched_small[] = "".get_user_class_color($arr["class"], $arr["username"])." ($ratio)"; + $snatched_full .= "\n"; + } + $snatched_full .= "
    ЮзерРаздалСкачалРейтингНачал / ЗакончилДействиеСидируетЛС
    ".get_user_class_color($arr["class"], $arr["username"])."".get_user_icons($arr)."$uploaded Общего
    $uploaded2 Торрент
    $downloaded Общего
    $downloaded2 Торрент
    $ratio Общего
    $ratio2 Торрент
    {$arr["startdat"]}
    {$arr["completedat"]}
    {$arr["last_action"]}" . ($arr["seeder"] == "yes" ? "Да" : "Нет") . + "
    \n"; + ?>= 2)) + $reseed_button = "
    "; + if (!$_GET["snatched"]==1) + tr("Скачавшие
    [{$tracker_lang['open_list']}]", '', 1); + else + tr("Скачавшие
    [{$tracker_lang['close_list']}]", $snatched_full,1); +} + +tr($tracker_lang['torrent_info'], "{$tracker_lang['show_data']}", 1); $torrentid = (int) $_GET["id"]; @@ -493,137 +599,147 @@ function seed_sort($a,$b) { $count = mysql_num_rows($thanked_sql); if ($count == 0) { - $thanksby = $tracker_lang['none_yet']; + $thanksby = $tracker_lang['none_yet']; } else { - //$thanked_sql = sql_query("SELECT thanks.userid, users.username FROM thanks INNER JOIN users ON thanks.userid = users.id WHERE thanks.torrentid = $torrentid"); - $thanksby = array(); - while ($thanked_row = mysql_fetch_assoc($thanked_sql)) { - if ($thanked_row["userid"] == $CURUSER["id"]) - $can_not_thanks = true; - $userid = $thanked_row["userid"]; - $username = $thanked_row["username"]; - $class = $thanked_row["class"]; - $thanksby[] = "".get_user_class_color($class, $username).""; - } - if ($thanksby) - $thanksby = implode(', ', $thanksby); + //$thanked_sql = sql_query("SELECT thanks.userid, users.username FROM thanks INNER JOIN users ON thanks.userid = users.id WHERE thanks.torrentid = $torrentid"); + $thanksby = array(); + while ($thanked_row = mysql_fetch_assoc($thanked_sql)) { + if ($thanked_row["userid"] == $CURUSER["id"]) + $can_not_thanks = true; + $userid = $thanked_row["userid"]; + $username = $thanked_row["username"]; + $class = $thanked_row["class"]; + $thanksby[] = "".get_user_class_color($class, $username).""; + } + if ($thanksby) + $thanksby = implode(', ', $thanksby); } -if ($row["owner"] == $CURUSER["id"]) - $can_not_thanks = true; +if ($row["owner"] == $CURUSER["id"] || !$CURUSER) + $can_not_thanks = true; $thanksby = "
    - -".$thanksby." + +{$thanksby}
    "; ?>

    \n"); + print("

    \n"); - } else { - stdhead($tracker_lang['comments_for']." \"" . $row["name"] . "\""); - print("

    ".$tracker_lang['comments_for']." " . $row["name"] . "

    \n"); - } + } else { + stdhead($tracker_lang['comments_for']." \"".htmlspecialchars_decode($row["name"])."\""); + print("

    {$tracker_lang['comments_for']} {$row["name"]}

    \n"); + } - print("

    \n"); + print("

    \n"); - $subres = sql_query("SELECT COUNT(*) FROM comments WHERE torrent = $id"); - $subrow = mysql_fetch_array($subres); - $count = $subrow[0]; + $subres = sql_query("SELECT COUNT(*) FROM comments WHERE torrent = $id"); + $subrow = mysql_fetch_array($subres); + $count = $subrow[0]; - $limited = 10; + $limited = 10; if (!$count) { - - print(""); - print("
    "); - print("
    :: Список комментариев
    "); - print(""); - print("
    "); - print("Комментариев нет. Желаете добавить?"); - print("

    "); - - print(""); - print(""); - print("
     :: Без комментариев
    "); - //print("Ваше имя: "); - //print("".$CURUSER['username']."

    "); - print("

    "); - print("
    "); - textbbcode("comment","text",""); - print("
    "); - print("
    "); - print(""); - print(""); - print("
    "); - - } - else { - list($pagertop, $pagerbottom, $limit) = pager($limited, $count, "details.php?id=$id&", array('lastpagedefault' => 1)); - - $subres = sql_query("SELECT c.id, c.ip, c.text, c.user, c.added, c.editedby, c.editedat, u.avatar, u.warned, ". - "u.username, u.title, u.class, u.donor, u.downloaded, u.uploaded, u.gender, u.last_access, e.username AS editedbyname FROM comments AS c LEFT JOIN users AS u ON c.user = u.id LEFT JOIN users AS e ON c.editedby = e.id WHERE torrent = " . - "$id ORDER BY c.id $limit") or sqlerr(__FILE__, __LINE__); - $allrows = array(); - while ($subrow = mysql_fetch_array($subres)) - $allrows[] = $subrow; - - - print(""); - print(""); - - print(""); - print(""); - print(""); - print("
    "); - print("
    :: Список комментариев
    "); - print(""); - print("
    "); - print($pagertop); - print("
    "); - commenttable($allrows); - print("
    "); - print($pagerbottom); - print("
    "); - - - - print(""); - print(""); - print("
     :: Добавить комментарий к торренту
    "); - //print("Ваше имя: "); - //print("".$CURUSER['username']."

    "); - print("

    "); - print("
    "); - print("
    ". textbbcode("comment","text","", 1) ."
    "); - print("
    "); - print("
    "); - print(""); - print(""); - print("
    "); - - } - + print(""); + print("
    "); + print("
    :: {$tracker_lang['comments_list']}
    "); + if ($CURUSER) + print(""); + print("
    "); + print("Комментариев нет.".($CURUSER ? " Желаете добавить?" : "")); + print("

    "); + + if ($CURUSER) { + print(""); + print(""); + print("
     :: Без комментариев
    "); + //print("Ваше имя: "); + //print("{$CURUSER['username']}

    "); + print("

    "); + print("
    "); + textbbcode("comment","text",""); + print("
    "); + print("
    "); + print(""); + print(""); + print("
    "); + } +} else { + list($pagertop, $pagerbottom, $limit) = pager($limited, $count, "details.php?id=$id&", array('lastpagedefault' => 1)); + + $subres = sql_query("SELECT cp.text_hash, cp.text_parsed, c.id, c.ip, c.text, c.user, c.added, c.editedby, c.editedat, u.avatar, u.warned, ". + "u.username, u.title, u.class, u.donor, u.downloaded, u.uploaded, u.gender, u.last_access, e.username AS editedbyname FROM comments AS c LEFT JOIN users AS u ON c.user = u.id LEFT JOIN users AS e ON c.editedby = e.id LEFT JOIN comments_parsed AS cp ON cp.cid = c.id WHERE torrent = " . + "$id ORDER BY c.id $limit") or sqlerr(__FILE__, __LINE__); + $allrows = array(); + while ($subrow = mysql_fetch_array($subres)) + $allrows[] = $subrow; + + + print(""); + print(""); + + print(""); + print(""); + print(""); + print("
    "); + print("
    :: {$tracker_lang['comments_list']}
    "); + if ($CURUSER) + print(""); + print("
    "); + print($pagertop); + print("
    "); + commenttable($allrows); + print("
    "); + print($pagerbottom); + print("
    "); + + if ($CURUSER) { + print(""); + print(""); + print("
     :: Добавить комментарий к торренту
    "); + //print("Ваше имя: "); + //print("{$CURUSER['username']}

    "); + print("

    "); + print("
    "); + print("
    ". textbbcode("comment","text","", 1) ."
    "); + print("
    "); + print("
    "); + print(""); + print(""); + print("
    "); + } } stdfoot(); diff --git a/download.php b/download.php index c5e49d5..3a1812a 100644 --- a/download.php +++ b/download.php @@ -68,18 +68,22 @@ $name = str_replace(array(',', ';'), '', $name); -require_once "include/benc.php"; +require_once "include/BDecode.php"; +require_once "include/BEncode.php"; if (strlen($CURUSER['passkey']) != 32) { $CURUSER['passkey'] = md5($CURUSER['username'].get_date_time().$CURUSER['passhash']); sql_query("UPDATE users SET passkey=".sqlesc($CURUSER[passkey])." WHERE id=".sqlesc($CURUSER[id])); } -$dict = bdec_file($fn, $max_torrent_size); +$dict = bdecode(file_get_contents($fn)); -$dict['value']['announce']['value'] = $announce_urls[0]."?passkey=$CURUSER[passkey]";//"$DEFAULTBASEURL/announce.php?passkey=$CURUSER[passkey]"; -$dict['value']['announce']['string'] = strlen($dict['value']['announce']['value']).":".$dict['value']['announce']['value']; -$dict['value']['announce']['strlen'] = strlen($dict['value']['announce']['string']); +//$dict['announce'] = $announce_urls[0]."?passkey=$CURUSER[passkey]";//"$DEFAULTBASEURL/announce.php?passkey=$CURUSER[passkey]"; + +if (!empty($dict['announce-list'])) { + $dict['announce-list'][][0] = $announce_urls[0]."?passkey=$CURUSER[passkey]"; // Just add one tracker for multitrackers, we are the last +} else + $dict['announce'] = $announce_urls[0]."?passkey=$CURUSER[passkey]";//"$DEFAULTBASEURL/announce.php?passkey=$CURUSER[passkey]"; header ("Expires: Tue, 1 Jan 1980 00:00:00 GMT"); header ("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); @@ -94,6 +98,6 @@ header ("Content-Type: application/x-bittorrent"); ob_implicit_flush(true); -print(benc($dict)); +print(BEncode($dict)); ?> \ No newline at end of file diff --git a/edit.php b/edit.php index 94414fe..1a8eb0f 100644 --- a/edit.php +++ b/edit.php @@ -55,7 +55,8 @@ print("\n"); print("\n"); print(""); - tr($tracker_lang['torrent_file'], "\n", 1); + if ($row['multitracker'] == 'no') + tr($tracker_lang['torrent_file'], "\n", 1); // disable torrent update for multitracked ones tr($tracker_lang['torrent_name'], "", 1); tr($tracker_lang['img_poster'], "Оставить постер  "."Удалить постер  "."Обновить постер
    Постер:  ", 1); tr($tracker_lang['images'], @@ -92,11 +93,11 @@ if(get_user_class() >= UC_ADMINISTRATOR) tr("Тип раздачи", "
    ". -"
    ". +"
    ". "
    " , 1); if(get_user_class() >= UC_ADMINISTRATOR) - tr("Важный", " Прикрепить этот торрент (всегда наверху)", 1); + tr("Важный", " Прикрепить этот торрент (всегда наверху)", 1); print("\n"); print("
    Редактировать торрент
    \n"); print("\n"); diff --git a/faq.php b/faq.php index adf56a7..77f9359 100644 --- a/faq.php +++ b/faq.php @@ -88,9 +88,9 @@ if ($faq_categ[$id][items][$id2][flag] == "1") print("
  • ". $faq_categ[$id][items][$id2][question] ."
  • \n"); elseif ($faq_categ[$id][items][$id2][flag] == "2") - print("
  • ". $faq_categ[$id][items][$id2][question] ." \"Обновлено\"
  • \n"); + print("
  • ". $faq_categ[$id][items][$id2][question] ." \"Обновлено\"
  • \n"); elseif ($faq_categ[$id][items][$id2][flag] == "3") - print("
  • ". $faq_categ[$id][items][$id2][question] ." \"Новое\"
  • \n"); + print("
  • ". $faq_categ[$id][items][$id2][question] ." \"Новое\"
  • \n"); } } print("\n\n\n
    \n"); diff --git a/include/BDecode.php b/include/BDecode.php new file mode 100644 index 0000000..1509027 --- /dev/null +++ b/include/BDecode.php @@ -0,0 +1,212 @@ += '0' && $wholefile[$offset] <= '9') + { + + $ret[0] *= 10; + $ret[0] += ord($wholefile[$offset]) - ord("0"); + $offset++; + } + // Tolerate : or e because this is a multiuse function + else if ($wholefile[$offset] == 'e' || $wholefile[$offset] == ':') + { + $ret[1] = $offset+1; + if ($negative) + { + if ($ret[0] == 0) + return array(false); + $ret[0] = - $ret[0]; + } + return $ret; + } + else + return array(false); + } + +} + +function decodeEntry($wholefile, $offset=0) +{ + if ($wholefile[$offset] == 'd') + return $this->decodeDict($wholefile, $offset); + if ($wholefile[$offset] == 'l') + return $this->decodelist($wholefile, $offset); + if ($wholefile[$offset] == "i") + { + $offset++; + return $this->numberdecode($wholefile, $offset); + } + // String value: decode number, then grab substring + $info = $this->numberdecode($wholefile, $offset); + if ($info[0] === false) + return array(false); + $ret[0] = substr($wholefile, $info[1], $info[0]); + $ret[1] = $info[1]+strlen($ret[0]); + return $ret; +} + +function decodeList($wholefile, $start) +{ + $offset = $start+1; + $i = 0; + if ($wholefile[$start] != 'l') + return array(false); + $ret = array(); + while (true) + { + if ($wholefile[$offset] == 'e') + break; + $value = $this->decodeEntry($wholefile, $offset); + if ($value[0] === false) + return array(false); + $ret[$i] = $value[0]; + $offset = $value[1]; + $i ++; + } + + // The empy list is an empty array. Seems fine. + $final[0] = $ret; + $final[1] = $offset+1; + return $final; + +} + +// Tries to construct an array +function decodeDict($wholefile, $start=0) +{ + $offset = $start; + if ($wholefile[$offset] == 'l') + return $this->decodeList($wholefile, $start); + if ($wholefile[$offset] != 'd') + return false; + $ret = array(); + $offset++; + while (true) + { + if ($wholefile[$offset] == 'e') + { + $offset++; + break; + } + $left = $this->decodeEntry($wholefile, $offset); + if (!$left[0]) + return false; + $offset = $left[1]; + if ($wholefile[$offset] == 'd') + { + // Recurse + $value = $this->decodedict($wholefile, $offset); + if (!$value[0]) + return false; + $ret[addslashes($left[0])] = $value[0]; + $offset= $value[1]; + continue; + } + else if ($wholefile[$offset] == 'l') + { + $value = $this->decodeList($wholefile, $offset); + if (!$value[0] && is_bool($value[0])) + return false; + $ret[addslashes($left[0])] = $value[0]; + $offset = $value[1]; + } + else + { + $value = $this->decodeEntry($wholefile, $offset); + if ($value[0] === false) + return false; + $ret[addslashes($left[0])] = $value[0]; + $offset = $value[1]; + } + } + if (empty($ret)) + $final[0] = true; + else + $final[0] = $ret; + $final[1] = $offset; + return $final; + + +} + +} // End of class declaration. + +// Use this function. eg: BDecode("d8:announce44:http://www. ... e"); +function BDecode($wholefile) +{ + $decoder = new BDecode; + $return = $decoder->decodeEntry($wholefile); + return $return[0]; +} + +?> \ No newline at end of file diff --git a/include/BEncode.php b/include/BEncode.php new file mode 100644 index 0000000..8e9e95a --- /dev/null +++ b/include/BEncode.php @@ -0,0 +1,119 @@ + $value) + $keys[$i++] = stripslashes($key); + sort($keys); + for ($i=0 ; isset($keys[$i]); $i++) + $return[addslashes($keys[$i])] = $array[addslashes($keys[$i])]; + return $return; +} + +// Encodes strings, integers and empty dictionaries. +// $unstrip is set to true when decoding dictionary keys +function encodeEntry($entry, &$fd, $unstrip = false) +{ + if (is_bool($entry)) + { + $fd .= "de"; + return; + } + if (is_int($entry) || is_float($entry)) + { + $fd .= "i".$entry."e"; + return; + } + if ($unstrip) + $myentry = stripslashes($entry); + else + $myentry = $entry; + $length = strlen($myentry); + $fd .= $length.":".$myentry; + return; +} + +// Encodes lists +function encodeList($array, &$fd) +{ + $fd .= "l"; + + // The empty list is defined as array(); + if (empty($array)) + { + $fd .= "e"; + return; + } + for ($i = 0; isset($array[$i]); $i++) + $this->decideEncode($array[$i], $fd); + $fd .= "e"; +} + +// Passes lists and dictionaries accordingly, and has encodeEntry handle +// the strings and integers. +function decideEncode($unknown, &$fd) +{ + if (is_array($unknown)) + { + if (isset($unknown[0]) || empty($unknown)) + return $this->encodeList($unknown, $fd); + else + return $this->encodeDict($unknown, $fd); + } + $this->encodeEntry($unknown, $fd); +} + +// Encodes dictionaries +function encodeDict($array, &$fd) +{ + $fd .= "d"; + if (is_bool($array)) + { + $fd .= "e"; + return; + } + // NEED TO SORT! + $newarray = $this->makeSorted($array); + foreach($newarray as $left => $right) + { + $this->encodeEntry($left, $fd, true); + $this->decideEncode($right, $fd); + } + $fd .= "e"; + return; +} + + + +} // End of class declaration. + +// Use this function in your own code. +function BEncode($array) +{ + $string = ""; + $encoder = new BEncode; + $encoder->decideEncode($array, $string); + return $string; +} + + +?> \ No newline at end of file diff --git a/include/bittorrent.php b/include/bittorrent.php index 2523a3a..dc0d8af 100644 --- a/include/bittorrent.php +++ b/include/bittorrent.php @@ -116,6 +116,12 @@ function timer() { if ((int) ini_get('short_open_tag') == '0') die('Включите short_open_tag в php.ini/.htaccess (техническое требование)'); + if (!file_exists('include/secrets.local.php')) + die('Создайте файл include/secrets.local.php и переместите в него свои локальные настройки из include/secrets.php (техническое требование)'); + + if (!file_exists('include/config.local.php')) + die('Создайте файл include/config.local.php и переместите в него свои локальные настройки из include/config.php (техническое требование)'); + // Variables for Start Time $tstart = timer(); // Start time diff --git a/include/captcha.php b/include/captcha.php index d5c4db5..f4ce183 100644 --- a/include/captcha.php +++ b/include/captcha.php @@ -5,10 +5,12 @@ die('Hacking attempt!'); function create_captcha() { + global $_COOKIE_SALT; //$randomstr = mksecret(5); $randomstr = rand(10000, 99999); - $imagehash = md5($randomstr); - sql_query("INSERT INTO captcha SET imagehash = ".sqlesc($imagehash).", imagestring = ".sqlesc($randomstr).", dateline = ".sqlesc(time())) or sqlerr(__FILE__,__LINE__); + $imagehash = md5($randomstr . $_COOKIE_SALT); // Additional security tightening + // Have to use MYsql_query to prohibit seeing imagestring in debugmode + mysql_query("INSERT INTO captcha SET imagehash = ".sqlesc($imagehash).", imagestring = ".sqlesc($randomstr).", dateline = ".sqlesc(time())) or sqlerr(__FILE__,__LINE__); return $imagehash; } diff --git a/include/cleanup.php b/include/cleanup.php index a6ccf5f..2e0efb1 100644 --- a/include/cleanup.php +++ b/include/cleanup.php @@ -107,7 +107,7 @@ function docleanup() { sql_query("UPDATE snatched SET seeder = 'no' WHERE seeder = 'yes' AND last_action < FROM_UNIXTIME($deadtime)"); $deadtime -= $max_dead_torrent_time; - sql_query("UPDATE torrents SET visible='no' WHERE visible='yes' AND last_action < FROM_UNIXTIME($deadtime)") or sqlerr(__FILE__,__LINE__); + sql_query("UPDATE torrents SET visible='no' WHERE visible='yes' AND last_action < FROM_UNIXTIME($deadtime) AND multitracker = 'no'") or sqlerr(__FILE__,__LINE__); $torrents = array(); $res = sql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder") or sqlerr(__FILE__,__LINE__); diff --git a/include/config.php b/include/config.php index 2aba0c2..0f5707d 100644 --- a/include/config.php +++ b/include/config.php @@ -50,7 +50,7 @@ $SITENAME = 'TBDev Yuna Scatari Edition'; $autoclean_interval = 900; -$pic_base_url = './pic/'; +$pic_base_url = './pic'; // [BEGIN] Custom variables from Yuna Scatari // TTL @@ -77,8 +77,17 @@ $smtptype = 'advanced'; // Тип отправки почты, по умолчанию advanced, лучше не менять $allow_block_hide = true; // Разрешить сворачивание блоков $check_for_working_mta = true; // Проверять работу почтового MTA при регистрации пользователя (TCP connect @ domain:25) -$force_private_tracker = true; +$force_private_tracker = true; // Yet not working +$max_image_size = 1024*1024; // 1mb +$allow_guests_details = false; // Разрешить гостям доступ к странице деталей торрента + +$admin_email = 'admin@'.$_SERVER['HTTP_HOST']; // Почта администратора трекера, для формы обратной связи +$website_name = 'TBDev'; // Краткое имя сайта, для формы обратной связи + $enable_adv_antidreg = false; // Использовать продвинутую систему против двойных регистраций. Пояснение внизу: + +$_COOKIE_SALT = 'default'; // Соль для cookie пользователей + /* * Если наш юзер сделал просто выход (ссылка "Выход" aka logout.php) то у него в куксах останется uid * При регистрации будет проверятся наличие этой куки. diff --git a/include/core.php b/include/core.php index 1f33e78..ef1e602 100644 --- a/include/core.php +++ b/include/core.php @@ -34,9 +34,11 @@ require_once($rootpath . 'include/init.php'); require_once($rootpath . 'include/global.php'); require_once($rootpath . 'include/config.php'); +require_once($rootpath . 'include/config.local.php'); require_once($rootpath . 'include/functions.php'); require_once($rootpath . 'include/blocks.php'); require_once($rootpath . 'include/secrets.php'); +require_once($rootpath . 'include/secrets.local.php'); // INCLUDE SECURITY BACK-END if ($ctracker) require_once($rootpath . 'include/ctracker.php'); diff --git a/include/core_announce.php b/include/core_announce.php index fffb66d..17cdc46 100644 --- a/include/core_announce.php +++ b/include/core_announce.php @@ -30,8 +30,8 @@ if(!defined("IN_ANNOUNCE")) die("Hacking attempt!"); -@error_reporting(E_ALL & ~E_NOTICE); -@ini_set('error_reporting', E_ALL & ~E_NOTICE); +@error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT); +@ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT); @ini_set('display_errors', '1'); @ini_set('display_startup_errors', '0'); @ini_set('ignore_repeated_errors', '1'); diff --git a/include/functions.php b/include/functions.php index 758c6e7..801ee79 100644 --- a/include/functions.php +++ b/include/functions.php @@ -210,11 +210,14 @@ function dbconn($autoclean = false, $lightmode = false) { } function userlogin($lightmode = false) { - global $SITE_ONLINE, $default_language, $tracker_lang, $use_lang, $use_ipbans; + global $SITE_ONLINE, $default_language, $tracker_lang, $use_lang, $use_ipbans, $_COOKIE_SALT; unset($GLOBALS["CURUSER"]); - if (COOKIE_SALT == '' || (COOKIE_SALT == 'default' && $_SERVER['SERVER_ADDR'] != '127.0.0.1' && $_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR'])) - die('Скрипт заблокирован! Измените значение переменной COOKIE_SALT в файле include/init.php на случайное'); + if ($_COOKIE_SALT == 'default' && $_SERVER['SERVER_ADDR'] != '127.0.0.1' && $_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']) + die('Скрипт заблокирован! Измените значение переменной $_COOKIE_SALT в файле include/config.local.php на случайное'); + + if (empty($_COOKIE_SALT) || !isset($_COOKIE_SALT)) + die('Идите и учите PHP... Сказано было ИЗМЕНИТЬ значение, а не удалить переменную!'); $ip = getip(); $nip = ip2long($ip); @@ -660,7 +663,7 @@ function parsedescr($d, $html) { } function stdhead($title = "", $msgalert = true) { - global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME, $DEFAULTBASEURL, $ss_uri, $tracker_lang, $default_theme; + global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME, $DEFAULTBASEURL, $ss_uri, $tracker_lang, $default_theme, $keywords, $description, $pic_base_url; if (!$SITE_ONLINE) die('Site is down for maintenance, please check back again later... thanks
    '); @@ -766,9 +769,8 @@ function loggedinorreturn($nowarn = false) { function deletetorrent($id) { global $torrent_dir; $images = mysql_fetch_array(sql_query('SELECT image1, image2, image3, image4, image5 FROM torrents WHERE id = '.$id)); - if ($images) { - for ($x=1; $x <= 5; $x++) { - if ($images['image' . $x] != '') + if ($images) { for ($x=1; $x <= 5; $x++) { + if ($images['image' . $x] != '' && file_exists('torrents/images/' . $images['image' . $x])) unlink('torrents/images/' . $images['image' . $x]); } } @@ -778,6 +780,8 @@ function deletetorrent($id) { sql_query('DELETE FROM readtorrents WHERE torrentid = '.$id); foreach(explode('.','peers.files.comments.ratings') as $x) sql_query('DELETE FROM '.$x.' WHERE torrent = '.$id); + sql_query('DELETE FROM torrents_scrape WHERE tid = '.$id); + sql_query('DELETE FROM torrents_descr WHERE tid = '.$id); unlink($torrent_dir.'/'.$id.'.torrent'); } @@ -908,11 +912,11 @@ function linkcolor($num) { } function ratingpic($num) { - global $pic_base_url, $tracker_lang; - $r = round($num * 2) / 2; + global $pic_base_url, $tracker_lang, $ss_uri; + $r = round($num); if ($r < 1 || $r > 5) return; - return "\"".$tracker_lang['rating'].":"; + return "\"".$tracker_lang['rating'].":"; } function writecomment($userid, $comment) { @@ -963,9 +967,14 @@ function parked() { stderr($tracker_lang['error'], 'Ваш аккаунт припаркован.'); } +function magnet($html = true, $info_hash, $name, $size, $announces = array()) { + $ampersand = $html ? '&' : '&'; + return sprintf('magnet:?xt=urn:btih:%2$s%1$sdn=%3$s%1$sxl=%4$d%1$str=%5$s', $ampersand, $info_hash, urlencode($name), $size, implode($ampersand . 'tr=', $announces)); +} + // В этой строке забит копирайт. При его убирании можешь поплатиться рабочим трекером ;) В данном случае - убирая строчки ниже ты не сможешь использовать трекер. define ('VERSION', ''); -define ('NUM_VERSION', '2.1.14'); +define ('NUM_VERSION', '2.1.18'); define ('TBVERSION', 'Powered by TBDev v'.NUM_VERSION.' Yuna Scatari Edition '.VERSION.' Copyright © 2001-'.date('Y')); function mysql_modified_rows () { diff --git a/include/functions_announce.php b/include/functions_announce.php index dcc7c7e..530cd3c 100644 --- a/include/functions_announce.php +++ b/include/functions_announce.php @@ -31,7 +31,9 @@ die('Hacking attempt!'); require_once($rootpath . 'include/config.php'); +require_once($rootpath . 'include/config.local.php'); require_once($rootpath . 'include/secrets.php'); +require_once($rootpath . 'include/secrets.local.php'); function err($msg) { benc_resp(array("failure reason" => array('type' => 'string', 'value' => $msg))); diff --git a/include/functions_commenttable.php b/include/functions_commenttable.php index a7613f9..3e4008b 100644 --- a/include/functions_commenttable.php +++ b/include/functions_commenttable.php @@ -73,7 +73,13 @@ function commenttable($rows, $redaktor = "comment") { $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars_uni($row["avatar"]) : ""); if (!$avatar){$avatar = "pic/default_avatar.gif"; } - $text = format_comment($row["text"]); + + if (md5($row['text']) == $row['text_hash']) + $text = $row['text_parsed']; + else { + $text = format_comment($row['text']); + sql_query('INSERT INTO comments_parsed (cid, text_hash, text_parsed) VALUES ('.implode(', ', array_map('sqlesc', array($row['id'], md5($row['text']), $text))).')') or sqlerr(__FILE__,__LINE__); + } if ($row["editedby"]) { //$res = mysql_fetch_assoc(sql_query("SELECT * FROM users WHERE id = $row[editedby]")) or sqlerr(__FILE__,__LINE__); diff --git a/include/functions_global.php b/include/functions_global.php index 1d2879a..4ed0704 100644 --- a/include/functions_global.php +++ b/include/functions_global.php @@ -27,492 +27,561 @@ */ # IMPORTANT: Do not edit below unless you know what you are doing! -if(!defined('IN_TRACKER')) - die('Hacking attempt!'); - -function get_user_class_color($class, $username) -{ - global $tracker_lang; - switch ($class) - { - case UC_SYSOP: - return "" . $username . ""; - break; - case UC_ADMINISTRATOR: - return "" . $username . ""; - break; - case UC_MODERATOR: - return "" . $username . ""; - break; - case UC_UPLOADER: - return "" . $username . ""; - break; - case UC_VIP: - return "" . $username . ""; - break; - case UC_POWER_USER: - return "" . $username . ""; - break; - case UC_USER: - return "" . $username . ""; - break; - } - return "$username"; +if (!defined('IN_TRACKER')) + die('Hacking attempt!'); + +function get_user_class_color($class, $username) { + global $tracker_lang; + switch ($class) { + case UC_SYSOP: + return "" . $username . ""; + break; + case UC_ADMINISTRATOR: + return "" . $username . ""; + break; + case UC_MODERATOR: + return "" . $username . ""; + break; + case UC_UPLOADER: + return "" . $username . ""; + break; + case UC_VIP: + return "" . $username . ""; + break; + case UC_POWER_USER: + return "" . $username . ""; + break; + case UC_USER: + return "" . $username . ""; + break; + } + return "$username"; } -function display_date_time($timestamp = 0 , $tzoffset = 0){ - return date("Y-m-d H:i:s", $timestamp + ($tzoffset * 60)); +function display_date_time($timestamp = 0, $tzoffset = 0) { + return date("Y-m-d H:i:s", $timestamp + ($tzoffset * 60)); } -function cut_text ($txt, $car) { - while(strlen($txt) > $car) { - return substr($txt, 0, $car) . "..."; +function cut_text($txt, $car) { + while (strlen($txt) > $car) { + return substr($txt, 0, $car) . "..."; } return $txt; } -function textbbcode($form, $name, $content="") { -?> - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    \n"); - print("
    ".($heading ? "$heading
    " : "")."$text
    \n"); + if ($htmlstrip) { + $heading = htmlspecialchars_uni(trim($heading)); + $text = htmlspecialchars_uni(trim($text)); + } + print("
    \n"); + print("
    " . ($heading ? "$heading
    " : "") . "$text
    \n"); } function stderr($heading = '', $text = '') { @@ -555,8 +624,8 @@ function newerr($heading = '', $text = '', $head = true, $foot = true, $die = tr function sqlerr($file = '', $line = '') { global $queries; print("" . - "

    пїЅпїЅпїЅпїЅпїЅпїЅ пїЅ SQL

    \n" . - "пїЅпїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ MySQL: " . htmlspecialchars_uni(mysql_error()) . ($file != '' && $line != '' ? "

    пїЅ $file, пїЅпїЅпїЅпїЅпїЅ $line

    " : "") . "

    пїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ $queries.

    "); + "

    Ошибка в SQL

    \n" . + "Ответ от сервера MySQL: " . htmlspecialchars_uni(mysql_error()) . ($file != '' && $line != '' ? "

    в $file, линия $line

    " : "") . "

    Запрос номер $queries.

    "); die; } @@ -579,11 +648,10 @@ function get_dt_num() { return date("YmdHis"); } -function format_urls($s) -{ +function format_urls($s) { return preg_replace( - "/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)/i", - "\\1\\2", $s); + "/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)/i", + "\\1\\2", $s); } /* @@ -602,49 +670,47 @@ function format_local_urls($s) //Finds last occurrence of needle in haystack //in PHP5 use strripos() instead of this -function _strlastpos ($haystack, $needle, $offset = 0) -{ - $addLen = strlen ($needle); +function _strlastpos($haystack, $needle, $offset = 0) { + $addLen = strlen($needle); $endPos = $offset - $addLen; - while (true) - { - if (($newPos = strpos ($haystack, $needle, $endPos + $addLen)) === false) break; + while (true) { + if (($newPos = strpos($haystack, $needle, $endPos + $addLen)) === false) break; $endPos = $newPos; } return ($endPos >= 0) ? $endPos : false; } -function format_quotes($s) -{ - while ($old_s != $s) - { - $old_s = $s; +function format_quotes($s) { + while ($old_s != $s) { + $old_s = $s; - //find first occurrence of [/quote] - $close = strpos($s, "[/quote]"); - if ($close === false) - return $s; + //find first occurrence of [/quote] + $close = strpos($s, "[/quote]"); + if ($close === false) + return $s; - //find last [quote] before first [/quote] - //note that there is no check for correct syntax - $open = _strlastpos(substr($s,0,$close), "[quote"); - if ($open === false) - return $s; + //find last [quote] before first [/quote] + //note that there is no check for correct syntax + $open = _strlastpos(substr($s, 0, $close), "[quote"); + if ($open === false) + return $s; - $quote = substr($s,$open,$close - $open + 8); + $quote = substr($s, $open, $close - $open + 8); - //[quote]Text[/quote] - $quote = preg_replace( - "/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i", - "

    Quote:

    \\1

    ", $quote); + //[quote]Text[/quote] + $quote = preg_replace( + "/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i", + "

    Quote:

    \\1

    ", + $quote); - //[quote=Author]Text[/quote] - $quote = preg_replace( - "/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i", - "

    \\1 wrote:

    \\2

    ", $quote); + //[quote=Author]Text[/quote] + $quote = preg_replace( + "/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i", + "

    \\1 wrote:

    \\2

    ", + $quote); - $s = substr($s,0,$open) . $quote . substr($s,$close + 8); - } + $s = substr($s, 0, $open) . $quote . substr($s, $close + 8); + } return $s; } @@ -652,26 +718,26 @@ function format_quotes($s) // Format quote function encode_quote($text) { $start_html = "
    " - ."" - ."
    пїЅпїЅпїЅпїЅпїЅпїЅ
    "; + . "" + . "
    Цитата
    "; $end_html = "
    "; - $text = preg_replace("#\[quote\](.*?)\[/quote\]#si", "".$start_html."\\1".$end_html."", $text); + $text = preg_replace("#\[quote\](.*?)\[/quote\]#si", "" . $start_html . "\\1" . $end_html . "", $text); return $text; } // Format quote from function encode_quote_from($text) { $start_html = "
    " - ."" - ."
    \\1 пїЅпїЅпїЅпїЅпїЅ
    "; + . "" + . "
    \\1 писал
    "; $end_html = "
    "; - $text = preg_replace("#\[quote=(.+?)\](.*?)\[/quote\]#si", "".$start_html."\\2".$end_html."", $text); + $text = preg_replace("#\[quote=(.+?)\](.*?)\[/quote\]#si", "" . $start_html . "\\2" . $end_html . "", $text); return $text; } // Format spoiler /*function encode_spoiler($text) { - $replace = "
    пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ
    "; + $replace = "
    Скрытый текст
    "; $text = preg_replace("#\[hide\](.*?)\[/hide\]#si", $replace, $text); return $text; } @@ -697,118 +763,119 @@ function encode_spoiler_from($text) { } // Format spoiler -function escape1($matches){ - return "
    пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ
    "; +function escape1($matches) { + return "
    Скрытый текст
    "; } // Format spoiler from -function escape2($matches){ - return "
    ".$matches[1]."
    "; +function escape2($matches) { + return "
    " . $matches[1] . "
    "; } // Format code function encode_code($text) { $start_html = "
    " - ."" - ."" - ."
    пїЅпїЅпїЅ
    {ZEILEN}"; + . "" + . "" + . "
    Код
    {ZEILEN}"; $end_html = "
    "; $match_count = preg_match_all("#\[code\](.*?)\[/code\]#si", $text, $matches); - for ($mout = 0; $mout < $match_count; ++$mout) { - $before_replace = $matches[1][$mout]; - $after_replace = $matches[1][$mout]; - $after_replace = trim ($after_replace); - $zeilen_array = explode ("
    ", $after_replace); - $j = 1; - $zeilen = ""; - foreach ($zeilen_array as $str) { - $zeilen .= "".$j."
    "; - ++$j; - } - $after_replace = str_replace ("", "", $after_replace); - $after_replace = str_replace ("&", "&", $after_replace); - $after_replace = str_replace ("", "  ", $after_replace); - $after_replace = str_replace ("", "  ", $after_replace); - $after_replace = str_replace ("", "   ", $after_replace); - $after_replace = preg_replace ("/^ {1}/m", " ", $after_replace); - $str_to_match = "[code]".$before_replace."[/code]"; - $replace = str_replace ("{ZEILEN}", $zeilen, $start_html); - $replace .= $after_replace; - $replace .= $end_html; - $text = str_replace ($str_to_match, $replace, $text); - } - - $text = str_replace ("[code]", $start_html, $text); - $text = str_replace ("[/code]", $end_html, $text); - return $text; + for ($mout = 0; $mout < $match_count; ++$mout) { + $before_replace = $matches[1][$mout]; + $after_replace = $matches[1][$mout]; + $after_replace = trim($after_replace); + $zeilen_array = explode("
    ", $after_replace); + $j = 1; + $zeilen = ""; + foreach ($zeilen_array as $str) { + $zeilen .= "" . $j . "
    "; + ++$j; + } + $after_replace = str_replace("", "", $after_replace); + $after_replace = str_replace("&", "&", $after_replace); + $after_replace = str_replace("", "  ", $after_replace); + $after_replace = str_replace("", "  ", $after_replace); + $after_replace = str_replace("", "   ", $after_replace); + $after_replace = preg_replace("/^ {1}/m", " ", $after_replace); + $str_to_match = "[code]" . $before_replace . "[/code]"; + $replace = str_replace("{ZEILEN}", $zeilen, $start_html); + $replace .= $after_replace; + $replace .= $end_html; + $text = str_replace($str_to_match, $replace, $text); + } + + $text = str_replace("[code]", $start_html, $text); + $text = str_replace("[/code]", $end_html, $text); + return $text; } function encode_php($text) { $start_html = "
    " - ."" - ."" - ."
    PHP - пїЅпїЅпїЅ
    {ZEILEN}"; + . "" + . "" + . "
    PHP - Код
    {ZEILEN}"; $end_html = "
    "; $match_count = preg_match_all("#\[php\](.*?)\[/php\]#si", $text, $matches); - for ($mout = 0; $mout < $match_count; ++$mout) { - $before_replace = $matches[1][$mout]; - $after_replace = $matches[1][$mout]; - $after_replace = trim ($after_replace); + for ($mout = 0; $mout < $match_count; ++$mout) { + $before_replace = $matches[1][$mout]; + $after_replace = $matches[1][$mout]; + $after_replace = trim($after_replace); $after_replace = str_replace("<", "<", $after_replace); $after_replace = str_replace(">", ">", $after_replace); $after_replace = str_replace(""", '"', $after_replace); $after_replace = preg_replace("/" : "".$after_replace.""; - ob_start (); - highlight_string ($after_replace); - $after_replace = ob_get_contents (); - ob_end_clean (); + $after_replace = (substr($after_replace, 0, + 5) != "") ? "" . $after_replace . "\n?>" : "" . $after_replace . ""; + ob_start(); + highlight_string($after_replace); + $after_replace = ob_get_contents(); + ob_end_clean(); $zeilen_array = explode("
    ", $after_replace); - $j = 1; - $zeilen = ""; - foreach ($zeilen_array as $str) { - $zeilen .= "".$j."
    "; - ++$j; - } + $j = 1; + $zeilen = ""; + foreach ($zeilen_array as $str) { + $zeilen .= "" . $j . "
    "; + ++$j; + } $after_replace = str_replace("\n", "", $after_replace); $after_replace = str_replace("&", "&", $after_replace); $after_replace = str_replace(" ", "  ", $after_replace); $after_replace = str_replace(" ", "  ", $after_replace); $after_replace = str_replace("\t", "   ", $after_replace); $after_replace = preg_replace("/^ {1}/m", " ", $after_replace); - $str_to_match = "[php]".$before_replace."[/php]"; + $str_to_match = "[php]" . $before_replace . "[/php]"; $replace = str_replace("{ZEILEN}", $zeilen, $start_html); - $replace .= $after_replace; - $replace .= $end_html; - $text = str_replace ($str_to_match, $replace, $text); - } + $replace .= $after_replace; + $replace .= $end_html; + $text = str_replace($str_to_match, $replace, $text); + } $text = str_replace("[php]", $start_html, $text); $text = str_replace("[/php]", $end_html, $text); - return $text; + return $text; } -function code_nobb ($matches){ +function code_nobb($matches) { $code = $matches[1]; $code = str_replace("[", "[", $code); $code = str_replace("]", "]", $code); - return '[code]'.$code.'[/code]'; + return '[code]' . $code . '[/code]'; } function format_comment($text, $strip_html = true) { - global $smilies, $privatesmilies; + global $smilies, $privatesmilies, $pic_base_url; $smiliese = $smilies; $s = $text; - // This fixes the extraneous ;) smilies problem. When there was an html escaped - // char before a closing bracket - like >), "), ... - this would be encoded - // to &xxx;), hence all the extra smilies. I created a new :wink: label, removed - // the ;) one, and replace all genuine ;) by :wink: before escaping the body. - // (What took us so long? :blush:)- wyz + // This fixes the extraneous ;) smilies problem. When there was an html escaped + // char before a closing bracket - like >), "), ... - this would be encoded + // to &xxx;), hence all the extra smilies. I created a new :wink: label, removed + // the ;) one, and replace all genuine ;) by :wink: before escaping the body. + // (What took us so long? :blush:)- wyz $s = str_replace(";)", ":wink:", $s); - $s = preg_replace_callback("#\[code\](.*?)\[/code\]#si","code_nobb",$s); + $s = preg_replace_callback("#\[code\](.*?)\[/code\]#si", "code_nobb", $s); if ($strip_html) $s = htmlspecialchars_uni($s); @@ -817,12 +884,12 @@ function format_comment($text, $strip_html = true) { $html[] = "\"\\1\""; $bb[] = "#\[img=([a-zA-Z]+)\](?!javascript:)([^?](?:[^\[]+|\[(?!url))*?)\[/img\]#is"; $html[] = "\"\\2\""; - $bb[] = "#\[img\ alt=([a-zA-ZпїЅ-пїЅпїЅ-пїЅ0-9\_\-\. ]+)\](?!javascript:)([^?](?:[^\[]+|\[(?!url))*?)\[/img\]#is"; + $bb[] = "#\[img\ alt=([a-zA-Zа-яА-Я0-9\_\-\. ]+)\](?!javascript:)([^?](?:[^\[]+|\[(?!url))*?)\[/img\]#is"; $html[] = "\"\\1\""; - $bb[] = "#\[img=([a-zA-Z]+) alt=([a-zA-ZпїЅ-пїЅпїЅ-пїЅ0-9\_\-\. ]+)\](?!javascript:)([^?](?:[^\[]+|\[(?!url))*?)\[/img\]#is"; + $bb[] = "#\[img=([a-zA-Z]+) alt=([a-zA-Zа-яА-Я0-9\_\-\. ]+)\](?!javascript:)([^?](?:[^\[]+|\[(?!url))*?)\[/img\]#is"; $html[] = "\"\\2\""; $bb[] = "#\[kp=([0-9]+)\]#is"; - $html[] = "\"пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ\""; + $html[] = "\"Кинопоиск\""; $bb[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is"; $html[] = "\\1"; $bb[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is"; @@ -859,7 +926,7 @@ function format_comment($text, $strip_html = true) { $html[] = "
  • "; $bb[] = "#\[hr\]#si"; $html[] = "
    "; - $bb[] = "#\[youtube=([[:alnum:]]+)\]#si"; # Пример использования: [youtube=gyzGhfbZVqI] + $bb[] = "#\[youtube=([[:alnum:]]+)\]#si"; $html[] = ''; $s = preg_replace($bb, $html, $s); @@ -875,15 +942,24 @@ function format_comment($text, $strip_html = true) { //$s = str_replace(" ", "  ", $s); foreach ($smiliese as $code => $url) - $s = str_replace($code, "\""", $s); + $s = str_replace($code, + "", $s); foreach ($privatesmilies as $code => $url) - $s = str_replace($code, "", $s); + $s = str_replace($code, "", $s); - while (preg_match("#\[quote\](.*?)\[/quote\]#si", $s)) $s = encode_quote($s); - while (preg_match("#\[quote=(.+?)\](.*?)\[/quote\]#si", $s)) $s = encode_quote_from($s); - while (preg_match("#\[hide\](.*?)\[/hide\]#si", $s)) $s = encode_spoiler($s); - while (preg_match("#\[hide=(.+?)\](.*?)\[/hide\]#si", $s)) $s = encode_spoiler_from($s); + while (preg_match("#\[quote\](.*?)\[/quote\]#si", $s)) { + $s = encode_quote($s); + } + while (preg_match("#\[quote=(.+?)\](.*?)\[/quote\]#si", $s)) { + $s = encode_quote_from($s); + } + while (preg_match("#\[hide\](.*?)\[/hide\]#si", $s)) { + $s = encode_spoiler($s); + } + while (preg_match("#\[hide=(.+?)\](.*?)\[/hide\]#si", $s)) { + $s = encode_spoiler_from($s); + } if (preg_match("#\[code\](.*?)\[/code\]#si", $s)) $s = encode_code($s); if (preg_match("#\[php\](.*?)\[/php\]#si", $s)) $s = encode_php($s); @@ -891,143 +967,212 @@ function format_comment($text, $strip_html = true) { } function get_user_class() { - global $CURUSER; - return $CURUSER["class"]; + global $CURUSER; + return $CURUSER["class"]; } function get_user_class_name($class) { - global $tracker_lang; - switch ($class) { - case UC_USER: return $tracker_lang['class_user']; + global $tracker_lang; + switch ($class) { + case UC_USER: + return $tracker_lang['class_user']; - case UC_POWER_USER: return $tracker_lang['class_power_user']; + case UC_POWER_USER: + return $tracker_lang['class_power_user']; - case UC_VIP: return $tracker_lang['class_vip']; + case UC_VIP: + return $tracker_lang['class_vip']; - case UC_UPLOADER: return $tracker_lang['class_uploader']; + case UC_UPLOADER: + return $tracker_lang['class_uploader']; - case UC_MODERATOR: return $tracker_lang['class_moderator']; + case UC_MODERATOR: + return $tracker_lang['class_moderator']; - case UC_ADMINISTRATOR: return $tracker_lang['class_administrator']; + case UC_ADMINISTRATOR: + return $tracker_lang['class_administrator']; - case UC_SYSOP: return $tracker_lang['class_sysop']; - } - return ""; + case UC_SYSOP: + return $tracker_lang['class_sysop']; + } + return ""; } function is_valid_user_class($class) { - return is_numeric($class) && floor($class) == $class && $class >= UC_USER && $class <= UC_SYSOP; + return is_numeric($class) && floor($class) == $class && $class >= UC_USER && $class <= UC_SYSOP; } //---------------------------------- //---- Security function v0.1 by xam //---------------------------------- -function int_check($value,$stdhead = false, $stdfood = true, $die = true, $log = true) { +function int_check($value, $stdhead = false, $stdfood = true, $die = true, $log = true) { global $CURUSER; - $msg = "Invalid ID Attempt: Username: ".$CURUSER["username"]." - UserID: ".$CURUSER["id"]." - UserIP : ".getip(); - if ( is_array($value) ) { - foreach ($value as $val) int_check ($val); - } else { - if (!is_valid_id($value)) { - if ($stdhead) { - if ($log) - write_log($msg); - stderr("ERROR","Invalid ID! For security reason, we have been logged this action."); - }else { - Print ("

    Error

    \s*$/g,rb={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"
    "); + $msg = "Invalid ID Attempt: Username: " . $CURUSER["username"] . " - UserID: " . $CURUSER["id"] . " - UserIP : " . getip(); + if (is_array($value)) { + foreach ($value as $val) int_check($val); + } else { + if (!is_valid_id($value)) { + if ($stdhead) { + if ($log) + write_log($msg); + stderr("ERROR", "Invalid ID! For security reason, we have been logged this action."); + } else { + Print ("

    Error

    "); Print ("Invalid ID! For security reason, we have been logged this action.
    "); if ($log) write_log($msg); - } - - if ($stdfood) - stdfoot(); - if ($die) - die; - } - else - return true; - } + } + + if ($stdfood) + stdfoot(); + if ($die) + die; + } else + return true; + } } + //---------------------------------- //---- Security function v0.1 by xam //---------------------------------- function is_valid_id($id) { - return is_numeric($id) && ($id > 0) && (floor($id) == $id); + return is_numeric($id) && ($id > 0) && (floor($id) == $id); } function sql_ts_to_ut($s) { - return sql_timestamp_to_unix_timestamp($s); + return sql_timestamp_to_unix_timestamp($s); } function sql_timestamp_to_unix_timestamp($s) { - return mktime(substr($s, 11, 2), substr($s, 14, 2), substr($s, 17, 2), substr($s, 5, 2), substr($s, 8, 2), substr($s, 0, 4)); + return mktime(substr($s, 11, 2), substr($s, 14, 2), substr($s, 17, 2), substr($s, 5, 2), substr($s, 8, 2), + substr($s, 0, 4)); } - function get_ratio_color($ratio) { - if ($ratio < 0.1) return "#ff0000"; - if ($ratio < 0.2) return "#ee0000"; - if ($ratio < 0.3) return "#dd0000"; - if ($ratio < 0.4) return "#cc0000"; - if ($ratio < 0.5) return "#bb0000"; - if ($ratio < 0.6) return "#aa0000"; - if ($ratio < 0.7) return "#990000"; - if ($ratio < 0.8) return "#880000"; - if ($ratio < 0.9) return "#770000"; - if ($ratio < 1) return "#660000"; - return "#000000"; - } - - function get_slr_color($ratio) { - if ($ratio < 0.025) return "#ff0000"; - if ($ratio < 0.05) return "#ee0000"; - if ($ratio < 0.075) return "#dd0000"; - if ($ratio < 0.1) return "#cc0000"; - if ($ratio < 0.125) return "#bb0000"; - if ($ratio < 0.15) return "#aa0000"; - if ($ratio < 0.175) return "#990000"; - if ($ratio < 0.2) return "#880000"; - if ($ratio < 0.225) return "#770000"; - if ($ratio < 0.25) return "#660000"; - if ($ratio < 0.275) return "#550000"; - if ($ratio < 0.3) return "#440000"; - if ($ratio < 0.325) return "#330000"; - if ($ratio < 0.35) return "#220000"; - if ($ratio < 0.375) return "#110000"; - return "#000000"; - } +function get_ratio_color($ratio) { + if ($ratio < 0.1) return "#ff0000"; + if ($ratio < 0.2) return "#ee0000"; + if ($ratio < 0.3) return "#dd0000"; + if ($ratio < 0.4) return "#cc0000"; + if ($ratio < 0.5) return "#bb0000"; + if ($ratio < 0.6) return "#aa0000"; + if ($ratio < 0.7) return "#990000"; + if ($ratio < 0.8) return "#880000"; + if ($ratio < 0.9) return "#770000"; + if ($ratio < 1) return "#660000"; + return "#000000"; +} + +function get_slr_color($ratio) { + if ($ratio < 0.025) return "#ff0000"; + if ($ratio < 0.05) return "#ee0000"; + if ($ratio < 0.075) return "#dd0000"; + if ($ratio < 0.1) return "#cc0000"; + if ($ratio < 0.125) return "#bb0000"; + if ($ratio < 0.15) return "#aa0000"; + if ($ratio < 0.175) return "#990000"; + if ($ratio < 0.2) return "#880000"; + if ($ratio < 0.225) return "#770000"; + if ($ratio < 0.25) return "#660000"; + if ($ratio < 0.275) return "#550000"; + if ($ratio < 0.3) return "#440000"; + if ($ratio < 0.325) return "#330000"; + if ($ratio < 0.35) return "#220000"; + if ($ratio < 0.375) return "#110000"; + return "#000000"; +} function write_log($text, $color = "transparent", $type = "tracker") { - $type = sqlesc($type); - $color = sqlesc($color); - $text = sqlesc($text); - $added = sqlesc(get_date_time()); - sql_query("INSERT INTO sitelog (added, color, txt, type) VALUES($added, $color, $text, $type)"); + $type = sqlesc($type); + $color = sqlesc($color); + $text = sqlesc($text); + $added = sqlesc(get_date_time()); + sql_query("INSERT INTO sitelog (added, color, txt, type) VALUES($added, $color, $text, $type)"); +} + +function getWord($number, $suffix) { + $keys = array(2, 0, 1, 1, 1, 2); + $mod = $number % 100; + $suffix_key = ($mod > 7 && $mod < 20) ? 2: $keys[min($mod % 10, 5)]; + return $suffix[$suffix_key]; } function get_et($ts) { - return get_elapsed_time($ts); + return get_elapsed_time_plural($ts); +} + +function get_lt($ts) { + return get_left_time_plural($ts); +} + +function get_left_time_plural($time_end, $decimals = 0) { + $divider['years'] = (60 * 60 * 24 * 365); + $divider['months'] = (60 * 60 * 24 * 365 / 12); + $divider['weeks'] = (60 * 60 * 24 * 7); + $divider['days'] = (60 * 60 * 24); + $divider['hours'] = (60 * 60); + $divider['minutes'] = (60); + + $langs['years'] = array("год", "года", "лет"); + $langs['months'] = array("месяц", "месяца", "месяцев"); + $langs['weeks'] = array("неделю", "недели", "недель"); + $langs['days'] = array("сутки", "суток", "суток"); + $langs['hours'] = array("час", "часа", "часов"); + $langs['minutes'] = array("минуту", "минуты", "минут"); + + foreach ($divider as $unit => $div) { + ${'left_time_'.$unit} = floor((($time_end - TIMENOW) / $div)); + if (${'left_time_'.$unit} >= 1) + break; + } + $left_time = ${'left_time_'.$unit} . ' ' . getWord(${'left_time_'.$unit}, $langs[$unit]); + + return $left_time; +} + +function get_elapsed_time_plural($time_start, $decimals = 0) { + $divider['years'] = (60 * 60 * 24 * 365); + $divider['months'] = (60 * 60 * 24 * 365 / 12); + $divider['weeks'] = (60 * 60 * 24 * 7); + $divider['days'] = (60 * 60 * 24); + $divider['hours'] = (60 * 60); + $divider['minutes'] = (60); + + $langs['years'] = array("год", "года", "лет"); + $langs['months'] = array("месяц", "месяца", "месяцев"); + $langs['weeks'] = array("неделю", "недели", "недель"); + $langs['days'] = array("день", "дня", "дней"); + $langs['hours'] = array("час", "часа", "часов"); + $langs['minutes'] = array("минуту", "минуты", "минут"); + + foreach ($divider as $unit => $div) { + ${'elapsed_time_'.$unit} = floor(((TIMENOW - $time_start) / $div)); + if (${'elapsed_time_'.$unit} >= 1) + break; + } + $elapsed_time = ${'elapsed_time_'.$unit} . ' ' . getWord(${'elapsed_time_'.$unit}, $langs[$unit]); + + return $elapsed_time; } function get_elapsed_time($ts) { - $mins = floor((time() - $ts) / 60); - $hours = floor($mins / 60); - $mins -= $hours * 60; - $days = floor($hours / 24); - $hours -= $days * 24; - $weeks = floor($days / 7); - $days -= $weeks * 7; - $t = ""; - if ($weeks > 0) - return "$weeks пїЅпїЅпїЅпїЅпїЅ" . ($weeks > 1 ? "пїЅ" : "пїЅ"); - if ($days > 0) - return "$days пїЅ" . ($days > 1 ? "пїЅпїЅпїЅ" : "пїЅпїЅпїЅ"); - if ($hours > 0) - return "$hours пїЅпїЅпїЅ" . ($hours > 1 ? "пїЅпїЅ" : ""); - if ($mins > 0) - return "$mins пїЅпїЅпїЅпїЅпїЅ" . ($mins > 1 ? "" : "пїЅ"); - return "< 1 пїЅпїЅпїЅпїЅпїЅпїЅ"; + $mins = floor((time() - $ts) / 60); + $hours = floor($mins / 60); + $mins -= $hours * 60; + $days = floor($hours / 24); + $hours -= $days * 24; + $weeks = floor($days / 7); + $days -= $weeks * 7; + $t = ""; + if ($weeks > 0) + return "$weeks недел" . ($weeks > 1 ? "и" : "я"); + if ($days > 0) + return "$days д" . ($days > 1 ? "ней" : "ень"); + if ($hours > 0) + return "$hours час" . ($hours > 1 ? "ов" : ""); + if ($mins > 0) + return "$mins минут" . ($mins > 1 ? "" : "а"); + return "< 1 минуты"; } ?> \ No newline at end of file diff --git a/include/functions_torrenttable.php b/include/functions_torrenttable.php index 594afd1..7a3ec65 100644 --- a/include/functions_torrenttable.php +++ b/include/functions_torrenttable.php @@ -206,7 +206,7 @@ function torrenttable($res, $variant = "index") { while ($row = mysql_fetch_assoc($res)) { $id = $row["id"]; - print("\n"); + print("\n"); print("
    "); if (isset($row["cat_name"])) { @@ -224,16 +224,16 @@ function torrenttable($res, $variant = "index") { $dispname = $row["name"]; switch ($row['free']) { case 'yes': - $freepic = "\"".$tracker_lang['golden']."\""; + $freepic = "\"".$tracker_lang['golden']."\""; break; case 'silver': - $freepic = "\"".$tracker_lang['silver']."\""; + $freepic = "\"".$tracker_lang['silver']."\""; break; case 'no': $freepic = ''; } $thisisfree = $freepic; - print("".($row["sticky"] == "yes" ? "Важный: " : "")."".($row["not_sticky"] == "no" ? "Важный: " : "")."$dispname $thisisfree\n"); if ($variant != "bookmarks" && $CURUSER) - print("\"".$tracker_lang['bookmark_this']."\"\n"); + print("\"".$tracker_lang['bookmark_this']."\"\n"); - print("\"".$tracker_lang['download']."\"\n"); + print("\"".$tracker_lang['download']."\"\n"); + + if ($row['multitracker'] == 'yes') { + + print("\"{$tracker_lang['magnet']}\"\n"); + + $allow_update = (strtotime($row['last_mt_update']) < (TIMENOW - 3600)); + if ($allow_update) + $suffix = '_update'; + $multi_image = "\"{$tracker_lang['external_torrent'\n"; + if ($allow_update) + $multi_image = "$multi_image\n"; + echo $multi_image; + } if ($CURUSER["id"] == $row["owner"] || get_user_class() >= UC_MODERATOR) $owned = 1; @@ -252,7 +265,7 @@ function torrenttable($res, $variant = "index") { $owned = 0; if ($owned) - print("\"".$tracker_lang['edit']."\"\n"); + print("\"".$tracker_lang['edit']."\"\n"); if ($row["readtorrent"] == 0 && $variant == "index") print ("[новый]"); diff --git a/include/init.php b/include/init.php index f43cc43..c303ab8 100644 --- a/include/init.php +++ b/include/init.php @@ -54,8 +54,6 @@ function html_uni($str) { $announce_urls = array(); $announce_urls[] = "$DEFAULTBASEURL/announce.php"; -// SECURITY -define ('COOKIE_SALT', 'default'); // Заполните эту переменную любым мусором, символов эдак 32 - нужно для соли кукисов // После смены этих двух параметров всем пользователям надо будет ввести логин пароль define ('COOKIE_UID', 'uid'); // Имя куки для userid define ('COOKIE_PASSHASH', 'pass'); // Имя куки для пароля diff --git a/include/scraper/httptscraper.php b/include/scraper/httptscraper.php new file mode 100644 index 0000000..37dddac --- /dev/null +++ b/include/scraper/httptscraper.php @@ -0,0 +1,96 @@ +scrape('http://tracker.tld:port/announce',array('0000000000000000000000000000000000000000')); + + print_r($ret); + }catch(ScraperException $e){ + echo('Error: ' . $e->getMessage() . "
    \n"); + echo('Connection error: ' . ($e->isConnectionError() ? 'yes' : 'no') . "
    \n"); + } + */ + + require_once(dirname(__FILE__) . '/tscraper.php'); + require_once(dirname(__FILE__) . '/lightbenc.php'); + + class httptscraper extends tscraper{ + protected $maxreadsize; + + public function __construct($timeout=2,$maxreadsize=4096){ + $this->maxreadsize = $maxreadsize; + parent::__construct($timeout); + } + + /* $url: Tracker url like: http://tracker.tld:port/announce or http://tracker.tld:port/scrape + $infohash: Infohash string or array. 40 char long infohash. + */ + public function scrape($url,$infohash){ + if(!is_array($infohash)){ $infohash = array($infohash); } + foreach($infohash as $hash){ + if(!preg_match('#^[a-f0-9]{40}$#i',$hash)){ throw new ScraperException('Invalid infohash: ' . $hash . '.'); } + } + $url = trim($url); + if (preg_match('%(http://.*?/)announce([^/]*)$%i', $url, $m)){ + $url = $m[1] . 'scrape' . $m[2]; + }else if (preg_match('%(http://.*?/)scrape([^/]*)$%i', $url, $m)){ + }else{ + throw new ScraperException('Invalid tracker url.'); + } + + $sep = preg_match ('/\?.{1,}?/i', $url) ? '&' : '?'; + $requesturl = $url; + foreach($infohash as $hash){ + $requesturl .= $sep . 'info_hash=' . rawurlencode(pack('H*', $hash)); + $sep = '&'; + } + + ini_set('default_socket_timeout',$this->timeout); + $rh = @fopen($requesturl,'r'); + if(!$rh){ throw new ScraperException('Could not open HTTP connection.',0,true); } + stream_set_timeout($rh, $this->timeout); + + $return = ''; + $pos = 0; + while (!feof($rh) && $pos < $this->maxreadsize){ + $return .= fread($rh,1024); + } + fclose($rh); + + if(!substr($return, 0, 1) == 'd'){ throw new ScraperException('Invalid scrape response.'); } + $arr_scrape_data = lightbenc::bdecode($return); + + $torrents = array(); + foreach($infohash as $hash){ + $ehash = pack('H*', $hash); + if (isset($arr_scrape_data['files'][$ehash])){ + $torrents[$hash] = array( 'infohash'=>$hash, + 'seeders'=>(int) $arr_scrape_data['files'][$ehash]['complete'], + 'completed'=>(int) $arr_scrape_data['files'][$ehash]['downloaded'], + 'leechers'=>(int) $arr_scrape_data['files'][$ehash]['incomplete'] + ); + }else{ + $torrents[$hash] = false; + } + } + + return($torrents); + } + } +?> \ No newline at end of file diff --git a/include/scraper/lightbenc.php b/include/scraper/lightbenc.php new file mode 100644 index 0000000..6a690a1 --- /dev/null +++ b/include/scraper/lightbenc.php @@ -0,0 +1,163 @@ + + array(1) { + [0]=> + string(8) "a string" + } + ["oneInteger"]=> + int(34) + ["isDct"]=> + bool(true) +} + +The returned value is a nested data type with the following type of elements: + - ints (test type with is_integer($x)) + - strings (test type with is_string($x)) + - lists (test type with is_array($x) && !isset($x[isDct]) + - dicts (test type with is_array($x) && isset($x[isDct]) + +All elements have the native PHP type, except for the dictionary which is an array with an "isDct" key. +This is necessary since PHP makes no distinction between flat and associative arrays. Note that the isDct +key is allways set as a bool, so that even if the dictionary contains an actual "isDct" value, the +functions behave transparently, i.e. they don't strip out or overwrite actual "isDct" keys. + +As such, this implementation is not a drop-in replacement of the TBDev code, hence the new function names +For all practical purposes, it's just as flexible, and very easy to use. For example: + +// decode the torrent file +$dict= bdecode_file($torrentfilename); +// change announce url +$dict['announce']='http://inferno.demonoid.com'; +// add private tracker flag +$dict['info']['private']=1; +// compute infohash +$infohash = pack("H*", sha1(bencode($dict["info"]))); +// recreate the torrent file +$torrentfile=bencode($dict); + +After calling bencode(), the passed nested array will have all it's dictionaries sorted by key. +The bencoded data generated by bencode() will have sorted dictionaries, but bdecode() does not require +this in the input stream, and will keep the order unchanged. + +This implementation is hereby released under the GFYPL, version 1.00. + + + The Go Fuck Yourself Public License, version 1.00 + + Article 1 + You can go fuck yourself. + + END OF ALL TERMS AND CONDITIONS + +*/ +class lightbenc { + static function bdecode($s, &$pos=0) { + if($pos>=strlen($s)) { + return null; + } + switch($s[$pos]){ + case 'd': + $pos++; + $retval=array(); + while ($s[$pos]!='e'){ + $key=self::bdecode($s, $pos); + $val=self::bdecode($s, $pos); + if ($key===null || $val===null) + break; + $retval[$key]=$val; + } + $retval["isDct"]=true; + $pos++; + return $retval; + + case 'l': + $pos++; + $retval=array(); + while ($s[$pos]!='e'){ + $val=self::bdecode($s, $pos); + if ($val===null) + break; + $retval[]=$val; + } + $pos++; + return $retval; + + case 'i': + $pos++; + $digits=strpos($s, 'e', $pos)-$pos; + $val=(int)substr($s, $pos, $digits); + $pos+=$digits+1; + return $val; + + // case "0": case "1": case "2": case "3": case "4": + // case "5": case "6": case "7": case "8": case "9": + default: + $digits=strpos($s, ':', $pos)-$pos; + if ($digits<0 || $digits >20) + return null; + $len=(int)substr($s, $pos, $digits); + $pos+=$digits+1; + $str=substr($s, $pos, $len); + $pos+=$len; + //echo "pos: $pos str: [$str] len: $len digits: $digits\n"; + return (string)$str; + } + return null; + } + + static function bencode(&$d){ + if(is_array($d)){ + $ret="l"; + if($d["isDct"]){ + $isDict=1; + $ret="d"; + // this is required by the specs, and BitTornado actualy chokes on unsorted dictionaries + ksort($d, SORT_STRING); + } + foreach($d as $key=>$value) { + if($isDict){ + // skip the isDct element, only if it's set by us + if($key=="isDct" and is_bool($value)) continue; + $ret.=strlen($key).":".$key; + } + if (is_string($value)) { + $ret.=strlen($value).":".$value; + } elseif (is_int($value)){ + $ret.="i${value}e"; + } else { + $ret.=self::bencode ($value); + } + } + return $ret."e"; + } elseif (is_string($d)) // fallback if we're given a single bencoded string or int + return strlen($d).":".$d; + elseif (is_int($d)) + return "i${d}e"; + else + return null; + } + + static function bdecode_file($filename){ + $f=file_get_contents($filename, FILE_BINARY); + return bdecode($f); + } +} +?> diff --git a/include/scraper/tscraper.php b/include/scraper/tscraper.php new file mode 100644 index 0000000..1acb4a1 --- /dev/null +++ b/include/scraper/tscraper.php @@ -0,0 +1,39 @@ +connectionerror = $connectionerror; + parent::__construct($message, $code); + } + + public function isConnectionError(){ + return($this->connectionerror); + } + } + + abstract class tscraper { + protected $timeout; + + public function __construct($timeout=2){ + $this->timeout = $timeout; + } + } + +?> \ No newline at end of file diff --git a/include/scraper/udptscraper.php b/include/scraper/udptscraper.php new file mode 100644 index 0000000..5bcb20c --- /dev/null +++ b/include/scraper/udptscraper.php @@ -0,0 +1,95 @@ +scrape('udp://tracker.tld:port',array('0000000000000000000000000000000000000000')); + + print_r($ret); + }catch(ScraperException $e){ + echo('Error: ' . $e->getMessage() . "
    \n"); + echo('Connection error: ' . ($e->isConnectionError() ? 'yes' : 'no') . "
    \n"); + } + */ + + require_once(dirname(__FILE__) . '/tscraper.php'); + + class udptscraper extends tscraper{ + + /* $url: Tracker url like: udp://tracker.tld:port or udp://tracker.tld:port/announce + $infohash: Infohash string or array (max 74 items). 40 char long infohash. + */ + public function scrape($url, $infohash){ + if(!is_array($infohash)){ $infohash = array($infohash); } + foreach($infohash as $hash){ + if(!preg_match('#^[a-f0-9]{40}$#i',$hash)){ throw new ScraperException('Invalid infohash: ' . $hash . '.'); } + } + if(count($infohash) > 74){ throw new ScraperException('Too many infohashes provided.'); } + if(!preg_match('%udp://([^:/]*)(?::([0-9]*))?(?:/)?%si', $url, $m)){ throw new ScraperException('Invalid tracker url.'); } + $tracker = 'udp://' . $m[1]; + $port = isset($m[2]) ? $m[2] : 80; + + $transaction_id = mt_rand(0,65535); + $fp = fsockopen($tracker, $port, $errno, $errstr); + if(!$fp){ throw new ScraperException('Could not open UDP connection: ' . $errno . ' - ' . $errstr,0,true); } + stream_set_timeout($fp, $this->timeout); + + $current_connid = "\x00\x00\x04\x17\x27\x10\x19\x80"; + + //Connection request + $packet = $current_connid . pack("N", 0) . pack("N", $transaction_id); + fwrite($fp,$packet); + + //Connection response + $ret = fread($fp, 16); + if(strlen($ret) < 1){ throw new ScraperException('No connection response.',0,true); } + if(strlen($ret) < 16){ throw new ScraperException('Too short connection response.'); } + $retd = unpack("Naction/Ntransid",$ret); + if($retd['action'] != 0 || $retd['transid'] != $transaction_id){ + throw new ScraperException('Invalid connection response.'); + } + $current_connid = substr($ret,8,8); + + //Scrape request + $hashes = ''; + foreach($infohash as $hash){ $hashes .= pack('H*', $hash); } + $packet = $current_connid . pack("N", 2) . pack("N", $transaction_id) . $hashes; + fwrite($fp,$packet); + + //Scrape response + $readlength = 8 + (12 * count($infohash)); + $ret = fread($fp, $readlength); + if(strlen($ret) < 1){ throw new ScraperException('No scrape response.',0,true); } + if(strlen($ret) < 8){ throw new ScraperException('Too short scrape response.'); } + $retd = unpack("Naction/Ntransid",$ret); + // Todo check for error string if response = 3 + if($retd['action'] != 2 || $retd['transid'] != $transaction_id){ + throw new ScraperException('Invalid scrape response.'); + } + if(strlen($ret) < $readlength){ throw new ScraperException('Too short scrape response.'); } + $torrents = array(); + $index = 8; + foreach($infohash as $hash){ + $retd = unpack("Nseeders/Ncompleted/Nleechers",substr($ret,$index,12)); + $retd['infohash'] = $hash; + $torrents[$hash] = $retd; + $index = $index + 12; + } + + return($torrents); + } + } +?> \ No newline at end of file diff --git a/include/smtp/smtp.lib.php b/include/smtp/smtp.lib.php index 42dfba2..5270f22 100644 --- a/include/smtp/smtp.lib.php +++ b/include/smtp/smtp.lib.php @@ -87,6 +87,7 @@ class smtp */ function smtp() { + $this->_add_hdr('Date', sprintf(date(DateTime::RFC2822))); $this->_add_hdr('X-Mailer', sprintf('LAGNUT-SMTP/%s', $this->_version)); $this->_add_hdr('User-Agent', sprintf('LAGNUT-SMTP/%s', $this->_version)); $this->_add_hdr('MIME-Version', '1.0'); @@ -447,4 +448,4 @@ function encode_hdrs($input) } -?> \ No newline at end of file +?> diff --git a/install.php b/install.php index e884493..86a340e 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,31 @@ .998){var n=this._time;this.render(0,!0,!1),this._initted=!1,this.render(n,!0,!1)}else if(this._time>0){this._initted=!1,this._init();for(var a,o=1/(1-r),h=this._firstPT;h;)a=h.s+h.c,h.c*=o,h.s=a-h.c,h=h._next}return this},l.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,o,h,l,u,p,c,f=this._dirty?this.totalDuration():this._totalDuration,m=this._time,d=this._totalTime,g=this._cycle,v=this._duration,y=this._rawPrevTime;if(t>=f?(this._totalTime=f,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=v,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(s=!0,r="onComplete"),0===v&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>y||y===n)&&y!==t&&(i=!0,y>n&&(r="onReverseComplete")),this._rawPrevTime=c=!e||t||y===t?t:n)):1e-7>t?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==d||0===v&&y>0&&y!==n)&&(r="onReverseComplete",s=this._reversed),0>t?(this._active=!1,0===v&&(this._initted||!this.vars.lazy||i)&&(y>=0&&(i=!0),this._rawPrevTime=c=!e||t||y===t?t:n)):this._initted||(i=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(h=v+this._repeatDelay,this._cycle=this._totalTime/h>>0,0!==this._cycle&&this._cycle===this._totalTime/h&&this._cycle--,this._time=this._totalTime-this._cycle*h,this._yoyo&&0!==(1&this._cycle)&&(this._time=v-this._time),this._time>v?this._time=v:0>this._time&&(this._time=0)),this._easeType?(l=this._time/v,u=this._easeType,p=this._easePower,(1===u||3===u&&l>=.5)&&(l=1-l),3===u&&(l*=2),1===p?l*=l:2===p?l*=l*l:3===p?l*=l*l*l:4===p&&(l*=l*l*l*l),this.ratio=1===u?1-l:2===u?l:.5>this._time/v?l/2:1-l/2):this.ratio=this._ease.getRatio(this._time/v)),m===this._time&&!i&&g===this._cycle)return d!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_)),void 0;if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=m,this._totalTime=d,this._rawPrevTime=y,this._cycle=g,a.lazyTweens.push(this),this._lazy=t,void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/v):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==m&&t>=0&&(this._active=!0),0===d&&(2===this._initted&&t>0&&this._init(),this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===v)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._totalTime!==d||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_)),this._cycle!==g&&(e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||_)),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||_),0===v&&this._rawPrevTime===n&&c!==n&&(this._rawPrevTime=0))},r.to=function(t,e,i){return new r(t,e,i)},r.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new r(t,e,i)},r.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new r(t,e,s)},r.staggerTo=r.allTo=function(t,e,n,a,l,u,p){a=a||0;var c,f,m,d,g=n.delay||0,v=[],y=function(){n.onComplete&&n.onComplete.apply(n.onCompleteScope||this,arguments),l.apply(p||this,u||_)};for(h(t)||("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s(t))),c=t.length,m=0;c>m;m++){f={};for(d in n)f[d]=n[d];f.delay=g,m===c-1&&l&&(f.onComplete=y),v[m]=new r(t[m],e,f),g+=a}return v},r.staggerFrom=r.allFrom=function(t,e,i,s,n,a,o){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,r.staggerTo(t,e,i,s,n,a,o)},r.staggerFromTo=r.allFromTo=function(t,e,i,s,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,r.staggerTo(t,e,s,n,a,o,h)},r.delayedCall=function(t,e,i,s,n){return new r(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:n,overwrite:0})},r.set=function(t,e){return new r(t,0,e)},r.isTweening=function(t){return i.getTweensOf(t,!0).length>0};var u=function(t,e){for(var s=[],r=0,n=t._first;n;)n instanceof i?s[r++]=n:(e&&(s[r++]=n),s=s.concat(u(n,e)),r=s.length),n=n._next;return s},p=r.getAllTweens=function(e){return u(t._rootTimeline,e).concat(u(t._rootFramesTimeline,e))};r.killAll=function(t,i,s,r){null==i&&(i=!0),null==s&&(s=!0);var n,a,o,h=p(0!=r),l=h.length,_=i&&s&&r;for(o=0;l>o;o++)a=h[o],(_||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&(t?a.totalTime(a._reversed?0:a.totalDuration()):a._enabled(!1,!1))},r.killChildTweensOf=function(t,e){if(null!=t){var n,l,_,u,p,c=a.tweenLookup;if("string"==typeof t&&(t=i.selector(t)||t),o(t)&&(t=s(t)),h(t))for(u=t.length;--u>-1;)r.killChildTweensOf(t[u],e);else{n=[];for(_ in c)for(l=c[_].target.parentNode;l;)l===t&&(n=n.concat(c[_].tweens)),l=l.parentNode;for(p=n.length,u=0;p>u;u++)e&&n[u].totalTime(n[u].totalDuration()),n[u]._enabled(!1,!1)}}};var c=function(t,i,s,r){i=i!==!1,s=s!==!1,r=r!==!1;for(var n,a,o=p(r),h=i&&s&&r,l=o.length;--l>-1;)a=o[l],(h||a instanceof e||(n=a.target===a.vars.onComplete)&&s||i&&!n)&&a.paused(t)};return r.pauseAll=function(t,e,i){c(!0,t,e,i)},r.resumeAll=function(t,e,i){c(!1,t,e,i)},r.globalTimeScale=function(e){var s=t._rootTimeline,r=i.ticker.time;return arguments.length?(e=e||n,s._startTime=r-(r-s._startTime)*s._timeScale/e,s=t._rootFramesTimeline,r=i.ticker.frame,s._startTime=r-(r-s._startTime)*s._timeScale/e,s._timeScale=t._rootTimeline._timeScale=e,e):s._timeScale},l.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},l.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},l.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},l.duration=function(e){return arguments.length?t.prototype.duration.call(this,e):this._duration},l.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},l.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},l.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},l.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},r},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var s=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,s,r=this.vars;for(s in r)i=r[s],o(i)&&-1!==i.join("").indexOf("{self}")&&(r[s]=this._swapSelfInParams(i));o(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,n=i._internals,a=n.isSelector,o=n.isArray,h=n.lazyTweens,l=n.lazyRender,_=[],u=_gsScope._gsDefine.globals,p=function(t){var e,i={};for(e in t)i[e]=t[e];return i},c=function(t,e,i,s){t._timeline.pause(t._startTime),e&&e.apply(s||t._timeline,i||_)},f=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},m=s.prototype=new e;return s.version="1.13.1",m.constructor=s,m.kill()._gc=!1,m.to=function(t,e,s,r){var n=s.repeat&&u.TweenMax||i;return e?this.add(new n(t,e,s),r):this.set(t,s,r)},m.from=function(t,e,s,r){return this.add((s.repeat&&u.TweenMax||i).from(t,e,s),r)},m.fromTo=function(t,e,s,r,n){var a=r.repeat&&u.TweenMax||i;return e?this.add(a.fromTo(t,e,s,r),n):this.set(t,r,n)},m.staggerTo=function(t,e,r,n,o,h,l,_){var u,c=new s({onComplete:h,onCompleteParams:l,onCompleteScope:_,smoothChildTiming:this.smoothChildTiming});for("string"==typeof t&&(t=i.selector(t)||t),a(t)&&(t=f(t)),n=n||0,u=0;t.length>u;u++)r.startAt&&(r.startAt=p(r.startAt)),c.to(t[u],e,p(r),u*n);return this.add(c,o)},m.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},m.staggerFromTo=function(t,e,i,s,r,n,a,o,h){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,h)},m.call=function(t,e,s,r){return this.add(i.delayedCall(0,t,e,s),r)},m.set=function(t,e,s){return s=this._parseTimeOrLabel(s,0,!0),null==e.immediateRender&&(e.immediateRender=s===this._time&&!this._paused),this.add(new i(t,0,e),s)},s.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,n,a=new s(t),o=a._timeline;for(null==e&&(e=!0),o._remove(a,!0),a._startTime=0,a._rawPrevTime=a._time=a._totalTime=o._time,r=o._first;r;)n=r._next,e&&r instanceof i&&r.target===r.vars.onComplete||a.add(r,r._startTime-r._delay),r=n;return o.add(a,0),a},m.add=function(r,n,a,h){var l,_,u,p,c,f;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&o(r)){for(a=a||"normal",h=h||0,l=n,_=r.length,u=0;_>u;u++)o(p=r[u])&&(p=new s({tweens:p})),this.add(p,l),"string"!=typeof p&&"function"!=typeof p&&("sequence"===a?l=p._startTime+p.totalDuration()/p._timeScale:"start"===a&&(p._startTime-=p.delay())),l+=h;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,n);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,n),(this._gc||this._time===this._duration)&&!this._paused&&this._durationr._startTime;c._timeline;)f&&c._timeline.smoothChildTiming?c.totalTime(c._totalTime,!0):c._gc&&c._enabled(!0,!1),c=c._timeline;return this},m.remove=function(e){if(e instanceof t)return this._remove(e,!1);if(e instanceof Array||e&&e.push&&o(e)){for(var i=e.length;--i>-1;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},m._remove=function(t,i){e.prototype._remove.call(this,t,i);var s=this._last;return s?this._time>s._startTime+s._totalDuration/s._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},m.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},m.insert=m.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},m.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},m.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},m.addPause=function(t,e,i,s){return this.call(c,["{self}",e,i,s],this,t)},m.removeLabel=function(t){return delete this._labels[t],this},m.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},m._parseTimeOrLabel=function(e,i,s,r){var n;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&o(r)))for(n=r.length;--n>-1;)r[n]instanceof t&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof i)return this._parseTimeOrLabel(i,s&&"number"==typeof e&&null==this._labels[i]?e-this.duration():0,s);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=this.duration());else{if(n=e.indexOf("="),-1===n)return null==this._labels[e]?s?this._labels[e]=this.duration()+i:i:this._labels[e]+i;i=parseInt(e.charAt(n-1)+"1",10)*Number(e.substr(n+1)),e=n>1?this._parseTimeOrLabel(e.substr(0,n-1),0,s):this.duration()}return Number(e)+i},m.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},m.stop=function(){return this.paused(!0)},m.gotoAndPlay=function(t,e){return this.play(t,e)},m.gotoAndStop=function(t,e){return this.pause(t,e)},m.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,n,a,o,u,p=this._dirty?this.totalDuration():this._totalDuration,c=this._time,f=this._startTime,m=this._timeScale,d=this._paused;if(t>=p?(this._totalTime=this._time=p,this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",0===this._duration&&(0===t||0>this._rawPrevTime||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(u=!0,this._rawPrevTime>r&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=p+1e-4):1e-7>t?(this._totalTime=this._time=0,(0!==c||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(o="onReverseComplete",n=this._reversed),0>t?(this._active=!1,this._rawPrevTime>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):this._totalTime=this._time=this._rawPrevTime=t,this._time!==c&&this._first||i||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==c&&t>0&&(this._active=!0),0===c&&this.vars.onStart&&0!==this._time&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||_)),this._time>=c)for(s=this._first;s&&(a=s._next,!this._paused||d);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;else for(s=this._last;s&&(a=s._prev,!this._paused||d);)(s._active||c>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=a;this._onUpdate&&(e||(h.length&&l(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||_))),o&&(this._gc||(f===this._startTime||m!==this._timeScale)&&(0===this._time||p>=this.totalDuration())&&(n&&(h.length&&l(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this.vars[o].apply(this.vars[o+"Scope"]||this,this.vars[o+"Params"]||_)))}},m._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof s&&t._hasPausedChild())return!0;t=t._next}return!1},m.getChildren=function(t,e,s,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)r>a._startTime||(a instanceof i?e!==!1&&(n[o++]=a):(s!==!1&&(n[o++]=a),t!==!1&&(n=n.concat(a.getChildren(!0,e,s)),o=n.length))),a=a._next;return n},m.getTweensOf=function(t,e){var s,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),s=i.getTweensOf(t),r=s.length;--r>-1;)(s[r].timeline===this||e&&this._contains(s[r]))&&(a[o++]=s[r]);return n&&this._enabled(!1,!0),a},m._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},m.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},m._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;--s>-1;)i[s]._kill(t,e)&&(r=!0);return r},m.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},m.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return this},m._enabled=function(t,i){if(t===this._gc)for(var s=this._first;s;)s._enabled(t,!0),s=s._next;return e.prototype._enabled.call(this,t,i)},m.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},m.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,0>r._startTime&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),i=r._startTime+r._totalDuration/r._timeScale,i>s&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},m.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},m.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},s},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(t,e,i){var s=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,n=[],a=e._internals,o=a.lazyTweens,h=a.lazyRender,l=new i(null,null,1,0),_=s.prototype=new t;return _.constructor=s,_.kill()._gc=!1,s.version="1.13.1",_.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},_.addCallback=function(t,i,s,r){return this.add(e.delayedCall(0,t,s,r),i)},_.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),s=i.length,r=this._parseTimeOrLabel(e);--s>-1;)i[s]._startTime===r&&i[s]._enabled(!1,!1);return this},_.tweenTo=function(t,i){i=i||{};var s,r,a,o={ease:l,overwrite:i.delay?2:1,useFrames:this.usesFrames(),immediateRender:!1};for(r in i)o[r]=i[r];return o.time=this._parseTimeOrLabel(t),s=Math.abs(Number(o.time)-this._time)/this._timeScale||.001,a=new e(this,s,o),o.onStart=function(){a.target.paused(!0),a.vars.time!==a.target.time()&&s===a.duration()&&a.duration(Math.abs(a.vars.time-a.target.time())/a.target._timeScale),i.onStart&&i.onStart.apply(i.onStartScope||a,i.onStartParams||n)},a},_.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],onCompleteScope:this},i.immediateRender=i.immediateRender!==!1;var s=this.tweenTo(e,i);return s.duration(Math.abs(s.vars.time-t)/this._timeScale||.001)},_.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,a,l,_,u,p,c=this._dirty?this.totalDuration():this._totalDuration,f=this._duration,m=this._time,d=this._totalTime,g=this._startTime,v=this._timeScale,y=this._rawPrevTime,T=this._paused,w=this._cycle;if(t>=c?(this._locked||(this._totalTime=c,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(a=!0,_="onComplete",0===this._duration&&(0===t||0>y||y===r)&&y!==t&&this._first&&(u=!0,y>r&&(_="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=f,t=f+1e-4)):1e-7>t?(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==m||0===f&&y!==r&&(y>0||0>t&&y>=0)&&!this._locked)&&(_="onReverseComplete",a=this._reversed),0>t?(this._active=!1,y>=0&&this._first&&(u=!0),this._rawPrevTime=t):(this._rawPrevTime=f||!e||t||this._rawPrevTime===t?t:r,t=0,this._initted||(u=!0))):(0===f&&0>y&&(u=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(p=f+this._repeatDelay,this._cycle=this._totalTime/p>>0,0!==this._cycle&&this._cycle===this._totalTime/p&&this._cycle--,this._time=this._totalTime-this._cycle*p,this._yoyo&&0!==(1&this._cycle)&&(this._time=f-this._time),this._time>f?(this._time=f,t=f+1e-4):0>this._time?this._time=t=0:t=this._time))),this._cycle!==w&&!this._locked){var x=this._yoyo&&0!==(1&w),b=x===(this._yoyo&&0!==(1&this._cycle)),P=this._totalTime,S=this._cycle,k=this._rawPrevTime,R=this._time;if(this._totalTime=w*f,w>this._cycle?x=!x:this._totalTime+=f,this._time=m,this._rawPrevTime=0===f?y-1e-4:y,this._cycle=w,this._locked=!0,m=x?0:f,this.render(m,e,0===f),e||this._gc||this.vars.onRepeat&&this.vars.onRepeat.apply(this.vars.onRepeatScope||this,this.vars.onRepeatParams||n),b&&(m=x?f+1e-4:-1e-4,this.render(m,!0,!1)),this._locked=!1,this._paused&&!T)return;this._time=R,this._totalTime=P,this._cycle=S,this._rawPrevTime=k}if(!(this._time!==m&&this._first||i||u))return d!==this._totalTime&&this._onUpdate&&(e||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n)),void 0;if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==d&&t>0&&(this._active=!0),0===d&&this.vars.onStart&&0!==this._totalTime&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||n)),this._time>=m)for(s=this._first;s&&(l=s._next,!this._paused||T);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=l;else for(s=this._last;s&&(l=s._prev,!this._paused||T);)(s._active||m>=s._startTime&&!s._paused&&!s._gc)&&(s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=l;this._onUpdate&&(e||(o.length&&h(),this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||n))),_&&(this._locked||this._gc||(g===this._startTime||v!==this._timeScale)&&(0===this._time||c>=this.totalDuration())&&(a&&(o.length&&h(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[_]&&this.vars[_].apply(this.vars[_+"Scope"]||this,this.vars[_+"Params"]||n)))},_.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getChildren(t,e,i),o=0,h=a.length;for(s=0;h>s;s++)r=a[s],r.isActive()&&(n[o++]=r);return n},_.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),s=i.length;for(e=0;s>e;e++)if(i[e].time>t)return i[e].name;return null},_.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;--i>-1;)if(t>e[i].time)return e[i].name;return null},_.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},_.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},_.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},_.totalDuration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(t.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},_.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},_.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},_.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},_.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},_.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},s},!0),function(){var t=180/Math.PI,e=[],i=[],s=[],r={},n=function(t,e,i,s){this.a=t,this.b=e,this.c=i,this.d=s,this.da=s-t,this.ca=i-t,this.ba=e-t},a=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",o=function(t,e,i,s){var r={a:t},n={},a={},o={c:s},h=(t+e)/2,l=(e+i)/2,_=(i+s)/2,u=(h+l)/2,p=(l+_)/2,c=(p-u)/8;return r.b=h+(t-h)/4,n.b=u+c,r.c=n.a=(r.b+n.b)/2,n.c=a.a=(u+p)/2,a.b=p-c,o.b=_+(s-_)/4,a.c=o.a=(a.b+o.b)/2,[r,n,a,o]},h=function(t,r,n,a,h){var l,_,u,p,c,f,m,d,g,v,y,T,w,x=t.length-1,b=0,P=t[0].a;for(l=0;x>l;l++)c=t[b],_=c.a,u=c.d,p=t[b+1].d,h?(y=e[l],T=i[l],w=.25*(T+y)*r/(a?.5:s[l]||.5),f=u-(u-_)*(a?.5*r:0!==y?w/y:0),m=u+(p-u)*(a?.5*r:0!==T?w/T:0),d=u-(f+((m-f)*(3*y/(y+T)+.5)/4||0))):(f=u-.5*(u-_)*r,m=u+.5*(p-u)*r,d=u-(f+m)/2),f+=d,m+=d,c.c=g=f,c.b=0!==l?P:P=c.a+.6*(c.c-c.a),c.da=u-_,c.ca=g-_,c.ba=P-_,n?(v=o(_,P,g,u),t.splice(b,1,v[0],v[1],v[2],v[3]),b+=4):b++,P=m;c=t[b],c.b=P,c.c=P+.4*(c.d-P),c.da=c.d-c.a,c.ca=c.c-c.a,c.ba=P-c.a,n&&(v=o(c.a,P,c.c,c.d),t.splice(b,1,v[0],v[1],v[2],v[3]))},l=function(t,s,r,a){var o,h,l,_,u,p,c=[];if(a)for(t=[a].concat(t),h=t.length;--h>-1;)"string"==typeof(p=t[h][s])&&"="===p.charAt(1)&&(t[h][s]=a[s]+Number(p.charAt(0)+p.substr(2)));if(o=t.length-2,0>o)return c[0]=new n(t[0][s],0,0,t[-1>o?0:1][s]),c;for(h=0;o>h;h++)l=t[h][s],_=t[h+1][s],c[h]=new n(l,0,0,_),r&&(u=t[h+2][s],e[h]=(e[h]||0)+(_-l)*(_-l),i[h]=(i[h]||0)+(u-_)*(u-_));return c[h]=new n(t[h][s],0,0,t[h+1][s]),c},_=function(t,n,o,_,u,p){var c,f,m,d,g,v,y,T,w={},x=[],b=p||t[0];u="string"==typeof u?","+u+",":a,null==n&&(n=1);for(f in t[0])x.push(f);if(t.length>1){for(T=t[t.length-1],y=!0,c=x.length;--c>-1;)if(f=x[c],Math.abs(b[f]-T[f])>.05){y=!1;break}y&&(t=t.concat(),p&&t.unshift(p),t.push(t[1]),p=t[t.length-3])}for(e.length=i.length=s.length=0,c=x.length;--c>-1;)f=x[c],r[f]=-1!==u.indexOf(","+f+","),w[f]=l(t,f,r[f],p);for(c=e.length;--c>-1;)e[c]=Math.sqrt(e[c]),i[c]=Math.sqrt(i[c]);if(!_){for(c=x.length;--c>-1;)if(r[f])for(m=w[x[c]],v=m.length-1,d=0;v>d;d++)g=m[d+1].da/i[d]+m[d].da/e[d],s[d]=(s[d]||0)+g*g;for(c=s.length;--c>-1;)s[c]=Math.sqrt(s[c])}for(c=x.length,d=o?4:1;--c>-1;)f=x[c],m=w[f],h(m,n,o,_,r[f]),y&&(m.splice(0,d),m.splice(m.length-d,d));return w},u=function(t,e,i){e=e||"soft";var s,r,a,o,h,l,_,u,p,c,f,m={},d="cubic"===e?3:2,g="soft"===e,v=[];if(g&&i&&(t=[i].concat(t)),null==t||d+1>t.length)throw"invalid Bezier data";for(p in t[0])v.push(p);for(l=v.length;--l>-1;){for(p=v[l],m[p]=h=[],c=0,u=t.length,_=0;u>_;_++)s=null==i?t[_][p]:"string"==typeof(f=t[_][p])&&"="===f.charAt(1)?i[p]+Number(f.charAt(0)+f.substr(2)):Number(f),g&&_>1&&u-1>_&&(h[c++]=(s+h[c-2])/2),h[c++]=s;for(u=c-d+1,c=0,_=0;u>_;_+=d)s=h[_],r=h[_+1],a=h[_+2],o=2===d?0:h[_+3],h[c++]=f=3===d?new n(s,r,a,o):new n(s,(2*r+s)/3,(2*r+a)/3,a);h.length=c}return m},p=function(t,e,i){for(var s,r,n,a,o,h,l,_,u,p,c,f=1/i,m=t.length;--m>-1;)for(p=t[m],n=p.a,a=p.d-n,o=p.c-n,h=p.b-n,s=r=0,_=1;i>=_;_++)l=f*_,u=1-l,s=r-(r=(l*l*a+3*u*(l*o+u*h))*l),c=m*i+_-1,e[c]=(e[c]||0)+s*s},c=function(t,e){e=e>>0||6;var i,s,r,n,a=[],o=[],h=0,l=0,_=e-1,u=[],c=[];for(i in t)p(t[i],a,e);for(r=a.length,s=0;r>s;s++)h+=Math.sqrt(a[s]),n=s%e,c[n]=h,n===_&&(l+=h,n=s/e>>0,u[n]=c,o[n]=l,h=0,c=[]);return{length:l,lengths:o,segments:u}},f=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.3",API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var s,r,n,a,o,h=e.values||[],l={},p=h[0],f=e.autoRotate||i.vars.orientToBezier;this._autoRotate=f?f instanceof Array?f:[["x","y","rotation",f===!0?0:Number(f)||0]]:null;for(s in p)this._props.push(s);for(n=this._props.length;--n>-1;)s=this._props[n],this._overwriteProps.push(s),r=this._func[s]="function"==typeof t[s],l[s]=r?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]():parseFloat(t[s]),o||l[s]!==h[0][s]&&(o=l);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?_(h,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,o):u(h,e.type,l),this._segCount=this._beziers[s].length,this._timeRes){var m=c(this._beziers,this._timeRes);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(f=this._autoRotate)for(this._initialRotations=[],f[0]instanceof Array||(this._autoRotate=f=[f]),n=f.length;--n>-1;){for(a=0;3>a;a++)s=f[n][a],this._func[s]="function"==typeof t[s]?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]:!1;s=f[n][2],this._initialRotations[n]=this._func[s]?this._func[s].call(this._target):this._target[s]}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(e){var i,s,r,n,a,o,h,l,_,u,p=this._segCount,c=this._func,f=this._target,m=e!==this._startRatio;if(this._timeRes){if(_=this._lengths,u=this._curSeg,e*=this._length,r=this._li,e>this._l2&&p-1>r){for(l=p-1;l>r&&e>=(this._l2=_[++r]););this._l1=_[r-1],this._li=r,this._curSeg=u=this._segments[r],this._s2=u[this._s1=this._si=0]}else if(this._l1>e&&r>0){for(;r>0&&(this._l1=_[--r])>=e;);0===r&&this._l1>e?this._l1=0:r++,this._l2=_[r],this._li=r,this._curSeg=u=this._segments[r],this._s1=u[(this._si=u.length-1)-1]||0,this._s2=u[this._si]}if(i=r,e-=this._l1,r=this._si,e>this._s2&&u.length-1>r){for(l=u.length-1;l>r&&e>=(this._s2=u[++r]););this._s1=u[r-1],this._si=r}else if(this._s1>e&&r>0){for(;r>0&&(this._s1=u[--r])>=e;);0===r&&this._s1>e?this._s1=0:r++,this._s2=u[r],this._si=r}o=(r+(e-this._s1)/(this._s2-this._s1))*this._prec}else i=0>e?0:e>=1?p-1:p*e>>0,o=(e-i*(1/p))*p;for(s=1-o,r=this._props.length;--r>-1;)n=this._props[r],a=this._beziers[n][i],h=(o*o*a.da+3*s*(o*a.ca+s*a.ba))*o+a.a,this._round[n]&&(h=Math.round(h)),c[n]?f[n](h):f[n]=h;if(this._autoRotate){var d,g,v,y,T,w,x,b=this._autoRotate; +for(r=b.length;--r>-1;)n=b[r][2],w=b[r][3]||0,x=b[r][4]===!0?1:t,a=this._beziers[b[r][0]],d=this._beziers[b[r][1]],a&&d&&(a=a[i],d=d[i],g=a.a+(a.b-a.a)*o,y=a.b+(a.c-a.b)*o,g+=(y-g)*o,y+=(a.c+(a.d-a.c)*o-y)*o,v=d.a+(d.b-d.a)*o,T=d.b+(d.c-d.b)*o,v+=(T-v)*o,T+=(d.c+(d.d-d.c)*o-T)*o,h=m?Math.atan2(T-v,y-g)*x+w:this._initialRotations[r],c[n]?f[n](h):f[n]=h)}}}),m=f.prototype;f.bezierThrough=_,f.cubicToQuadratic=o,f._autoCSS=!0,f.quadraticToCubic=function(t,e,i){return new n(t,(2*e+t)/3,(2*e+i)/3,i)},f._cssRegister=function(){var t=_gsScope._gsDefine.globals.CSSPlugin;if(t){var e=t._internals,i=e._parseToProxy,s=e._setPluginRatio,r=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,n,a,o,h){e instanceof Array&&(e={values:e}),h=new f;var l,_,u,p=e.values,c=p.length-1,m=[],d={};if(0>c)return o;for(l=0;c>=l;l++)u=i(t,p[l],a,o,h,c!==l),m[l]=u.end;for(_ in e)d[_]=e[_];return d.values=m,o=new r(t,"bezier",0,0,u.pt,2),o.data=u,o.plugin=h,o.setRatio=s,0===d.autoRotate&&(d.autoRotate=!0),!d.autoRotate||d.autoRotate instanceof Array||(l=d.autoRotate===!0?0:Number(d.autoRotate),d.autoRotate=null!=u.end.left?[["left","top","rotation",l,!1]]:null!=u.end.x?[["x","y","rotation",l,!1]]:!1),d.autoRotate&&(a._transform||a._enableTransforms(!1),u.autoRotate=a._target._gsTransform),h._onInitTween(u.proxy,d,a._tween),o}})}},m._roundProps=function(t,e){for(var i=this._overwriteProps,s=i.length;--s>-1;)(t[i[s]]||t.bezier||t.bezierThrough)&&(this._round[i[s]]=e)},m._kill=function(t){var e,i,s=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=s.length;--i>-1;)s[i]===e&&s.splice(i,1);return this._super._kill.call(this,t)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(t,e){var i,s,r,n,a=function(){t.call(this,"css"),this._overwriteProps.length=0,this.setRatio=a.prototype.setRatio},o={},h=a.prototype=new t("css");h.constructor=a,a.version="1.13.1",a.API=2,a.defaultTransformPerspective=0,a.defaultSkewType="compensated",h="px",a.suffixMap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontSize:h,padding:h,margin:h,perspective:h,lineHeight:""};var l,_,u,p,c,f,m=/(?:\d|\-\d|\.\d|\-\.\d)+/g,d=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,g=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/[^\d\-\.]/g,y=/(?:\d|\-|\+|=|#|\.)*/g,T=/opacity *= *([^)]*)/i,w=/opacity:([^;]*)/i,x=/alpha\(opacity *=.+?\)/i,b=/^(rgb|hsl)/,P=/([A-Z])/g,S=/-([a-z])/gi,k=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,R=function(t,e){return e.toUpperCase()},A=/(?:Left|Right|Width)/i,C=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,O=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,D=/,(?=[^\)]*(?:\(|$))/gi,M=Math.PI/180,z=180/Math.PI,I={},E=document,L=E.createElement("div"),F=E.createElement("img"),N=a._internals={_specialProps:o},X=navigator.userAgent,U=function(){var t,e=X.indexOf("Android"),i=E.createElement("div");return u=-1!==X.indexOf("Safari")&&-1===X.indexOf("Chrome")&&(-1===e||Number(X.substr(e+8,1))>3),c=u&&6>Number(X.substr(X.indexOf("Version/")+8,1)),p=-1!==X.indexOf("Firefox"),/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(X)&&(f=parseFloat(RegExp.$1)),i.innerHTML="a",t=i.getElementsByTagName("a")[0],t?/^0.55/.test(t.style.opacity):!1}(),Y=function(t){return T.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},j=function(t){window.console&&console.log(t)},B="",q="",V=function(t,e){e=e||L;var i,s,r=e.style;if(void 0!==r[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],s=5;--s>-1&&void 0===r[i[s]+t];);return s>=0?(q=3===s?"ms":i[s],B="-"+q.toLowerCase()+"-",q+t):null},G=E.defaultView?E.defaultView.getComputedStyle:function(){},W=a.getStyle=function(t,e,i,s,r){var n;return U||"opacity"!==e?(!s&&t.style[e]?n=t.style[e]:(i=i||G(t))?n=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(P,"-$1").toLowerCase()):t.currentStyle&&(n=t.currentStyle[e]),null==r||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:r):Y(t)},Q=N.convertToPixels=function(t,i,s,r,n){if("px"===r||!r)return s;if("auto"===r||!s)return 0;var o,h,l,_=A.test(i),u=t,p=L.style,c=0>s;if(c&&(s=-s),"%"===r&&-1!==i.indexOf("border"))o=s/100*(_?t.clientWidth:t.clientHeight);else{if(p.cssText="border:0 solid red;position:"+W(t,"position")+";line-height:0;","%"!==r&&u.appendChild)p[_?"borderLeftWidth":"borderTopWidth"]=s+r;else{if(u=t.parentNode||E.body,h=u._gsCache,l=e.ticker.frame,h&&_&&h.time===l)return h.width*s/100;p[_?"width":"height"]=s+r}u.appendChild(L),o=parseFloat(L[_?"offsetWidth":"offsetHeight"]),u.removeChild(L),_&&"%"===r&&a.cacheWidths!==!1&&(h=u._gsCache=u._gsCache||{},h.time=l,h.width=100*(o/s)),0!==o||n||(o=Q(t,i,s,r,!0))}return c?-o:o},Z=N.calculateOffset=function(t,e,i){if("absolute"!==W(t,"position",i))return 0;var s="left"===e?"Left":"Top",r=W(t,"margin"+s,i);return t["offset"+s]-(Q(t,e,parseFloat(r),r.replace(y,""))||0)},$=function(t,e){var i,s,r={};if(e=e||G(t,null))if(i=e.length)for(;--i>-1;)r[e[i].replace(S,R)]=e.getPropertyValue(e[i]);else for(i in e)r[i]=e[i];else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===r[i]&&(r[i.replace(S,R)]=e[i]);return U||(r.opacity=Y(t)),s=Pe(t,e,!1),r.rotation=s.rotation,r.skewX=s.skewX,r.scaleX=s.scaleX,r.scaleY=s.scaleY,r.x=s.x,r.y=s.y,xe&&(r.z=s.z,r.rotationX=s.rotationX,r.rotationY=s.rotationY,r.scaleZ=s.scaleZ),r.filters&&delete r.filters,r},H=function(t,e,i,s,r){var n,a,o,h={},l=t.style;for(a in i)"cssText"!==a&&"length"!==a&&isNaN(a)&&(e[a]!==(n=i[a])||r&&r[a])&&-1===a.indexOf("Origin")&&("number"==typeof n||"string"==typeof n)&&(h[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(v,"")?n:0:Z(t,a),void 0!==l[a]&&(o=new ue(l,a,l[a],o)));if(s)for(a in s)"className"!==a&&(h[a]=s[a]);return{difs:h,firstMPT:o}},K={width:["Left","Right"],height:["Top","Bottom"]},J=["marginLeft","marginRight","marginTop","marginBottom"],te=function(t,e,i){var s=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),r=K[e],n=r.length;for(i=i||G(t,null);--n>-1;)s-=parseFloat(W(t,"padding"+r[n],i,!0))||0,s-=parseFloat(W(t,"border"+r[n]+"Width",i,!0))||0;return s},ee=function(t,e){(null==t||""===t||"auto"===t||"auto auto"===t)&&(t="0 0");var i=t.split(" "),s=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],r=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==r?r="0":"center"===r&&(r="50%"),("center"===s||isNaN(parseFloat(s))&&-1===(s+"").indexOf("="))&&(s="50%"),e&&(e.oxp=-1!==s.indexOf("%"),e.oyp=-1!==r.indexOf("%"),e.oxr="="===s.charAt(1),e.oyr="="===r.charAt(1),e.ox=parseFloat(s.replace(v,"")),e.oy=parseFloat(r.replace(v,""))),s+" "+r+(i.length>2?" "+i[2]:"")},ie=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},se=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*Number(t.substr(2))+e:parseFloat(t)},re=function(t,e,i,s){var r,n,a,o,h=1e-6;return null==t?o=e:"number"==typeof t?o=t:(r=360,n=t.split("_"),a=Number(n[0].replace(v,""))*(-1===t.indexOf("rad")?1:z)-("="===t.charAt(1)?0:e),n.length&&(s&&(s[i]=e+a),-1!==t.indexOf("short")&&(a%=r,a!==a%(r/2)&&(a=0>a?a+r:a-r)),-1!==t.indexOf("_cw")&&0>a?a=(a+9999999999*r)%r-(0|a/r)*r:-1!==t.indexOf("ccw")&&a>0&&(a=(a-9999999999*r)%r-(0|a/r)*r)),o=e+a),h>o&&o>-h&&(o=0),o},ne={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ae=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,0|255*(1>6*t?e+6*(i-e)*t:.5>t?i:2>3*t?e+6*(i-e)*(2/3-t):e)+.5},oe=function(t){var e,i,s,r,n,a;return t&&""!==t?"number"==typeof t?[t>>16,255&t>>8,255&t]:(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),ne[t]?ne[t]:"#"===t.charAt(0)?(4===t.length&&(e=t.charAt(1),i=t.charAt(2),s=t.charAt(3),t="#"+e+e+i+i+s+s),t=parseInt(t.substr(1),16),[t>>16,255&t>>8,255&t]):"hsl"===t.substr(0,3)?(t=t.match(m),r=Number(t[0])%360/360,n=Number(t[1])/100,a=Number(t[2])/100,i=.5>=a?a*(n+1):a+n-a*n,e=2*a-i,t.length>3&&(t[3]=Number(t[3])),t[0]=ae(r+1/3,e,i),t[1]=ae(r,e,i),t[2]=ae(r-1/3,e,i),t):(t=t.match(m)||ne.transparent,t[0]=Number(t[0]),t[1]=Number(t[1]),t[2]=Number(t[2]),t.length>3&&(t[3]=Number(t[3])),t)):ne.black},he="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(h in ne)he+="|"+h+"\\b";he=RegExp(he+")","gi");var le=function(t,e,i,s){if(null==t)return function(t){return t};var r,n=e?(t.match(he)||[""])[0]:"",a=t.split(n).join("").match(g)||[],o=t.substr(0,t.indexOf(a[0])),h=")"===t.charAt(t.length-1)?")":"",l=-1!==t.indexOf(" ")?" ":",",_=a.length,u=_>0?a[0].replace(m,""):"";return _?r=e?function(t){var e,p,c,f;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(f=t.replace(D,"|").split("|"),c=0;f.length>c;c++)f[c]=r(f[c]);return f.join(",")}if(e=(t.match(he)||[n])[0],p=t.split(e).join("").match(g)||[],c=p.length,_>c--)for(;_>++c;)p[c]=i?p[0|(c-1)/2]:a[c];return o+p.join(l)+l+e+h+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,n,p;if("number"==typeof t)t+=u;else if(s&&D.test(t)){for(n=t.replace(D,"|").split("|"),p=0;n.length>p;p++)n[p]=r(n[p]);return n.join(",")}if(e=t.match(g)||[],p=e.length,_>p--)for(;_>++p;)e[p]=i?e[0|(p-1)/2]:a[p];return o+e.join(l)+h}:function(t){return t}},_e=function(t){return t=t.split(","),function(e,i,s,r,n,a,o){var h,l=(i+"").split(" ");for(o={},h=0;4>h;h++)o[t[h]]=l[h]=l[h]||l[(h-1)/2>>0];return r.parse(e,o,n,a)}},ue=(N._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,s,r,n=this.data,a=n.proxy,o=n.firstMPT,h=1e-6;o;)e=a[o.v],o.r?e=Math.round(e):h>e&&e>-h&&(e=0),o.t[o.p]=e,o=o._next;if(n.autoRotate&&(n.autoRotate.rotation=a.rotation),1===t)for(o=n.firstMPT;o;){if(i=o.t,i.type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,s=1;i.l>s;s++)r+=i["xn"+s]+i["xs"+(s+1)];i.e=r}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,s,r){this.t=t,this.p=e,this.v=i,this.r=r,s&&(s._prev=this,this._next=s)}),pe=(N._parseToProxy=function(t,e,i,s,r,n){var a,o,h,l,_,u=s,p={},c={},f=i._transform,m=I;for(i._transform=null,I=e,s=_=i.parse(t,e,s,r),I=m,n&&(i._transform=f,u&&(u._prev=null,u._prev&&(u._prev._next=null)));s&&s!==u;){if(1>=s.type&&(o=s.p,c[o]=s.s+s.c,p[o]=s.s,n||(l=new ue(s,"s",o,l,s.r),s.c=0),1===s.type))for(a=s.l;--a>0;)h="xn"+a,o=s.p+"_"+h,c[o]=s.data[h],p[o]=s[h],n||(l=new ue(s,h,o,l,s.rxp[h]));s=s._next}return{proxy:p,end:c,firstMPT:l,pt:_}},N.CSSPropTween=function(t,e,s,r,a,o,h,l,_,u,p){this.t=t,this.p=e,this.s=s,this.c=r,this.n=h||e,t instanceof pe||n.push(this.n),this.r=l,this.type=o||0,_&&(this.pr=_,i=!0),this.b=void 0===u?s:u,this.e=void 0===p?s+r:p,a&&(this._next=a,a._prev=this)}),ce=a.parseComplex=function(t,e,i,s,r,n,a,o,h,_){i=i||n||"",a=new pe(t,e,0,0,a,_?2:1,null,!1,o,i,s),s+="";var u,p,c,f,g,v,y,T,w,x,P,S,k=i.split(", ").join(",").split(" "),R=s.split(", ").join(",").split(" "),A=k.length,C=l!==!1;for((-1!==s.indexOf(",")||-1!==i.indexOf(","))&&(k=k.join(" ").replace(D,", ").split(" "),R=R.join(" ").replace(D,", ").split(" "),A=k.length),A!==R.length&&(k=(n||"").split(" "),A=k.length),a.plugin=h,a.setRatio=_,u=0;A>u;u++)if(f=k[u],g=R[u],T=parseFloat(f),T||0===T)a.appendXtra("",T,ie(g,T),g.replace(d,""),C&&-1!==g.indexOf("px"),!0);else if(r&&("#"===f.charAt(0)||ne[f]||b.test(f)))S=","===g.charAt(g.length-1)?"),":")",f=oe(f),g=oe(g),w=f.length+g.length>6,w&&!U&&0===g[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(R[u]).join("transparent")):(U||(w=!1),a.appendXtra(w?"rgba(":"rgb(",f[0],g[0]-f[0],",",!0,!0).appendXtra("",f[1],g[1]-f[1],",",!0).appendXtra("",f[2],g[2]-f[2],w?",":S,!0),w&&(f=4>f.length?1:f[3],a.appendXtra("",f,(4>g.length?1:g[3])-f,S,!1)));else if(v=f.match(m)){if(y=g.match(d),!y||y.length!==v.length)return a;for(c=0,p=0;v.length>p;p++)P=v[p],x=f.indexOf(P,c),a.appendXtra(f.substr(c,x-c),Number(P),ie(y[p],P),"",C&&"px"===f.substr(x+P.length,2),0===p),c=x+P.length;a["xs"+a.l]+=f.substr(c)}else a["xs"+a.l]+=a.l?" "+f:f;if(-1!==s.indexOf("=")&&a.data){for(S=a.xs0+a.data.s,u=1;a.l>u;u++)S+=a["xs"+u]+a.data["xn"+u];a.e=S+a["xs"+u]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},fe=9;for(h=pe.prototype,h.l=h.pr=0;--fe>0;)h["xn"+fe]=0,h["xs"+fe]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setRatio=h.rxp=null,h.appendXtra=function(t,e,i,s,r,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setRatio?2:1,a["xs"+a.l]=s||"",o>0?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=r,a["xn"+o]=e,a.plugin||(a.xfirst=new pe(a,"xn"+o,e,i,a.xfirst||a,0,a.n,r,a.pr),a.xfirst.xs0=0),a):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=r,a)):(a["xs"+o]+=e+(s||""),a)};var me=function(t,e){e=e||{},this.p=e.prefix?V(t)||t:t,o[t]=o[this.p]=this,this.format=e.formatter||le(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},de=N._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var s,r,n=t.split(","),a=e.defaultValue;for(i=i||[a],s=0;n.length>s;s++)e.prefix=0===s&&e.prefix,e.defaultValue=i[s]||a,r=new me(n[s],e)},ge=function(t){if(!o[t]){var e=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";de(t,{parser:function(t,i,s,r,n,a,h){var l=(_gsScope.GreenSockGlobals||_gsScope).com.greensock.plugins[e];return l?(l._cssRegister(),o[s].parse(t,i,s,r,n,a,h)):(j("Error: "+e+" js file not loaded."),n)}})}};h=me.prototype,h.parseComplex=function(t,e,i,s,r,n){var a,o,h,l,_,u,p=this.keyword;if(this.multi&&(D.test(i)||D.test(e)?(o=e.replace(D,"|").split("|"),h=i.replace(D,"|").split("|")):p&&(o=[e],h=[i])),h){for(l=h.length>o.length?h.length:o.length,a=0;l>a;a++)e=o[a]=o[a]||this.dflt,i=h[a]=h[a]||this.dflt,p&&(_=e.indexOf(p),u=i.indexOf(p),_!==u&&(i=-1===u?h:o,i[a]+=" "+p));e=o.join(", "),i=h.join(", ")}return ce(t,this.p,e,i,this.clrs,this.dflt,s,this.pr,r,n)},h.parse=function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(W(t,this.p,r,!1,this.dflt)),this.format(e),n,a)},a.registerSpecialProp=function(t,e,i){de(t,{parser:function(t,s,r,n,a,o){var h=new pe(t,r,0,0,a,2,r,!1,i);return h.plugin=o,h.setRatio=e(t,s,n._tween,r),h},priority:i})};var ve="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),ye=V("transform"),Te=B+"transform",we=V("transformOrigin"),xe=null!==V("perspective"),be=N.Transform=function(){this.skewY=0},Pe=N.getTransform=function(t,e,i,s){if(t._gsTransform&&i&&!s)return t._gsTransform;var r,n,o,h,l,_,u,p,c,f,m,d,g,v=i?t._gsTransform||new be:new be,y=0>v.scaleX,T=2e-5,w=1e5,x=179.99,b=x*M,P=xe?parseFloat(W(t,we,e,!1,"0 0 0").split(" ")[2])||v.zOrigin||0:0;if(ye?r=W(t,Te,e,!0):t.currentStyle&&(r=t.currentStyle.filter.match(C),r=r&&4===r.length?[r[0].substr(4),Number(r[2].substr(4)),Number(r[1].substr(4)),r[3].substr(4),v.x||0,v.y||0].join(","):""),r&&"none"!==r&&"matrix(1, 0, 0, 1, 0, 0)"!==r){for(n=(r||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],o=n.length;--o>-1;)h=Number(n[o]),n[o]=(l=h-(h|=0))?(0|l*w+(0>l?-.5:.5))/w+h:h;if(16===n.length){var S=n[8],k=n[9],R=n[10],A=n[12],O=n[13],D=n[14];if(v.zOrigin&&(D=-v.zOrigin,A=S*D-n[12],O=k*D-n[13],D=R*D+v.zOrigin-n[14]),!i||s||null==v.rotationX){var I,E,L,F,N,X,U,Y=n[0],j=n[1],B=n[2],q=n[3],V=n[4],G=n[5],Q=n[6],Z=n[7],$=n[11],H=Math.atan2(Q,R),K=-b>H||H>b;v.rotationX=H*z,H&&(F=Math.cos(-H),N=Math.sin(-H),I=V*F+S*N,E=G*F+k*N,L=Q*F+R*N,S=V*-N+S*F,k=G*-N+k*F,R=Q*-N+R*F,$=Z*-N+$*F,V=I,G=E,Q=L),H=Math.atan2(S,Y),v.rotationY=H*z,H&&(X=-b>H||H>b,F=Math.cos(-H),N=Math.sin(-H),I=Y*F-S*N,E=j*F-k*N,L=B*F-R*N,k=j*N+k*F,R=B*N+R*F,$=q*N+$*F,Y=I,j=E,B=L),H=Math.atan2(j,G),v.rotation=H*z,H&&(U=-b>H||H>b,F=Math.cos(-H),N=Math.sin(-H),Y=Y*F+V*N,E=j*F+G*N,G=j*-N+G*F,Q=B*-N+Q*F,j=E),U&&K?v.rotation=v.rotationX=0:U&&X?v.rotation=v.rotationY=0:X&&K&&(v.rotationY=v.rotationX=0),v.scaleX=(0|Math.sqrt(Y*Y+j*j)*w+.5)/w,v.scaleY=(0|Math.sqrt(G*G+k*k)*w+.5)/w,v.scaleZ=(0|Math.sqrt(Q*Q+R*R)*w+.5)/w,v.skewX=0,v.perspective=$?1/(0>$?-$:$):0,v.x=A,v.y=O,v.z=D}}else if(!(xe&&!s&&n.length&&v.x===n[4]&&v.y===n[5]&&(v.rotationX||v.rotationY)||void 0!==v.x&&"none"===W(t,"display",e))){var J=n.length>=6,te=J?n[0]:1,ee=n[1]||0,ie=n[2]||0,se=J?n[3]:1;v.x=n[4]||0,v.y=n[5]||0,_=Math.sqrt(te*te+ee*ee),u=Math.sqrt(se*se+ie*ie),p=te||ee?Math.atan2(ee,te)*z:v.rotation||0,c=ie||se?Math.atan2(ie,se)*z+p:v.skewX||0,f=_-Math.abs(v.scaleX||0),m=u-Math.abs(v.scaleY||0),Math.abs(c)>90&&270>Math.abs(c)&&(y?(_*=-1,c+=0>=p?180:-180,p+=0>=p?180:-180):(u*=-1,c+=0>=c?180:-180)),d=(p-v.rotation)%180,g=(c-v.skewX)%180,(void 0===v.skewX||f>T||-T>f||m>T||-T>m||d>-x&&x>d&&false|d*w||g>-x&&x>g&&false|g*w)&&(v.scaleX=_,v.scaleY=u,v.rotation=p,v.skewX=c),xe&&(v.rotationX=v.rotationY=v.z=0,v.perspective=parseFloat(a.defaultTransformPerspective)||0,v.scaleZ=1)}v.zOrigin=P;for(o in v)T>v[o]&&v[o]>-T&&(v[o]=0)}else v={x:0,y:0,z:0,scaleX:1,scaleY:1,scaleZ:1,skewX:0,perspective:0,rotation:0,rotationX:0,rotationY:0,zOrigin:0};return i&&(t._gsTransform=v),v.xPercent=v.yPercent=0,v},Se=function(t){var e,i,s=this.data,r=-s.rotation*M,n=r+s.skewX*M,a=1e5,o=(0|Math.cos(r)*s.scaleX*a)/a,h=(0|Math.sin(r)*s.scaleX*a)/a,l=(0|Math.sin(n)*-s.scaleY*a)/a,_=(0|Math.cos(n)*s.scaleY*a)/a,u=this.t.style,p=this.t.currentStyle;if(p){i=h,h=-l,l=-i,e=p.filter,u.filter="";var c,m,d=this.t.offsetWidth,g=this.t.offsetHeight,v="absolute"!==p.position,w="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+h+", M21="+l+", M22="+_,x=s.x+d*s.xPercent/100,b=s.y+g*s.yPercent/100;if(null!=s.ox&&(c=(s.oxp?.01*d*s.ox:s.ox)-d/2,m=(s.oyp?.01*g*s.oy:s.oy)-g/2,x+=c-(c*o+m*h),b+=m-(c*l+m*_)),v?(c=d/2,m=g/2,w+=", Dx="+(c-(c*o+m*h)+x)+", Dy="+(m-(c*l+m*_)+b)+")"):w+=", sizingMethod='auto expand')",u.filter=-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?e.replace(O,w):w+" "+e,(0===t||1===t)&&1===o&&0===h&&0===l&&1===_&&(v&&-1===w.indexOf("Dx=0, Dy=0")||T.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf("gradient("&&e.indexOf("Alpha"))&&u.removeAttribute("filter")),!v){var P,S,k,R=8>f?1:-1;for(c=s.ieOffsetX||0,m=s.ieOffsetY||0,s.ieOffsetX=Math.round((d-((0>o?-o:o)*d+(0>h?-h:h)*g))/2+x),s.ieOffsetY=Math.round((g-((0>_?-_:_)*g+(0>l?-l:l)*d))/2+b),fe=0;4>fe;fe++)S=J[fe],P=p[S],i=-1!==P.indexOf("px")?parseFloat(P):Q(this.t,S,parseFloat(P),P.replace(y,""))||0,k=i!==s[S]?2>fe?-s.ieOffsetX:-s.ieOffsetY:2>fe?c-s.ieOffsetX:m-s.ieOffsetY,u[S]=(s[S]=Math.round(i-k*(0===fe||2===fe?1:R)))+"px"}}},ke=N.set3DTransformRatio=function(t){var e,i,s,r,n,a,o,h,l,_,u,c,f,m,d,g,v,y,T,w,x,b,P,S=this.data,k=this.t.style,R=S.rotation*M,A=S.scaleX,C=S.scaleY,O=S.scaleZ,D=S.x,z=S.y,I=S.z,E=S.perspective;if(!(1!==t&&0!==t||"auto"!==S.force3D||S.rotationY||S.rotationX||1!==O||E||I))return Re.call(this,t),void 0;if(p){var L=1e-4;L>A&&A>-L&&(A=O=2e-5),L>C&&C>-L&&(C=O=2e-5),!E||S.z||S.rotationX||S.rotationY||(E=0)}if(R||S.skewX)y=Math.cos(R),T=Math.sin(R),e=y,n=T,S.skewX&&(R-=S.skewX*M,y=Math.cos(R),T=Math.sin(R),"simple"===S.skewType&&(w=Math.tan(S.skewX*M),w=Math.sqrt(1+w*w),y*=w,T*=w)),i=-T,a=y;else{if(!(S.rotationY||S.rotationX||1!==O||E))return k[ye]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) translate3d(":"translate3d(")+D+"px,"+z+"px,"+I+"px)"+(1!==A||1!==C?" scale("+A+","+C+")":""),void 0;e=a=1,i=n=0}u=1,s=r=o=h=l=_=c=f=m=0,d=E?-1/E:0,g=S.zOrigin,v=1e5,R=S.rotationY*M,R&&(y=Math.cos(R),T=Math.sin(R),l=u*-T,f=d*-T,s=e*T,o=n*T,u*=y,d*=y,e*=y,n*=y),R=S.rotationX*M,R&&(y=Math.cos(R),T=Math.sin(R),w=i*y+s*T,x=a*y+o*T,b=_*y+u*T,P=m*y+d*T,s=i*-T+s*y,o=a*-T+o*y,u=_*-T+u*y,d=m*-T+d*y,i=w,a=x,_=b,m=P),1!==O&&(s*=O,o*=O,u*=O,d*=O),1!==C&&(i*=C,a*=C,_*=C,m*=C),1!==A&&(e*=A,n*=A,l*=A,f*=A),g&&(c-=g,r=s*c,h=o*c,c=u*c+g),r=(w=(r+=D)-(r|=0))?(0|w*v+(0>w?-.5:.5))/v+r:r,h=(w=(h+=z)-(h|=0))?(0|w*v+(0>w?-.5:.5))/v+h:h,c=(w=(c+=I)-(c|=0))?(0|w*v+(0>w?-.5:.5))/v+c:c,k[ye]=(S.xPercent||S.yPercent?"translate("+S.xPercent+"%,"+S.yPercent+"%) matrix3d(":"matrix3d(")+[(0|e*v)/v,(0|n*v)/v,(0|l*v)/v,(0|f*v)/v,(0|i*v)/v,(0|a*v)/v,(0|_*v)/v,(0|m*v)/v,(0|s*v)/v,(0|o*v)/v,(0|u*v)/v,(0|d*v)/v,r,h,c,E?1+-c/E:1].join(",")+")"},Re=N.set2DTransformRatio=function(t){var e,i,s,r,n,a=this.data,o=this.t,h=o.style,l=a.x,_=a.y;return a.rotationX||a.rotationY||a.z||a.force3D===!0||"auto"===a.force3D&&1!==t&&0!==t?(this.setRatio=ke,ke.call(this,t),void 0):(a.rotation||a.skewX?(e=a.rotation*M,i=e-a.skewX*M,s=1e5,r=a.scaleX*s,n=a.scaleY*s,h[ye]=(a.xPercent||a.yPercent?"translate("+a.xPercent+"%,"+a.yPercent+"%) matrix(":"matrix(")+(0|Math.cos(e)*r)/s+","+(0|Math.sin(e)*r)/s+","+(0|Math.sin(i)*-n)/s+","+(0|Math.cos(i)*n)/s+","+l+","+_+")"):h[ye]=(a.xPercent||a.yPercent?"translate("+a.xPercent+"%,"+a.yPercent+"%) matrix(":"matrix(")+a.scaleX+",0,0,"+a.scaleY+","+l+","+_+")",void 0)};de("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent",{parser:function(t,e,i,s,n,o,h){if(s._transform)return n;var l,_,u,p,c,f,m,d=s._transform=Pe(t,r,!0,h.parseTransform),g=t.style,v=1e-6,y=ve.length,T=h,w={};if("string"==typeof T.transform&&ye)u=L.style,u[ye]=T.transform,u.display="block",u.position="absolute",E.body.appendChild(L),l=Pe(L,null,!1),E.body.removeChild(L);else if("object"==typeof T){if(l={scaleX:se(null!=T.scaleX?T.scaleX:T.scale,d.scaleX),scaleY:se(null!=T.scaleY?T.scaleY:T.scale,d.scaleY),scaleZ:se(T.scaleZ,d.scaleZ),x:se(T.x,d.x),y:se(T.y,d.y),z:se(T.z,d.z),xPercent:se(T.xPercent,d.xPercent),yPercent:se(T.yPercent,d.yPercent),perspective:se(T.transformPerspective,d.perspective)},m=T.directionalRotation,null!=m)if("object"==typeof m)for(u in m)T[u]=m[u];else T.rotation=m;"string"==typeof T.x&&-1!==T.x.indexOf("%")&&(l.x=0,l.xPercent=se(T.x,d.xPercent)),"string"==typeof T.y&&-1!==T.y.indexOf("%")&&(l.y=0,l.yPercent=se(T.y,d.yPercent)),l.rotation=re("rotation"in T?T.rotation:"shortRotation"in T?T.shortRotation+"_short":"rotationZ"in T?T.rotationZ:d.rotation,d.rotation,"rotation",w),xe&&(l.rotationX=re("rotationX"in T?T.rotationX:"shortRotationX"in T?T.shortRotationX+"_short":d.rotationX||0,d.rotationX,"rotationX",w),l.rotationY=re("rotationY"in T?T.rotationY:"shortRotationY"in T?T.shortRotationY+"_short":d.rotationY||0,d.rotationY,"rotationY",w)),l.skewX=null==T.skewX?d.skewX:re(T.skewX,d.skewX),l.skewY=null==T.skewY?d.skewY:re(T.skewY,d.skewY),(_=l.skewY-d.skewY)&&(l.skewX+=_,l.rotation+=_)}for(xe&&null!=T.force3D&&(d.force3D=T.force3D,f=!0),d.skewType=T.skewType||d.skewType||a.defaultSkewType,c=d.force3D||d.z||d.rotationX||d.rotationY||l.z||l.rotationX||l.rotationY||l.perspective,c||null==T.scale||(l.scaleZ=1);--y>-1;)i=ve[y],p=l[i]-d[i],(p>v||-v>p||null!=I[i])&&(f=!0,n=new pe(d,i,d[i],p,n),i in w&&(n.e=w[i]),n.xs0=0,n.plugin=o,s._overwriteProps.push(n.n));return p=T.transformOrigin,(p||xe&&c&&d.zOrigin)&&(ye?(f=!0,i=we,p=(p||W(t,i,r,!1,"50% 50%"))+"",n=new pe(g,i,0,0,n,-1,"transformOrigin"),n.b=g[i],n.plugin=o,xe?(u=d.zOrigin,p=p.split(" "),d.zOrigin=(p.length>2&&(0===u||"0px"!==p[2])?parseFloat(p[2]):u)||0,n.xs0=n.e=p[0]+" "+(p[1]||"50%")+" 0px",n=new pe(d,"zOrigin",0,0,n,-1,n.n),n.b=u,n.xs0=n.e=d.zOrigin):n.xs0=n.e=p):ee(p+"",d)),f&&(s._transformType=c||3===this._transformType?3:2),n},prefix:!0}),de("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),de("borderRadius",{defaultValue:"0px",parser:function(t,e,i,n,a){e=this.format(e);var o,h,l,_,u,p,c,f,m,d,g,v,y,T,w,x,b=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],P=t.style;for(m=parseFloat(t.offsetWidth),d=parseFloat(t.offsetHeight),o=e.split(" "),h=0;b.length>h;h++)this.p.indexOf("border")&&(b[h]=V(b[h])),u=_=W(t,b[h],r,!1,"0px"),-1!==u.indexOf(" ")&&(_=u.split(" "),u=_[0],_=_[1]),p=l=o[h],c=parseFloat(u),v=u.substr((c+"").length),y="="===p.charAt(1),y?(f=parseInt(p.charAt(0)+"1",10),p=p.substr(2),f*=parseFloat(p),g=p.substr((f+"").length-(0>f?1:0))||""):(f=parseFloat(p),g=p.substr((f+"").length)),""===g&&(g=s[i]||v),g!==v&&(T=Q(t,"borderLeft",c,v),w=Q(t,"borderTop",c,v),"%"===g?(u=100*(T/m)+"%",_=100*(w/d)+"%"):"em"===g?(x=Q(t,"borderLeft",1,"em"),u=T/x+"em",_=w/x+"em"):(u=T+"px",_=w+"px"),y&&(p=parseFloat(u)+f+g,l=parseFloat(_)+f+g)),a=ce(P,b[h],u+" "+_,p+" "+l,!1,"0px",a);return a},prefix:!0,formatter:le("0px 0px 0px 0px",!1,!0)}),de("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,s,n,a){var o,h,l,_,u,p,c="background-position",m=r||G(t,null),d=this.format((m?f?m.getPropertyValue(c+"-x")+" "+m.getPropertyValue(c+"-y"):m.getPropertyValue(c):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),g=this.format(e);if(-1!==d.indexOf("%")!=(-1!==g.indexOf("%"))&&(p=W(t,"backgroundImage").replace(k,""),p&&"none"!==p)){for(o=d.split(" "),h=g.split(" "),F.setAttribute("src",p),l=2;--l>-1;)d=o[l],_=-1!==d.indexOf("%"),_!==(-1!==h[l].indexOf("%"))&&(u=0===l?t.offsetWidth-F.width:t.offsetHeight-F.height,o[l]=_?parseFloat(d)/100*u+"px":100*(parseFloat(d)/u)+"%");d=o.join(" ")}return this.parseComplex(t.style,d,g,n,a)},formatter:ee}),de("backgroundSize",{defaultValue:"0 0",formatter:ee}),de("perspective",{defaultValue:"0px",prefix:!0}),de("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),de("transformStyle",{prefix:!0}),de("backfaceVisibility",{prefix:!0}),de("userSelect",{prefix:!0}),de("margin",{parser:_e("marginTop,marginRight,marginBottom,marginLeft")}),de("padding",{parser:_e("paddingTop,paddingRight,paddingBottom,paddingLeft")}),de("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,s,n,a){var o,h,l;return 9>f?(h=t.currentStyle,l=8>f?" ":",",o="rect("+h.clipTop+l+h.clipRight+l+h.clipBottom+l+h.clipLeft+")",e=this.format(e).split(",").join(l)):(o=this.format(W(t,this.p,r,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,o,e,n,a)}}),de("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),de("autoRound,strictUnits",{parser:function(t,e,i,s,r){return r}}),de("border",{defaultValue:"0px solid #000",parser:function(t,e,i,s,n,a){return this.parseComplex(t.style,this.format(W(t,"borderTopWidth",r,!1,"0px")+" "+W(t,"borderTopStyle",r,!1,"solid")+" "+W(t,"borderTopColor",r,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(he)||["#000"])[0]}}),de("borderWidth",{parser:_e("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),de("float,cssFloat,styleFloat",{parser:function(t,e,i,s,r){var n=t.style,a="cssFloat"in n?"cssFloat":"styleFloat";return new pe(n,a,0,0,r,-1,i,!1,0,n[a],e)}});var Ae=function(t){var e,i=this.t,s=i.filter||W(this.data,"filter"),r=0|this.s+this.c*t;100===r&&(-1===s.indexOf("atrix(")&&-1===s.indexOf("radient(")&&-1===s.indexOf("oader(")?(i.removeAttribute("filter"),e=!W(this.data,"filter")):(i.filter=s.replace(x,""),e=!0)),e||(this.xn1&&(i.filter=s=s||"alpha(opacity="+r+")"),-1===s.indexOf("pacity")?0===r&&this.xn1||(i.filter=s+" alpha(opacity="+r+")"):i.filter=s.replace(T,"opacity="+r))};de("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,s,n,a){var o=parseFloat(W(t,"opacity",r,!1,"1")),h=t.style,l="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+o),l&&1===o&&"hidden"===W(t,"visibility",r)&&0!==e&&(o=0),U?n=new pe(h,"opacity",o,e-o,n):(n=new pe(h,"opacity",100*o,100*(e-o),n),n.xn1=l?1:0,h.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setRatio=Ae),l&&(n=new pe(h,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit"),n.xs0="inherit",s._overwriteProps.push(n.n),s._overwriteProps.push(i)),n}});var Ce=function(t,e){e&&(t.removeProperty?("ms"===e.substr(0,2)&&(e="M"+e.substr(1)),t.removeProperty(e.replace(P,"-$1").toLowerCase())):t.removeAttribute(e))},Oe=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:Ce(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};de("className",{parser:function(t,e,s,n,a,o,h){var l,_,u,p,c,f=t.getAttribute("class")||"",m=t.style.cssText;if(a=n._classNamePT=new pe(t,s,0,0,a,2),a.setRatio=Oe,a.pr=-11,i=!0,a.b=f,_=$(t,r),u=t._gsClassPT){for(p={},c=u.data;c;)p[c.p]=1,c=c._next;u.setRatio(1)}return t._gsClassPT=a,a.e="="!==e.charAt(1)?e:f.replace(RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),n._tween._duration&&(t.setAttribute("class",a.e),l=H(t,_,$(t),h,p),t.setAttribute("class",f),a.data=l.firstMPT,t.style.cssText=m,a=a.xfirst=n.parse(t,l.difs,a,o)),a}});var De=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,s,r,n=this.t.style,a=o.transform.parse;if("all"===this.e)n.cssText="",r=!0;else for(e=this.e.split(","),s=e.length;--s>-1;)i=e[s],o[i]&&(o[i].parse===a?r=!0:i="transformOrigin"===i?we:o[i].p),Ce(n,i);r&&(Ce(n,ye),this.t._gsTransform&&delete this.t._gsTransform)}};for(de("clearProps",{parser:function(t,e,s,r,n){return n=new pe(t,s,0,0,n,2),n.setRatio=De,n.e=e,n.pr=-10,n.data=r._tween,i=!0,n}}),h="bezier,throwProps,physicsProps,physics2D".split(","),fe=h.length;fe--;)ge(h[fe]);h=a.prototype,h._firstPT=null,h._onInitTween=function(t,e,o){if(!t.nodeType)return!1;this._target=t,this._tween=o,this._vars=e,l=e.autoRound,i=!1,s=e.suffixMap||a.suffixMap,r=G(t,""),n=this._overwriteProps;var h,p,f,m,d,g,v,y,T,x=t.style;if(_&&""===x.zIndex&&(h=W(t,"zIndex",r),("auto"===h||""===h)&&this._addLazySet(x,"zIndex",0)),"string"==typeof e&&(m=x.cssText,h=$(t,r),x.cssText=m+";"+e,h=H(t,h,$(t)).difs,!U&&w.test(e)&&(h.opacity=parseFloat(RegExp.$1)),e=h,x.cssText=m),this._firstPT=p=this.parse(t,e,null),this._transformType){for(T=3===this._transformType,ye?u&&(_=!0,""===x.zIndex&&(v=W(t,"zIndex",r),("auto"===v||""===v)&&this._addLazySet(x,"zIndex",0)),c&&this._addLazySet(x,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(T?"visible":"hidden"))):x.zoom=1,f=p;f&&f._next;)f=f._next;y=new pe(t,"transform",0,0,null,2),this._linkCSSP(y,null,f),y.setRatio=T&&xe?ke:ye?Re:Se,y.data=this._transform||Pe(t,r,!0),n.pop()}if(i){for(;p;){for(g=p._next,f=m;f&&f.pr>p.pr;)f=f._next;(p._prev=f?f._prev:d)?p._prev._next=p:m=p,(p._next=f)?f._prev=p:d=p,p=g}this._firstPT=m}return!0},h.parse=function(t,e,i,n){var a,h,_,u,p,c,f,m,d,g,v=t.style;for(a in e)c=e[a],h=o[a],h?i=h.parse(t,c,a,this,i,n,e):(p=W(t,a,r)+"",d="string"==typeof c,"color"===a||"fill"===a||"stroke"===a||-1!==a.indexOf("Color")||d&&b.test(c)?(d||(c=oe(c),c=(c.length>3?"rgba(":"rgb(")+c.join(",")+")"),i=ce(v,a,p,c,!0,"transparent",i,0,n)):!d||-1===c.indexOf(" ")&&-1===c.indexOf(",")?(_=parseFloat(p),f=_||0===_?p.substr((_+"").length):"",(""===p||"auto"===p)&&("width"===a||"height"===a?(_=te(t,a,r),f="px"):"left"===a||"top"===a?(_=Z(t,a,r),f="px"):(_="opacity"!==a?0:1,f="")),g=d&&"="===c.charAt(1),g?(u=parseInt(c.charAt(0)+"1",10),c=c.substr(2),u*=parseFloat(c),m=c.replace(y,"")):(u=parseFloat(c),m=d?c.substr((u+"").length)||"":""),""===m&&(m=a in s?s[a]:f),c=u||0===u?(g?u+_:u)+m:e[a],f!==m&&""!==m&&(u||0===u)&&_&&(_=Q(t,a,_,f),"%"===m?(_/=Q(t,a,100,"%")/100,e.strictUnits!==!0&&(p=_+"%")):"em"===m?_/=Q(t,a,1,"em"):"px"!==m&&(u=Q(t,a,u,m),m="px"),g&&(u||0===u)&&(c=u+_+m)),g&&(u+=_),!_&&0!==_||!u&&0!==u?void 0!==v[a]&&(c||"NaN"!=c+""&&null!=c)?(i=new pe(v,a,u||_||0,0,i,-1,a,!1,0,p,c),i.xs0="none"!==c||"display"!==a&&-1===a.indexOf("Style")?c:p):j("invalid "+a+" tween value: "+e[a]):(i=new pe(v,a,_,u-_,i,0,a,l!==!1&&("px"===m||"zIndex"===a),0,p,c),i.xs0=m)):i=ce(v,a,p,c,!0,null,i,0,n)),n&&i&&!i.plugin&&(i.plugin=n); +return i},h.setRatio=function(t){var e,i,s,r=this._firstPT,n=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;r;){if(e=r.c*t+r.s,r.r?e=Math.round(e):n>e&&e>-n&&(e=0),r.type)if(1===r.type)if(s=r.l,2===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setRatio&&r.setRatio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setRatio(t),r=r._next;else for(;r;)2!==r.type?r.t[r.p]=r.e:r.setRatio(t),r=r._next},h._enableTransforms=function(t){this._transformType=t||3===this._transformType?3:2,this._transform=this._transform||Pe(this._target,r,!0)};var Me=function(){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};h._addLazySet=function(t,e,i){var s=this._firstPT=new pe(t,e,0,0,this._firstPT,2);s.e=i,s.setRatio=Me,s.data=this},h._linkCSSP=function(t,e,i,s){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,s=!0),i?i._next=t:s||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},h._kill=function(e){var i,s,r,n=e;if(e.autoAlpha||e.alpha){n={};for(s in e)n[s]=e[s];n.opacity=1,n.autoAlpha&&(n.visibility=1)}return e.className&&(i=this._classNamePT)&&(r=i.xfirst,r&&r._prev?this._linkCSSP(r._prev,i._next,r._prev._prev):r===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,r._prev),this._classNamePT=null),t.prototype._kill.call(this,n)};var ze=function(t,e,i){var s,r,n,a;if(t.slice)for(r=t.length;--r>-1;)ze(t[r],e,i);else for(s=t.childNodes,r=s.length;--r>-1;)n=s[r],a=n.type,n.style&&(e.push($(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childNodes.length||ze(n,e,i)};return a.cascadeTo=function(t,i,s){var r,n,a,o=e.to(t,i,s),h=[o],l=[],_=[],u=[],p=e._internals.reservedProps;for(t=o._targets||o.target,ze(t,l,u),o.render(i,!0),ze(t,_),o.render(0,!0),o._enabled(!0),r=u.length;--r>-1;)if(n=H(u[r],l[r],_[r]),n.firstMPT){n=n.difs;for(a in s)p[a]&&(n[a]=s[a]);h.push(e.to(u[r],i,n))}return h},t.activate([a]),a},!0),function(){var t=_gsScope._gsDefine.plugin({propName:"roundProps",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),e=t.prototype;e._onInitAllProps=function(){for(var t,e,i,s=this._tween,r=s.vars.roundProps instanceof Array?s.vars.roundProps:s.vars.roundProps.split(","),n=r.length,a={},o=s._propLookup.roundProps;--n>-1;)a[r[n]]=1;for(n=r.length;--n>-1;)for(t=r[n],e=s._firstPT;e;)i=e._next,e.pg?e.t._roundProps(a,!0):e.n===t&&(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:s._firstPT===e&&(s._firstPT=i),e._next=e._prev=null,s._propLookup[t]=o),e=i;return!1},e._add=function(t,e,i,s){this._addTween(t,e,i,i+s,e,!0),this._overwriteProps.push(e)}}(),_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.3.3",init:function(t,e){var i,s,r;if("function"!=typeof t.setAttribute)return!1;this._target=t,this._proxy={},this._start={},this._end={};for(i in e)this._start[i]=this._proxy[i]=s=t.getAttribute(i),r=this._addTween(this._proxy,i,parseFloat(s),e[i],i),this._end[i]=r?r.s+r.c:e[i],this._overwriteProps.push(i);return!0},set:function(t){this._super.setRatio.call(this,t);for(var e,i=this._overwriteProps,s=i.length,r=1===t?this._end:t?this._proxy:this._start;--s>-1;)e=i[s],this._target.setAttribute(e,r[e]+"")}}),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.2.1",API:2,init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o,h=e.useRadians===!0?2*Math.PI:360,l=1e-6;for(i in e)"useRadians"!==i&&(o=(e[i]+"").split("_"),s=o[0],r=parseFloat("function"!=typeof t[i]?t[i]:t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0,a=n-r,o.length&&(s=o.join("_"),-1!==s.indexOf("short")&&(a%=h,a!==a%(h/2)&&(a=0>a?a+h:a-h)),-1!==s.indexOf("_cw")&&0>a?a=(a+9999999999*h)%h-(0|a/h)*h:-1!==s.indexOf("ccw")&&a>0&&(a=(a-9999999999*h)%h-(0|a/h)*h)),(a>l||-l>a)&&(this._addTween(t,i,r,r+a,i),this._overwriteProps.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,s,r=_gsScope.GreenSockGlobals||_gsScope,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,h=n._class,l=function(e,i){var s=h("easing."+e,function(){},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,s},_=t.register||function(){},u=function(t,e,i,s){var r=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return _(r,t),r},p=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},c=function(e,i){var s=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=s.prototype=new t;return r.constructor=s,r.getRatio=i,r.config=function(t){return new s(t)},s},f=u("Back",c("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),c("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),c("BackInOut",function(t){return 1>(t*=2)?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),m=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),d=m.prototype=new t;return d.constructor=m,d.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},m.ease=new m(.7,.7),d.config=m.config=function(t,e,i){return new m(t,e,i)},e=h("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0),d=e.prototype=new t,d.constructor=e,d.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),(this._p2*t>>0)*this._p1},d.config=e.config=function(t){return new e(t)},i=h("easing.RoughEase",function(e){e=e||{};for(var i,s,r,n,a,o,h=e.taper||"none",l=[],_=0,u=0|(e.points||20),c=u,f=e.randomize!==!1,m=e.clamp===!0,d=e.template instanceof t?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--c>-1;)i=f?Math.random():1/u*c,s=d?d.getRatio(i):i,"none"===h?r=g:"out"===h?(n=1-i,r=n*n*g):"in"===h?r=i*i*g:.5>i?(n=2*i,r=.5*n*n*g):(n=2*(1-i),r=.5*n*n*g),f?s+=Math.random()*r-.5*r:c%2?s+=.5*r:s-=.5*r,m&&(s>1?s=1:0>s&&(s=0)),l[_++]={x:i,y:s};for(l.sort(function(t,e){return t.x-e.x}),o=new p(1,1,null),c=u;--c>-1;)a=l[c],o=new p(a.x,a.y,o);this._prev=new p(0,0,0!==o.t?o:o.next)},!0),d=i.prototype=new t,d.constructor=i,d.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},d.config=function(t){return new i(t)},i.ease=new i,u("Bounce",l("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),u("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return 1>(t*=2)?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),s=function(e,i,s){var r=h("easing."+e,function(t,e){this._p1=t||1,this._p2=e||s,this._p3=this._p2/a*(Math.asin(1/this._p1)||0)},!0),n=r.prototype=new t;return n.constructor=r,n.getRatio=i,n.config=function(t,e){return new r(t,e)},r},u("Elastic",s("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*a/this._p2)+1},.3),s("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2))},.3),s("ElasticInOut",function(t){return 1>(t*=2)?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*a/this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*a/this._p2)+1},.45)),u("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return 1>(t*=2)?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),u("Sine",l("SineOut",function(t){return Math.sin(t*o)}),l("SineIn",function(t){return-Math.cos(t*o)+1}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),_(r.SlowMo,"SlowMo","ease,"),_(i,"RoughEase","ease,"),_(e,"SteppedEase","ease,"),f},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t,e){"use strict";var i=t.GreenSockGlobals=t.GreenSockGlobals||t;if(!i.TweenLite){var s,r,n,a,o,h=function(t){var e,s=t.split("."),r=i;for(e=0;s.length>e;e++)r[s[e]]=r=r[s[e]]||{};return r},l=h("com.greensock"),_=1e-10,u=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},p=function(){},c=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),f={},m=function(s,r,n,a){this.sc=f[s]?f[s].sc:[],f[s]=this,this.gsClass=null,this.func=n;var o=[];this.check=function(l){for(var _,u,p,c,d=r.length,g=d;--d>-1;)(_=f[r[d]]||new m(r[d],[])).gsClass?(o[d]=_.gsClass,g--):l&&_.sc.push(this);if(0===g&&n)for(u=("com.greensock."+s).split("."),p=u.pop(),c=h(u.join("."))[p]=this.gsClass=n.apply(n,o),a&&(i[p]=c,"function"==typeof define&&define.amd?define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+s.split(".").pop(),[],function(){return c}):s===e&&"undefined"!=typeof module&&module.exports&&(module.exports=c)),d=0;this.sc.length>d;d++)this.sc[d].check()},this.check(!0)},d=t._gsDefine=function(t,e,i,s){return new m(t,e,i,s)},g=l._class=function(t,e,i){return e=e||function(){},d(t,[],function(){return e},i),e};d.globals=i;var v=[0,0,1,1],y=[],T=g("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?v.concat(e):v},!0),w=T.map={},x=T.register=function(t,e,i,s){for(var r,n,a,o,h=e.split(","),_=h.length,u=(i||"easeIn,easeOut,easeInOut").split(",");--_>-1;)for(n=h[_],r=s?g("easing."+n,null,!0):l.easing[n]||{},a=u.length;--a>-1;)o=u[a],w[n+"."+o]=w[o+n]=r[o]=t.getRatio?t:t[o]||new t};for(n=T.prototype,n._calcEnd=!1,n.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:.5>t?s/2:1-s/2},s=["Linear","Quad","Cubic","Quart","Quint,Strong"],r=s.length;--r>-1;)n=s[r]+",Power"+r,x(new T(null,null,1,r),n,"easeOut",!0),x(new T(null,null,2,r),n,"easeIn"+(0===r?",easeNone":"")),x(new T(null,null,3,r),n,"easeInOut");w.linear=l.easing.Linear.easeIn,w.swing=l.easing.Quad.easeInOut;var b=g("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});n=b.prototype,n.addEventListener=function(t,e,i,s,r){r=r||0;var n,h,l=this._listeners[t],_=0;for(null==l&&(this._listeners[t]=l=[]),h=l.length;--h>-1;)n=l[h],n.c===e&&n.s===i?l.splice(h,1):0===_&&r>n.pr&&(_=h+1);l.splice(_,0,{c:e,s:i,up:s,pr:r}),this!==a||o||a.wake()},n.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;--i>-1;)if(s[i].c===e)return s.splice(i,1),void 0},n.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;--e>-1;)s=r[e],s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i)};var P=t.requestAnimationFrame,S=t.cancelAnimationFrame,k=Date.now||function(){return(new Date).getTime()},R=k();for(s=["ms","moz","webkit","o"],r=s.length;--r>-1&&!P;)P=t[s[r]+"RequestAnimationFrame"],S=t[s[r]+"CancelAnimationFrame"]||t[s[r]+"CancelRequestAnimationFrame"];g("Ticker",function(t,e){var i,s,r,n,h,l=this,u=k(),c=e!==!1&&P,f=500,m=33,d=function(t){var e,a,o=k()-R;o>f&&(u+=o-m),R+=o,l.time=(R-u)/1e3,e=l.time-h,(!i||e>0||t===!0)&&(l.frame++,h+=e+(e>=n?.004:n-e),a=!0),t!==!0&&(r=s(d)),a&&l.dispatchEvent("tick")};b.call(l),l.time=l.frame=0,l.tick=function(){d(!0)},l.lagSmoothing=function(t,e){f=t||1/_,m=Math.min(e,f,0)},l.sleep=function(){null!=r&&(c&&S?S(r):clearTimeout(r),s=p,r=null,l===a&&(o=!1))},l.wake=function(){null!==r?l.sleep():l.frame>10&&(R=k()-f+5),s=0===i?p:c&&P?P:function(t){return setTimeout(t,0|1e3*(h-l.time)+1)},l===a&&(o=!0),d(2)},l.fps=function(t){return arguments.length?(i=t,n=1/(i||60),h=this.time+n,l.wake(),void 0):i},l.useRAF=function(t){return arguments.length?(l.sleep(),c=t,l.fps(i),void 0):c},l.fps(t),setTimeout(function(){c&&(!r||5>l.frame)&&l.useRAF(!1)},1500)}),n=l.Ticker.prototype=new l.events.EventDispatcher,n.constructor=l.Ticker;var A=g("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,B){o||a.wake();var i=this.vars.useFrames?j:B;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});a=A.ticker=new l.Ticker,n=A.prototype,n._dirty=n._gc=n._initted=n._paused=!1,n._totalTime=n._time=0,n._rawPrevTime=-1,n._next=n._last=n._onUpdate=n._timeline=n.timeline=null,n._paused=!1;var C=function(){o&&k()-R>2e3&&a.wake(),setTimeout(C,2e3)};C(),n.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},n.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},n.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},n.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},n.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},n.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},n.render=function(){},n.invalidate=function(){return this},n.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},n._enabled=function(t,e){return o||a.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},n._kill=function(){return this._enabled(!1,!1)},n.kill=function(t,e){return this._kill(t,e),this},n._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},n._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},n.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=c(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},n.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},n.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._timethis._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(o||a.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(t>s&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(this.render(t,e,!1),I.length&&q())}return this},n.progress=n.totalProgress=function(t,e){return arguments.length?this.totalTime(this.duration()*t,e):this._time/this.duration()},n.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},n.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||_,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},n.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},n.paused=function(t){if(!arguments.length)return this._paused;if(t!=this._paused&&this._timeline){o||t||a.wake();var e=this._timeline,i=e.rawTime(),s=i-this._pauseTime;!t&&e.smoothChildTiming&&(this._startTime+=s,this._uncache(!1)),this._pauseTime=t?i:null,this._paused=t,this._active=this.isActive(),!t&&0!==s&&this._initted&&this.duration()&&this.render(e.smoothChildTiming?this._totalTime:(i-this._startTime)/this._timeScale,!0,!0)}return this._gc&&!t&&this._enabled(!0,!1),this};var O=g("core.SimpleTimeline",function(t){A.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});n=O.prototype=new A,n.constructor=O,n.kill()._gc=!1,n._first=n._last=null,n._sortChildren=!1,n.add=n.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},n.rawTime=function(){return o||a.wake(),this._totalTime};var D=g("TweenLite",function(e,i,s){if(A.call(this,i,s),this.render=D.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:D.selector(e)||e;var r,n,a,o=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),h=this.vars.overwrite;if(this._overwrite=h=null==h?Y[D.defaultOverwrite]:"number"==typeof h?h>>0:Y[h],(o||e instanceof Array||e.push&&c(e))&&"number"!=typeof e[0])for(this._targets=a=u(e),this._propLookup=[],this._siblings=[],r=0;a.length>r;r++)n=a[r],n?"string"!=typeof n?n.length&&n!==t&&n[0]&&(n[0]===t||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(u(n))):(this._siblings[r]=V(n,this,!1),1===h&&this._siblings[r].length>1&&G(n,this,null,1,this._siblings[r])):(n=a[r--]=D.selector(n),"string"==typeof n&&a.splice(r+1,1)):a.splice(r--,1);else this._propLookup={},this._siblings=V(e,this,!1),1===h&&this._siblings.length>1&&G(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-_,this.render(-this._delay))},!0),M=function(e){return e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},z=function(t,e){var i,s={};for(i in t)U[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!F[i]||F[i]&&F[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s};n=D.prototype=new A,n.constructor=D,n.kill()._gc=!1,n.ratio=0,n._firstPT=n._targets=n._overwrittenProps=n._startAt=null,n._notifyPluginsOfEnabled=n._lazy=!1,D.version="1.13.1",D.defaultEase=n._ease=new T(null,null,1,1),D.defaultOverwrite="auto",D.ticker=a,D.autoSleep=!0,D.lagSmoothing=function(t,e){a.lagSmoothing(t,e)},D.selector=t.$||t.jQuery||function(e){var i=t.$||t.jQuery;return i?(D.selector=i,i(e)):"undefined"==typeof document?e:document.querySelectorAll?document.querySelectorAll(e):document.getElementById("#"===e.charAt(0)?e.substr(1):e)};var I=[],E={},L=D._internals={isArray:c,isSelector:M,lazyTweens:I},F=D._plugins={},N=L.tweenLookup={},X=0,U=L.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1},Y={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},j=A._rootFramesTimeline=new O,B=A._rootTimeline=new O,q=L.lazyRender=function(){var t=I.length;for(E={};--t>-1;)s=I[t],s&&s._lazy!==!1&&(s.render(s._lazy,!1,!0),s._lazy=!1);I.length=0};B._startTime=a.time,j._startTime=a.frame,B._active=j._active=!0,setTimeout(q,1),A._updateRoot=D.render=function(){var t,e,i;if(I.length&&q(),B.render((a.time-B._startTime)*B._timeScale,!1,!1),j.render((a.frame-j._startTime)*j._timeScale,!1,!1),I.length&&q(),!(a.frame%120)){for(i in N){for(e=N[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);0===e.length&&delete N[i]}if(i=B._first,(!i||i._paused)&&D.autoSleep&&!j._first&&1===a._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||a.sleep()}}},a.addEventListener("tick",A._updateRoot);var V=function(t,e,i){var s,r,n=t._gsTweenID;if(N[n||(t._gsTweenID=n="t"+X++)]||(N[n]={target:t,tweens:[]}),e&&(s=N[n].tweens,s[r=s.length]=e,i))for(;--r>-1;)s[r]===e&&s.splice(r,1);return N[n].tweens},G=function(t,e,i,s,r){var n,a,o,h;if(1===s||s>=4){for(h=r.length,n=0;h>n;n++)if((o=r[n])!==e)o._gc||o._enabled(!1,!1)&&(a=!0);else if(5===s)break;return a}var l,u=e._startTime+_,p=[],c=0,f=0===e._duration;for(n=r.length;--n>-1;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(l=l||W(e,0,f),0===W(o,l,f)&&(p[c++]=o)):u>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>u&&((f||!o._initted)&&2e-10>=u-o._startTime||(p[c++]=o)));for(n=c;--n>-1;)o=p[n],2===s&&o._kill(i,t)&&(a=!0),(2!==s||!o._firstPT&&o._initted)&&o._enabled(!1,!1)&&(a=!0);return a},W=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return n/=r,n>e?n-e:i&&n===e||!t._initted&&2*_>n-e?_:(n+=t.totalDuration()/t._timeScale/r)>e+_?0:n-e-_};n._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenProps,o=this._duration,h=!!n.immediateRender,l=n.ease;if(n.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={};for(s in n.startAt)r[s]=n.startAt[s];if(r.overwrite=!1,r.immediateRender=!0,r.lazy=h&&n.lazy!==!1,r.startAt=r.delay=null,this._startAt=D.to(this.target,0,r),h)if(this._time>0)this._startAt=null;else if(0!==o)return}else if(n.runBackwards&&0!==o)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{i={};for(s in n)U[s]&&"autoCSS"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=h&&n.lazy!==!1,i.immediateRender=h,this._startAt=D.to(this.target,0,i),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1)}if(this._ease=l=l?l instanceof T?l:"function"==typeof l?new T(l,n.easeParams):w[l]||D.defaultEase:D.defaultEase,n.easeParams instanceof Array&&l.config&&(this._ease=l.config.apply(l,n.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;--t>-1;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a);if(e&&D._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=n.onUpdate,this._initted=!0},n._initProps=function(e,i,s,r){var n,a,o,h,l,_;if(null==e)return!1;E[e._gsTweenID]&&q(),this.vars.css||e.style&&e!==t&&e.nodeType&&F.css&&this.vars.autoCSS!==!1&&z(this.vars,e);for(n in this.vars){if(_=this.vars[n],U[n])_&&(_ instanceof Array||_.push&&c(_))&&-1!==_.join("").indexOf("{self}")&&(this.vars[n]=_=this._swapSelfInParams(_,this));else if(F[n]&&(h=new F[n])._onInitTween(e,this.vars[n],this)){for(this._firstPT=l={_next:this._firstPT,t:h,p:"setRatio",s:0,c:1,f:!0,n:n,pg:!0,pr:h._priority},a=h._overwriteProps.length;--a>-1;)i[h._overwriteProps[a]]=this._firstPT;(h._priority||h._onInitAllProps)&&(o=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0)}else this._firstPT=i[n]=l={_next:this._firstPT,t:e,p:n,f:"function"==typeof e[n],n:n,pg:!1,pr:0},l.s=l.f?e[n.indexOf("set")||"function"!=typeof e["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(e[n]),l.c="string"==typeof _&&"="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*Number(_.substr(2)):Number(_)-l.s||0;l&&l._next&&(l._next._prev=l)}return r&&this._kill(r,e)?this._initProps(e,i,s,r):this._overwrite>1&&this._firstPT&&s.length>1&&G(e,this,i,this._overwrite,s)?(this._kill(i,e),this._initProps(e,i,s,r)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(E[e._gsTweenID]=!0),o)},n.render=function(t,e,i){var s,r,n,a,o=this._time,h=this._duration,l=this._rawPrevTime;if(t>=h)this._totalTime=this._time=h,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete"),0===h&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||0>l||l===_)&&l!==t&&(i=!0,l>_&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||l===t?t:_);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===h&&l>0&&l!==_)&&(r="onReverseComplete",s=this._reversed),0>t?(this._active=!1,0===h&&(this._initted||!this.vars.lazy||i)&&(l>=0&&(i=!0),this._rawPrevTime=a=!e||t||l===t?t:_)):this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var u=t/h,p=this._easeType,c=this._easePower;(1===p||3===p&&u>=.5)&&(u=1-u),3===p&&(u*=2),1===c?u*=u:2===c?u*=u*u:3===c?u*=u*u*u:4===c&&(u*=u*u*u*u),this.ratio=1===p?1-u:2===p?u:.5>t/h?u/2:1-u/2}else this.ratio=this._ease.getRatio(t/h);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=l,I.push(this),this._lazy=t,void 0;this._time&&!s?this.ratio=this._ease.getRatio(this._time/h):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&t>=0&&(this._active=!0),0===o&&(this._startAt&&(t>=0?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===h)&&(e||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||y))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||y)),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this.vars[r].apply(this.vars[r+"Scope"]||this,this.vars[r+"Params"]||y),0===h&&this._rawPrevTime===_&&a!==_&&(this._rawPrevTime=0))}},n._kill=function(t,e){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:D.selector(e)||e;var i,s,r,n,a,o,h,l;if((c(e)||M(e))&&"number"!=typeof e[0])for(i=e.length;--i>-1;)this._kill(t,e[i])&&(o=!0);else{if(this._targets){for(i=this._targets.length;--i>-1;)if(e===this._targets[i]){a=this._propLookup[i]||{},this._overwrittenProps=this._overwrittenProps||[],s=this._overwrittenProps[i]=t?this._overwrittenProps[i]||{}:"all";break}}else{if(e!==this.target)return!1;a=this._propLookup,s=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(a){h=t||a,l=t!==s&&"all"!==s&&t!==a&&("object"!=typeof t||!t._tempKill);for(r in h)(n=a[r])&&(n.pg&&n.t._kill(h)&&(o=!0),n.pg&&0!==n.t._overwriteProps.length||(n._prev?n._prev._next=n._next:n===this._firstPT&&(this._firstPT=n._next),n._next&&(n._next._prev=n._prev),n._next=n._prev=null),delete a[r]),l&&(s[r]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return o},n.invalidate=function(){return this._notifyPluginsOfEnabled&&D._onPluginEvent("_onDisable",this),this._firstPT=null,this._overwrittenProps=null,this._onUpdate=null,this._startAt=null,this._initted=this._active=this._notifyPluginsOfEnabled=this._lazy=!1,this._propLookup=this._targets?{}:[],this},n._enabled=function(t,e){if(o||a.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;--i>-1;)this._siblings[i]=V(s[i],this,!0);else this._siblings=V(this.target,this,!0)}return A.prototype._enabled.call(this,t,e),this._notifyPluginsOfEnabled&&this._firstPT?D._onPluginEvent(t?"_onEnable":"_onDisable",this):!1},D.to=function(t,e,i){return new D(t,e,i)},D.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new D(t,e,i)},D.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new D(t,e,s)},D.delayedCall=function(t,e,i,s,r){return new D(e,0,{delay:t,onComplete:e,onCompleteParams:i,onCompleteScope:s,onReverseComplete:e,onReverseCompleteParams:i,onReverseCompleteScope:s,immediateRender:!1,useFrames:r,overwrite:0})},D.set=function(t,e){return new D(t,0,e)},D.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:D.selector(t)||t;var i,s,r,n;if((c(t)||M(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];--i>-1;)s=s.concat(D.getTweensOf(t[i],e));for(i=s.length;--i>-1;)for(n=s[i],r=i;--r>-1;)n===s[r]&&s.splice(i,1)}else for(s=V(t).concat(),i=s.length;--i>-1;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},D.killTweensOf=D.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=D.getTweensOf(t,e),r=s.length;--r>-1;)s[r]._kill(i,t)};var Q=g("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=Q.prototype},!0);if(n=Q.prototype,Q.version="1.10.1",Q.API=2,n._firstPT=null,n._addTween=function(t,e,i,s,r,n){var a,o; +return null!=s&&(a="number"==typeof s||"="!==s.charAt(1)?Number(s)-i:parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)))?(this._firstPT=o={_next:this._firstPT,t:t,p:e,s:i,c:a,f:"function"==typeof t[e],n:r||e,r:n},o._next&&(o._next._prev=o),o):void 0},n.setRatio=function(t){for(var e,i=this._firstPT,s=1e-6;i;)e=i.c*t+i.s,i.r?e=Math.round(e):s>e&&e>-s&&(e=0),i.f?i.t[i.p](e):i.t[i.p]=e,i=i._next},n._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},n._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},D._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},Q.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===Q.API&&(F[(new t[e])._propName]=t[e]);return!0},d.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=g("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){Q.call(this,i,s),this._overwriteProps=r||[]},t.global===!0),o=a.prototype=new Q(i);o.constructor=a,a.API=t.API;for(e in n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,Q.activate([a]),a},s=t._gsQueue){for(r=0;s.length>r;r++)s[r]();for(n in f)f[n].func||t.console.log("GSAP encountered missing dependency: com.greensock."+n)}o=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenMax"); \ No newline at end of file diff --git a/js/ajax.js b/js/ajax.js index b44a6d3..4831a98 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -1,266 +1,251 @@ -function _get_obj_toppos(obj) -{ -var top = obj.offsetTop; -while( (obj = obj.offsetParent) != null ) -{ -top += obj.offsetTop; -} -return top; -} -function center_div() -{ -this.divname = ''; -this.divobj = ''; -} -center_div.prototype.clear_div = function() -{ -try -{ -if ( ! this.divobj ) -{ -return; -} -else -{ -this.divobj.style.display = 'none'; -} -} -catch(e) -{ -return; -} -} -center_div.prototype.Ywindow = function() -{ -var scrollY = 0; -if ( document.documentElement && document.documentElement.scrollTop ) -{ -scrollY = document.documentElement.scrollTop; -} -else if ( document.body && document.body.scrollTop ) -{ -scrollY = document.body.scrollTop; -} -else if ( window.pageYOffset ) -{ -scrollY = window.pageYOffset; -} -else if ( window.scrollY ) -{ -scrollY = window.scrollY; -} -return scrollY; -} -center_div.prototype.move_div = function() -{ -try -{ -this.divobj = document.getElementById( this.divname ); -} -catch(e) -{ -return; -} -// Figure width and height -var my_width = 0; -var my_height = 0; -if ( typeof( window.innerWidth ) == 'number' ) -{ -my_width = window.innerWidth; -my_height = window.innerHeight; -} -else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) -{ -my_width = document.documentElement.clientWidth; -my_height = document.documentElement.clientHeight; -} -else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) -{ -my_width = document.body.clientWidth; -my_height = document.body.clientHeight; -} -this.divobj.style.position = 'absolute'; -this.divobj.style.display = 'block'; -this.divobj.style.zIndex = 99; -var divheight = parseInt( this.divobj.style.Height ); -var divwidth = parseInt( this.divobj.style.Width ); -divheight = divheight ? divheight : 50; -divwidth = divwidth ? divwidth : 200; -var scrolly = this.Ywindow(); -var setX = ( my_width - divwidth ) / 2; -var setY = ( my_height - divheight ) / 2 + scrolly; -setX = ( setX < 0 ) ? 0 : setX; -setY = ( setY < 0 ) ? 0 : setY; -this.divobj.style.left = setX + "px"; -this.divobj.style.top = setY + "px"; -} -function tbdev_ajax(file){ -this.AjaxFailedAlert = "Ваш браузер не поддерживает расширенные возможности управления сайтом, мы настоятельно рекомендуем сменить браузер.\n"; -this.requestFile = file; -this.method = "POST"; -this.URLString = ""; -this.encodeURIString = true; -this.execute = false; -this.loading_fired = 0; -this.centerdiv = null; -this.onLoading = function() { }; -this.onLoaded = function() { }; -this.onInteractive = function() { }; -this.onCompletion = function() { }; -this.onShow = function( message ) -{ -if ( ! this.loading_fired ) -{ -this.loading_fired = 1; -// Change text? -if ( message ) -{ -document.getElementById( 'loading-layer-text' ).innerHTML = message; -} -this.centerdiv = new center_div(); -this.centerdiv.divname = 'loading-layer'; -this.centerdiv.move_div(); -} -return; +function _get_obj_toppos(obj) { + var top = obj.offsetTop; + while ((obj = obj.offsetParent) != null) { + top += obj.offsetTop; + } + return top; +} +function center_div() { + this.divname = ''; + this.divobj = ''; +} +center_div.prototype.clear_div = function () { + try { + if (!this.divobj) { + return; + } + else { + this.divobj.style.display = 'none'; + } + } + catch (e) { + return; + } }; -this.onHide = function() -{ -try -{ -if ( this.centerdiv && this.centerdiv.divobj ) -{ -this.centerdiv.clear_div(); -} -} -catch(e) -{ -} -this.loading_fired = 0; -return; +center_div.prototype.Ywindow = function () { + var scrollY = 0; + if (document.documentElement && document.documentElement.scrollTop) { + scrollY = document.documentElement.scrollTop; + } + else if (document.body && document.body.scrollTop) { + scrollY = document.body.scrollTop; + } + else if (window.pageYOffset) { + scrollY = window.pageYOffset; + } + else if (window.scrollY) { + scrollY = window.scrollY; + } + return scrollY; }; -this.createAJAX = function() { -try { -this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); -} catch (e) { -try { -this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); -} catch (err) { -this.xmlhttp = null; -} -} -if(!this.xmlhttp && typeof XMLHttpRequest != "undefined") -this.xmlhttp = new XMLHttpRequest(); -if (!this.xmlhttp){ -this.failed = true; -} +center_div.prototype.move_div = function () { + try { + this.divobj = document.getElementById(this.divname); + } + catch (e) { + return; + } +// Figure width and height + var my_width = 0; + var my_height = 0; + if (typeof( window.innerWidth ) == 'number') { + my_width = window.innerWidth; + my_height = window.innerHeight; + } + else if (document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight )) { + my_width = document.documentElement.clientWidth; + my_height = document.documentElement.clientHeight; + } + else if (document.body && ( document.body.clientWidth || document.body.clientHeight )) { + my_width = document.body.clientWidth; + my_height = document.body.clientHeight; + } + this.divobj.style.position = 'absolute'; + this.divobj.style.display = 'block'; + this.divobj.style.zIndex = 99; + var divheight = parseInt(this.divobj.style.Height); + var divwidth = parseInt(this.divobj.style.Width); + divheight = divheight ? divheight : 50; + divwidth = divwidth ? divwidth : 200; + var scrolly = this.Ywindow(); + var setX = ( my_width - divwidth ) / 2; + var setY = ( my_height - divheight ) / 2 + scrolly; + setX = ( setX < 0 ) ? 0 : setX; + setY = ( setY < 0 ) ? 0 : setY; + this.divobj.style.left = setX + "px"; + this.divobj.style.top = setY + "px"; }; -this.setVar = function(name, value){ -if (this.URLString.length < 3){ -this.URLString = name + "=" + value; -} else { -this.URLString += "&" + name + "=" + value; -} -} -this.encVar = function(name, value){ -var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value); -return varString; -} -this.encodeURLString = function(string){ -varArray = string.split('&'); -for (i = 0; i < varArray.length; i++){ -urlVars = varArray[i].split('='); -if (urlVars[0].indexOf('amp;') != -1){ -urlVars[0] = urlVars[0].substring(4); -} -varArray[i] = this.encVar(urlVars[0],urlVars[1]); -} -return varArray.join('&'); -} -this.encodeVAR = function(url){ -url = url.toString(); -var regcheck = url.match(/[\x90-\xFF]/g); -if ( regcheck ) -{ -for (var i = 0; i < i.length; i++) -{ -url = url.replace(regcheck[i], '%u00' + (regcheck[i].charCodeAt(0) & 0xFF).toString(16).toUpperCase()); -} -} -return escape(url).replace(/\+/g, "%2B"); -} -this.runResponse = function(){ -eval(this.response); -} -this.sendAJAX = function(urlstring){ -this.responseStatus = new Array(2); -if(this.failed && this.AjaxFailedAlert){ -alert(this.AjaxFailedAlert); -} else { -if (urlstring){ -if (this.URLString.length){ -this.URLString = this.URLString + "&" + urlstring; -} else { -this.URLString = urlstring; -} -} -if (this.encodeURIString){ -var timeval = new Date().getTime(); -this.URLString = this.encodeURLString(this.URLString); +function tbdev_ajax(file) { + this.AjaxFailedAlert = "Ваш браузер не поддерживает расширенные возможности управления сайтом, мы настоятельно рекомендуем сменить браузер.\n"; + this.requestFile = file; + this.method = "POST"; + this.URLString = ""; + this.encodeURIString = true; + this.execute = false; + this.loading_fired = 0; + this.centerdiv = null; + this.onLoading = function () { + }; + this.onLoaded = function () { + }; + this.onInteractive = function () { + }; + this.onCompletion = function () { + }; + this.onShow = function (message) { + if (!this.loading_fired) { + this.loading_fired = 1; +// Change text? + if (message) { + document.getElementById('loading-layer-text').innerHTML = message; + } + this.centerdiv = new center_div(); + this.centerdiv.divname = 'loading-layer'; + this.centerdiv.move_div(); + } + return; + }; + this.onHide = function () { + try { + if (this.centerdiv && this.centerdiv.divobj) { + this.centerdiv.clear_div(); + } + } + catch (e) { + } + this.loading_fired = 0; + return; + }; + this.createAJAX = function () { + try { + this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (err) { + this.xmlhttp = null; + } + } + if (!this.xmlhttp && typeof XMLHttpRequest != "undefined") + this.xmlhttp = new XMLHttpRequest(); + if (!this.xmlhttp) { + this.failed = true; + } + }; + this.setVar = function (name, value) { + if (this.URLString.length < 3) { + this.URLString = name + "=" + value; + } else { + this.URLString += "&" + name + "=" + value; + } + }; + this.encVar = function (name, value) { + var varString = encodeURIComponent(name) + "=" + encodeURIComponent(value); + return varString; + }; + this.encodeURLString = function (string) { + varArray = string.split('&'); + for (i = 0; i < varArray.length; i++) { + urlVars = varArray[i].split('='); + if (urlVars[0].indexOf('amp;') != -1) { + urlVars[0] = urlVars[0].substring(4); + } + varArray[i] = this.encVar(urlVars[0], urlVars[1]); + } + return varArray.join('&'); + }; + this.encodeVAR = function (url) { + url = url.toString(); + var regcheck = url.match(/[\x90-\xFF]/g); + if (regcheck) { + for (var i = 0; i < i.length; i++) { + url = url.replace(regcheck[i], '%u00' + (regcheck[i].charCodeAt(0) & 0xFF).toString(16).toUpperCase()); + } + } + return escape(url).replace(/\+/g, "%2B"); + }; + this.runResponse = function () { + eval(this.response); + }; + this.sendAJAX = function (urlstring) { + this.responseStatus = new Array(2); + if (this.failed && this.AjaxFailedAlert) { + alert(this.AjaxFailedAlert); + } else { + if (urlstring) { + if (this.URLString.length) { + this.URLString = this.URLString + "&" + urlstring; + } else { + this.URLString = urlstring; + } + } + if (this.encodeURIString) { + var timeval = new Date().getTime(); + this.URLString = this.encodeURLString(this.URLString); //this.setVar("rndval", timeval); -} -if (this.element) { this.elementObj = document.getElementById(this.element); } -if (this.xmlhttp) { -var self = this; -if (this.method == "GET") { -var totalurlstring = this.requestFile + "?" + this.URLString; -this.xmlhttp.open(this.method, totalurlstring, true); -} else { -this.xmlhttp.open(this.method, this.requestFile, true); -} -if (this.method == "POST"){ -try { -this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded') -} catch (e) {} -} -this.xmlhttp.send(this.URLString); -this.xmlhttp.onreadystatechange = function() { -switch (self.xmlhttp.readyState){ -case 1: -self.onLoading(); -break; -case 2: -self.onLoaded(); -break; -case 3: -self.onInteractive(); -break; -case 4: -self.response = self.xmlhttp.responseText; -self.responseXML = self.xmlhttp.responseXML; -self.responseStatus[0] = self.xmlhttp.status; -self.responseStatus[1] = self.xmlhttp.statusText; -self.onCompletion(); -if(self.execute){ self.runResponse(); } -if (self.elementObj) { -var elemNodeName = self.elementObj.nodeName; -elemNodeName.toLowerCase(); -self.onHide(); -if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){ -if (self.response == 'error') { alert('Доступ отклонен'); } else { -self.elementObj.value = self.response; -} -} else { -if (self.response == 'error') { alert('Доступ отклонен'); } else { -self.elementObj.innerHTML = self.response; -} -} -} -self.URLString = ""; -break; -} -}; -} -} -}; -this.createAJAX(); + } + if (this.element) { + this.elementObj = document.getElementById(this.element); + } + if (this.xmlhttp) { + var self = this; + if (this.method == "GET") { + var totalurlstring = this.requestFile + "?" + this.URLString; + this.xmlhttp.open(this.method, totalurlstring, true); + } else { + this.xmlhttp.open(this.method, this.requestFile, true); + } + if (this.method == "POST") { + try { + this.xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') + } catch (e) { + } + } + this.xmlhttp.send(this.URLString); + this.xmlhttp.onreadystatechange = function () { + switch (self.xmlhttp.readyState) { + case 1: + self.onLoading(); + break; + case 2: + self.onLoaded(); + break; + case 3: + self.onInteractive(); + break; + case 4: + self.response = self.xmlhttp.responseText; + self.responseXML = self.xmlhttp.responseXML; + self.responseStatus[0] = self.xmlhttp.status; + self.responseStatus[1] = self.xmlhttp.statusText; + self.onCompletion(); + if (self.execute) { + self.runResponse(); + } + if (self.elementObj) { + var elemNodeName = self.elementObj.nodeName; + elemNodeName.toLowerCase(); + self.onHide(); + if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea") { + if (self.response == 'error') { + alert('Доступ отклонен'); + } else { + self.elementObj.value = self.response; + } + } else { + if (self.response == 'error') { + alert('Доступ отклонен'); + } else { + self.elementObj.innerHTML = self.response; + } + } + } + self.URLString = ""; + break; + } + }; + } + } + }; + this.createAJAX(); } \ No newline at end of file diff --git a/js/bbeditor.js b/js/bbeditor.js index 1a8ac31..2595398 100644 --- a/js/bbeditor.js +++ b/js/bbeditor.js @@ -118,7 +118,7 @@ function mozWrap(txtarea, open, close) selEnd = selLength; var s1 = (txtarea.value).substring(0,selStart); - var s2 = (txtarea.value).substring(selStart, selEnd) + var s2 = (txtarea.value).substring(selStart, selEnd); var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + open + s2 + close + s3; txtarea.focus(); diff --git a/js/blocks.js b/js/blocks.js index 500ed1f..d7754e6 100644 --- a/js/blocks.js +++ b/js/blocks.js @@ -1,15 +1,29 @@ function block_switch(id) { - var klappText = document.getElementById('sb' + id); - var klappBild = document.getElementById('picb' + id); - if (klappText.style.display == 'block') { - klappBild.src = 'pic/plus.gif'; - type = "hide"; - } else { - klappBild.src = 'pic/minus.gif'; - type = "show"; - } - jQuery.get("switch_blocks.php", {"type": type, "bid": id}, function(data){}, 'html'); - jQuery(document).ready(function(){ - jQuery('#sb' + id).slideToggle("medium"); - }); + var klappText = document.getElementById('sb' + id); + var klappBild = document.getElementById('picb' + id); + if (klappText.style.display == 'block') { + klappBild.src = 'pic/plus.gif'; + type = "hide"; + } else { + klappBild.src = 'pic/minus.gif'; + type = "show"; + } + var hb = $.cookie('hb'); + if (typeof hb == 'undefined') { + hb = []; + $.cookie('hb', serialize(hb)); + } else + hb = unserialize(hb); + var index = hb.indexOf(id); + if (index > -1) { + hb.splice(index, 1); + } else { + hb[hb.length] = id; + } + if (typeof hb == 'boolean') + hb = []; + $.cookie('hb', serialize(hb)); + jQuery(document).ready(function () { + jQuery('#sb' + id).slideToggle("medium"); + }); } \ No newline at end of file diff --git a/js/jquery.cookies.js b/js/jquery.cookies.js new file mode 100644 index 0000000..eb23d2f --- /dev/null +++ b/js/jquery.cookies.js @@ -0,0 +1,316 @@ +/*! + * jQuery Cookie Plugin v1.4.0 + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2013 Klaus Hartl + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // CommonJS + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + + var pluses = /\+/g; + + function encode(s) { + return config.raw ? s : encodeURIComponent(s); + } + + function decode(s) { + return config.raw ? s : decodeURIComponent(s); + } + + function stringifyCookieValue(value) { + return encode(config.json ? JSON.stringify(value) : String(value)); + } + + function parseCookieValue(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape... + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + + try { + // Replace server-side written pluses with spaces. + // If we can't decode the cookie, ignore it, it's unusable. + // If we can't parse the cookie, ignore it, it's unusable. + s = decodeURIComponent(s.replace(pluses, ' ')); + return config.json ? JSON.parse(s) : s; + } catch (e) { + } + } + + function read(s, converter) { + var value = config.raw ? s : parseCookieValue(s); + return $.isFunction(converter) ? converter(value) : value; + } + + var config = $.cookie = function (key, value, options) { + + // Write + + if (value !== undefined && !$.isFunction(value)) { + options = $.extend({}, config.defaults, options); + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setTime(+t + days * 864e+5); + } + + return (document.cookie = [ + encode(key), '=', stringifyCookieValue(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // Read + + var result = key ? undefined : {}; + + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling $.cookie(). + var cookies = document.cookie ? document.cookie.split('; ') : []; + + for (var i = 0, l = cookies.length; i < l; i++) { + var parts = cookies[i].split('='); + var name = decode(parts.shift()); + var cookie = parts.join('='); + + if (key && key === name) { + // If second argument (value) is a function it's a converter... + result = read(cookie, value); + break; + } + + // Prevent storing a cookie that we couldn't decode. + if (!key && (cookie = read(cookie)) !== undefined) { + result[name] = cookie; + } + } + + return result; + }; + + config.defaults = {}; + + $.removeCookie = function (key, options) { + if ($.cookie(key) === undefined) { + return false; + } + + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); + return !$.cookie(key); + }; + +})); + +function unserialize(inp) { // Creates a PHP value from a stored representation + // + // + original by: Arpad Ray (mailto:arpad@php.net) + + error = 0; + if (inp == "" || inp.length < 2) { + errormsg = "input is too short"; + return; + } + var val, kret, vret, cval; + var type = inp.charAt(0); + var cont = inp.substring(2); + var size = 0, divpos = 0, endcont = 0, rest = "", next = ""; + + switch (type) { + case "N": // null + if (inp.charAt(1) != ";") { + errormsg = "missing ; for null"; + } + // leave val undefined + rest = cont; + break; + case "b": // boolean + if (!/[01];/.test(cont.substring(0, 2))) { + errormsg = "value not 0 or 1, or missing ; for boolean"; + } + val = (cont.charAt(0) == "1"); + rest = cont.substring(1); + break; + case "s": // string + val = ""; + divpos = cont.indexOf(":"); + if (divpos == -1) { + errormsg = "missing : for string"; + break; + } + size = parseInt(cont.substring(0, divpos)); + if (size == 0) { + if (cont.length - divpos < 4) { + errormsg = "string is too short"; + break; + } + rest = cont.substring(divpos + 4); + break; + } + if ((cont.length - divpos - size) < 4) { + errormsg = "string is too short"; + break; + } + if (cont.substring(divpos + 2 + size, divpos + 4 + size) != "\";") { + errormsg = "string is too long, or missing \";"; + } + val = cont.substring(divpos + 2, divpos + 2 + size); + rest = cont.substring(divpos + 4 + size); + break; + case "i": // integer + case "d": // float + var dotfound = 0; + for (var i = 0; i < cont.length; i++) { + cval = cont.charAt(i); + if (isNaN(parseInt(cval)) && !(type == "d" && cval == "." && !dotfound++)) { + endcont = i; + break; + } + } + if (!endcont || cont.charAt(endcont) != ";") { + errormsg = "missing or invalid value, or missing ; for int/float"; + } + val = cont.substring(0, endcont); + val = (type == "i" ? parseInt(val) : parseFloat(val)); + rest = cont.substring(endcont + 1); + break; + case "a": // array + if (cont.length < 4) { + errormsg = "array is too short"; + return; + } + divpos = cont.indexOf(":", 1); + if (divpos == -1) { + errormsg = "missing : for array"; + return; + } + size = parseInt(cont.substring(1, divpos - 1)); + cont = cont.substring(divpos + 2); + val = new Array(); + if (cont.length < 1) { + errormsg = "array is too short"; + return; + } + for (var i = 0; i + 1 < size * 2; i += 2) { + kret = unserialize(cont, 1); + if (error || kret[0] == undefined || kret[1] == "") { + errormsg = "missing or invalid key, or missing value for array"; + return; + } + vret = unserialize(kret[1], 1); + if (error) { + errormsg = "invalid value for array"; + return; + } + val[kret[0]] = vret[0]; + cont = vret[1]; + } + if (cont.charAt(0) != "}") { + errormsg = "missing ending }, or too many values for array"; + return; + } + rest = cont.substring(1); + break; + case "O": // object + divpos = cont.indexOf(":"); + if (divpos == -1) { + errormsg = "missing : for object"; + return; + } + size = parseInt(cont.substring(0, divpos)); + var objname = cont.substring(divpos + 2, divpos + 2 + size); + if (cont.substring(divpos + 2 + size, divpos + 4 + size) != "\":") { + errormsg = "object name is too long, or missing \":"; + return; + } + var objprops = unserialize("a:" + cont.substring(divpos + 4 + size), 1); + if (error) { + errormsg = "invalid object properties"; + return; + } + rest = objprops[1]; + var objout = "function " + objname + "(){"; + for (key in objprops[0]) { + objout += "" + key + "=objprops[0]['" + key + "'];"; + } + objout += "}val=new " + objname + "();"; + eval(objout); + break; + default: + errormsg = "invalid input type"; + } + return (arguments.length == 1 ? val : [val, rest]); +} + +function serialize(mixed_val) { // Generates a storable representation of a value + // + // + original by: Ates Goral (http://magnetiq.com) + // + adapted for IE: Ilia Kantor (http://javascript.ru) + + switch (typeof(mixed_val)) { + case "number": + if (isNaN(mixed_val) || !isFinite(mixed_val)) { + return false; + } else { + return (Math.floor(mixed_val) == mixed_val ? "i" : "d") + ":" + mixed_val + ";"; + } + case "string": + return "s:" + mixed_val.length + ":\"" + mixed_val + "\";"; + case "boolean": + return "b:" + (mixed_val ? "1" : "0") + ";"; + case "object": + if (mixed_val == null) { + return "N;"; + } else if (mixed_val instanceof Array) { + var idxobj = { idx: -1 }; + var map = []; + for (var i = 0; i < mixed_val.length; i++) { + idxobj.idx++; + var ser = serialize(mixed_val[i]); + + if (ser) { + map.push(serialize(idxobj.idx) + ser) + } + } + + return "a:" + mixed_val.length + ":{" + map.join("") + "}" + + } + else { + var class_name = get_class(mixed_val); + + if (class_name == undefined) { + return false; + } + + var props = new Array(); + for (var prop in mixed_val) { + var ser = serialize(mixed_val[prop]); + + if (ser) { + props.push(serialize(prop) + ser); + } + } + return "O:" + class_name.length + ":\"" + class_name + "\":" + props.length + ":{" + props.join("") + "}"; + } + case "undefined": + return "N;"; + } + + return false; +} \ No newline at end of file diff --git a/js/jquery.gsap.min.js b/js/jquery.gsap.min.js new file mode 100644 index 0000000..dcee883 --- /dev/null +++ b/js/jquery.gsap.min.js @@ -0,0 +1,14 @@ +/*! + * VERSION: 0.1.9 + * DATE: 2014-07-22 + * UPDATES AND DOCS AT: http://www.greensock.com/jquery-gsap-plugin/ + * + * Requires TweenLite version 1.8.0 or higher and CSSPlugin. + * + * @license Copyright (c) 2014, GreenSock. All rights reserved. + * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for + * Club GreenSock members, the software agreement that was issued with your membership. + * + * @author: Jack Doyle, jack@greensock.com + */ +(function(t){"use strict";var e,i,s,r=t.fn.animate,n=t.fn.stop,a=!0,o=function(t){var e,i={};for(e in t)i[e]=t[e];return i},h={overwrite:1,delay:1,useFrames:1,runBackwards:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,autoCSS:1},l=function(t,e){for(var i in h)h[i]&&void 0!==t[i]&&(e[i]=t[i])},_=function(t){return function(e){return t.getRatio(e)}},u={},c=function(){var r,n,a,o=window.GreenSockGlobals||window;if(e=o.TweenMax||o.TweenLite,e&&(r=(e.version+".0.0").split("."),n=!(Number(r[0])>0&&Number(r[1])>7),o=o.com.greensock,i=o.plugins.CSSPlugin,u=o.easing.Ease.map||{}),!e||!i||n)return e=null,!s&&window.console&&(window.console.log("The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s)."+(n?" Version "+r.join(".")+" is too old.":"")),s=!0),void 0;if(t.easing){for(a in u)t.easing[a]=_(u[a]);c=!1}};t.fn.animate=function(s,n,h,_){if(s=s||{},c&&(c(),!e||!i))return r.call(this,s,n,h,_);if(!a||s.skipGSAP===!0||"object"==typeof n&&"function"==typeof n.step||null!=s.scrollTop||null!=s.scrollLeft)return r.call(this,s,n,h,_);var f,p,m,d,g=t.speed(n,h,_),v={ease:u[g.easing]||(g.easing===!1?u.linear:u.swing)},y=this,T="object"==typeof n?n.specialEasing:null;for(p in s){if(f=s[p],f instanceof Array&&u[f[1]]&&(T=T||{},T[p]=f[1],f=f[0]),"toggle"===f||"hide"===f||"show"===f)return r.call(this,s,n,h,_);v[-1===p.indexOf("-")?p:t.camelCase(p)]=f}if(T){v=o(v),d=[];for(p in T)f=d[d.length]={},l(v,f),f.ease=u[T[p]]||v.ease,-1!==p.indexOf("-")&&(p=t.camelCase(p)),f[p]=v[p],delete v[p];0===d.length&&(d=null)}return m=function(i){var s,r=o(v);if(d)for(s=d.length;--s>-1;)e.to(this,t.fx.off?0:g.duration/1e3,d[s]);r.onComplete=function(){i?i():g.old&&t(this).each(g.old)},e.to(this,t.fx.off?0:g.duration/1e3,r)},g.queue!==!1?(y.queue(g.queue,m),"function"==typeof g.old&&y.queue(g.queue,function(t){g.old.call(this),t()})):m.call(y),y},t.fn.stop=function(t,i){if(n.call(this,t,i),e){if(i)for(var s,r=e.getTweensOf(this),a=r.length;--a>-1;)s=r[a].totalTime()/r[a].totalDuration(),s>0&&1>s&&r[a].seek(r[a].totalDuration());e.killTweensOf(this)}return this},t.gsap={enabled:function(t){a=t},version:"0.1.9"}})(jQuery); \ No newline at end of file diff --git a/js/jquery.js b/js/jquery.js index 95dd013..a436370 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,11 +1,159 @@ -/* - * jQuery 1.2.6 - New Wave Javascript - * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ - */ -eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("",""]||!f.1h("",""]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>",""]||!f.1h("<4F")&&[2,"<1T><22>",""]||(!f.1h("<22><4F>",""]||!f.1h("<7E")&&[2,"<1T><22><7q>",""]||D.14.1f&&[1,"1v<1v>",""]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I im[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;1B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q},6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,{})) \ No newline at end of file +/*! jQuery v1.11.1 | (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={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,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=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.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},m.extend=m.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||m.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&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&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"!==m.type(a)||a.nodeType||m.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(k.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&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},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=r(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:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.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=r(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),m.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||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=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{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(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 ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
    ",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?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!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.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},B=b?function(a,b){if(a===b)return l=!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===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.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=fb.selectors={cacheLength:50,createPseudo:hb,match:X,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(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===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]||fb.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]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(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(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.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(),s=!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&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&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]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)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&&(s&&((l[u]||(l[u]={}))[a]=[w,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()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(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:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?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===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.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 Z.test(a.nodeName)},input:function(a){return Y.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:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;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=[w,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[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(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 tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(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 vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(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?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.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]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(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}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(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&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.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){m.each(b,function(b,c){var d=m.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&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.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},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.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?m.extend(a,d):d}},e={};return d.pipe=d.then,m.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&&m.isFunction(a.promise)?e:0,g=1===f?a:m.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]&&m.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 H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.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()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.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=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.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 m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.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},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
    a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.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?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.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]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.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||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.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)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.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=((m.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?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/
    ","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:k.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._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++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.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)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.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),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).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=wb(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=wb(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?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.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 m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(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,m.cleanData(ub(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,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("