├── .gitignore ├── www ├── favicon.ico ├── images │ ├── bg.gif │ └── logo.gif ├── sekrit_template.php ├── js │ ├── sherlock.js │ ├── raphael-min.js │ └── jquery-1.4.min.js ├── css │ ├── reset.css │ └── application.css ├── prefs.inc.php ├── header.inc.php ├── adduser.php ├── logout.inc.php ├── topten.php ├── customgraph.php ├── prefs.php ├── graphManager.php ├── config.inc.php └── index.php ├── config_template.py ├── README ├── pullapi.py └── db-schema.txt /.gitignore: -------------------------------------------------------------------------------- 1 | config.py 2 | .DS_Store 3 | config.pyc 4 | www/sekrit.php 5 | -------------------------------------------------------------------------------- /www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimrollenhagen/sherlock/HEAD/www/favicon.ico -------------------------------------------------------------------------------- /www/images/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimrollenhagen/sherlock/HEAD/www/images/bg.gif -------------------------------------------------------------------------------- /www/images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimrollenhagen/sherlock/HEAD/www/images/logo.gif -------------------------------------------------------------------------------- /www/sekrit_template.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /config_template.py: -------------------------------------------------------------------------------- 1 | db = { 2 | 'host': 'localhost', 3 | 'user': 'sherlock', 4 | 'db': 'WHATstats', 5 | 'password': 'blablabla', 6 | } 7 | api_path = 'something.php' 8 | 9 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | I don't really do PHP, but I've been maintaining this project 2 | that I didn't write for a couple of years now. 3 | 4 | So, I'm open sourcing it. Pull requests are very welcome. 5 | 6 | -------------------------------------------------------------------------------- /www/js/sherlock.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | // Clear username input on focus 3 | $("#su").focus(function(){ 4 | if($(this).val() == "Username") { 5 | $(this).val(""); 6 | } 7 | }) 8 | 9 | // Statistic summary 10 | $("#statistics_summary .summary_content:gt(0)").hide(); 11 | $("#statistics_summary .section_head_links li a").click(function(){ 12 | $("#statistics_summary .summary_content").fadeOut('fast'); 13 | $("#statistics_summary .section_head_links li").removeClass("active"); 14 | $($(this).attr("href")).fadeIn('fast'); 15 | $("#summary_type").text($(this).text()); 16 | $(this).parent("li").addClass("active"); 17 | return false; 18 | }) 19 | }) -------------------------------------------------------------------------------- /www/css/reset.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, font, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td { 10 | margin: 0; 11 | padding: 0; 12 | border: 0; 13 | outline: 0; 14 | font-size: 100%; 15 | vertical-align: baseline; 16 | background: transparent; 17 | } 18 | body { 19 | line-height: 1; 20 | } 21 | ol, ul { 22 | list-style: none; 23 | } 24 | blockquote, q { 25 | quotes: none; 26 | } 27 | 28 | /* remember to define focus styles! */ 29 | :focus { 30 | outline: 0; 31 | } 32 | 33 | /* remember to highlight inserts somehow! */ 34 | ins { 35 | text-decoration: none; 36 | } 37 | del { 38 | text-decoration: line-through; 39 | } 40 | 41 | /* tables still need 'cellspacing="0"' in the markup */ 42 | table { 43 | border-collapse: collapse; 44 | border-spacing: 0; 45 | } -------------------------------------------------------------------------------- /www/prefs.inc.php: -------------------------------------------------------------------------------- 1 | $thisPref){ 32 | if(isset($graphPrefs[$i])){ 33 | $prefStr.=",{$graphPrefs[$i]}: $thisPref"; 34 | } 35 | } 36 | return substr($prefStr,1); 37 | } 38 | ?> 39 | -------------------------------------------------------------------------------- /www/header.inc.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sherlock - The IRC Search Bot & Ratio Monitoring Service 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 17 | 18 | -------------------------------------------------------------------------------- /www/adduser.php: -------------------------------------------------------------------------------- 1 | 40 |
41 | What.CD username:
42 | What.CD userid:
43 | 44 |
45 | 46 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /www/logout.inc.php: -------------------------------------------------------------------------------- 1 | 23 | 24 | 25 | 26 | 49 | 50 | 51 |
Sherlock (what.cd)
52 | {$err[$_GET['err']]}
"; 59 | } 60 | ?> 61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
Username 
71 |
72 | 73 | 74 | 79 | -------------------------------------------------------------------------------- /pullapi.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | import MySQLdb 3 | import requests 4 | import xml.etree.ElementTree as etree 5 | 6 | from config import db, api_path 7 | 8 | def loadpage(url): 9 | url = "https://what.cd/" + url 10 | 11 | res = requests.get(url) 12 | return res.text 13 | 14 | def toBytes(value, type): 15 | if type == 'B': 16 | return float(value) 17 | if type == 'KB': 18 | return float(value) * 1024 19 | if type == 'MB': 20 | return float(value) * 1024 * 1024 21 | if type == 'GB': 22 | return float(value) * 1024 * 1024 * 1024 23 | if type == 'TB': 24 | return float(value) * 1024 * 1024 * 1024 * 1024 25 | 26 | def pull_and_store(url, cursor): 27 | root = etree.fromstring(loadpage(url)) 28 | children = root.getchildren() 29 | statlist = [] 30 | for child in children: 31 | statary = [] 32 | for stat in child.getchildren(): 33 | if stat.text is None: 34 | break 35 | statary.append(stat.text) 36 | if len(statary) < 8: 37 | continue 38 | 39 | # fix for 0 B downloaded, for infinite ratio fuckers 40 | if float(statary[1]) == 0.0: 41 | statary[1] = 1 42 | 43 | statstuple = ( str(statary[2]), str(float(statary[0])/float(statary[1])), str(statary[1]), 'B', 44 | str(statary[0]), 'B', str(long(statary[0])-long(statary[1])), 'B', 45 | str(statary[6]), str(statary[5]), str(statary[4]), str(statary[3]), str(statary[7]) ) 46 | statlist.append(statstuple) 47 | 48 | # yes, I know this is a bad horrible thing to do 49 | sqlstr = 'INSERT INTO statistics (username, ratio, downloaded, downType, uploaded, upType, buffer, buffType, uploads, snatched, leeching, seeding, forumPosts) VALUES ' 50 | 51 | for stat in statlist[0:len(statlist)-1]: 52 | sqlstr += str(stat) + ', ' 53 | sqlstr += str(statlist[len(statlist)-1]) 54 | 55 | cursor.execute(sqlstr) 56 | 57 | # connect to MySQL db 58 | conn = MySQLdb.connect(host = db['host'], 59 | user = db['user'], 60 | passwd = db['password'], 61 | db = db['db']) 62 | cursor = conn.cursor() 63 | 64 | # get user ids to lookup and build API url 65 | cursor.execute("SELECT userid FROM usernames") 66 | rows = cursor.fetchall() 67 | ids = [] 68 | i = 0 69 | while i < len(rows): 70 | idset = [] 71 | for idx in range(i, i+64): 72 | try: 73 | idset.append(str(rows[idx][0])) 74 | except IndexError: 75 | pass 76 | ids.append(idset) 77 | i += 64 78 | 79 | for idset in ids: 80 | idstr = '|'.join(idset) 81 | url = '%s?users=%s&stats=uploaded|downloaded|username|seeding|leeching|snatched|uploads|posts' % (api_path, idstr) 82 | pull_and_store(url, cursor) 83 | 84 | cursor.close() 85 | conn.close() 86 | -------------------------------------------------------------------------------- /db-schema.txt: -------------------------------------------------------------------------------- 1 | mysql> use WHATstats; 2 | Reading table information for completion of table and column names 3 | You can turn off this feature to get a quicker startup with -A 4 | 5 | Database changed 6 | mysql> desc usernames; 7 | +----------+-------------+------+-----+---------+----------------+ 8 | | Field | Type | Null | Key | Default | Extra | 9 | +----------+-------------+------+-----+---------+----------------+ 10 | | id | int(11) | NO | PRI | NULL | auto_increment | 11 | | username | varchar(40) | YES | UNI | NULL | | 12 | | userid | int(11) | YES | UNI | NULL | | 13 | +----------+-------------+------+-----+---------+----------------+ 14 | 3 rows in set (0.00 sec) 15 | 16 | mysql> desc statistics; 17 | +-----------------+-------------+------+-----+-------------------+-----------------------------+ 18 | | Field | Type | Null | Key | Default | Extra | 19 | +-----------------+-------------+------+-----+-------------------+-----------------------------+ 20 | | id | int(11) | NO | PRI | NULL | auto_increment | 21 | | username | varchar(40) | YES | MUL | NULL | | 22 | | ratio | float(10,6) | YES | | NULL | | 23 | | downloaded | bigint(30) | YES | | NULL | | 24 | | downType | varchar(2) | YES | | NULL | | 25 | | uploaded | bigint(30) | YES | | NULL | | 26 | | upType | varchar(2) | YES | | NULL | | 27 | | buffer | bigint(30) | YES | | NULL | | 28 | | buffType | varchar(2) | YES | | NULL | | 29 | | uploads | int(11) | YES | | NULL | | 30 | | snatched | int(11) | YES | | NULL | | 31 | | leeching | int(11) | YES | | NULL | | 32 | | seeding | int(11) | YES | | NULL | | 33 | | forumPosts | int(11) | YES | | NULL | | 34 | | torrentComments | int(11) | YES | | NULL | | 35 | | date | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | 36 | | hourlyRatio | float(4,2) | YES | | NULL | | 37 | +-----------------+-------------+------+-----+-------------------+-----------------------------+ 38 | 17 rows in set (0.00 sec) 39 | 40 | -------------------------------------------------------------------------------- /www/topten.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | 17 | Sherlock - The IRC Search Bot & Ratio Monitoring Service 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 30 | 31 | 43 | 44 |
45 | 48 | 49 |
50 |
51 |

52 |
53 | 59 |
60 |
61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | "; 78 | } 79 | ?> 80 | 81 |
RankUserBuffer
$i{$v[0]}$b
82 |
83 |
84 |
85 | -------------------------------------------------------------------------------- /www/customgraph.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | Sherlock - The IRC Search Bot & Ratio Monitoring Service 11 | 12 | 13 | 14 | 15 | 72 | 73 | 74 |
75 | 79 | 80 | 92 | 93 |
94 | 97 |
98 |
99 |
100 |

graphs

101 |
102 |
103 |
104 |
105 |
106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 124 | 125 |
StatisticDisplay
Add graph to main page
126 |
127 |
128 |
129 |
130 | 131 | 132 | -------------------------------------------------------------------------------- /www/prefs.php: -------------------------------------------------------------------------------- 1 | 35 | 36 | 37 | 38 | 39 | Sherlock - The IRC Search Bot & Ratio Monitoring Service 40 | 41 | 42 | 43 | 44 | 52 | 53 | 54 |
55 | 59 | 60 | 72 | 73 |
74 | 77 |
78 | 79 |
80 |
81 |

Timezone

82 |

Any preferences related to your timezone. These will affect your hourly statistics and your graphs.

83 |
84 |
    85 |
  1. 86 | 87 | 116 |
  2. 117 | 127 |
128 |
129 |
130 |
131 |

Graph Span

132 |

Longer graph spans may take longer to load on a slow connection.

133 |
134 |
    135 |
  1. 136 | 137 | 144 |
  2. 145 |
146 |
147 | 165 |
166 |
167 |
168 |
169 |
170 |
171 | 172 | 173 | -------------------------------------------------------------------------------- /www/graphManager.php: -------------------------------------------------------------------------------- 1 | $c){ 19 | if($c==$graph){ 20 | unset($cGraphs[$i]); 21 | break; 22 | } 23 | } 24 | savePref("cGraphs",$cGraphs); 25 | header("Location: index.php"); 26 | exit(); 27 | break; 28 | default: 29 | ?> 30 | 31 | 32 | 33 | 34 | Sherlock - The IRC Search Bot & Ratio Monitoring Service 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 | 46 | 47 | 59 | 60 |
61 | 64 |
65 |
66 |
67 |

graphs

68 |
69 |
70 | 73 |
74 |
75 |
76 | $cgraph){ 78 | $i2=$i; 79 | $kmg=false; 80 | $c=array(); 81 | parse_str(parse_url($cgraph,PHP_URL_QUERY),$c); 82 | $data=getData($c['d'],getGS()); 83 | $haslast=str_split($c['c']); 84 | $indexconv=array("u"=>"uploaded", 85 | "d"=>"downloaded", 86 | "r"=>"ratio", 87 | "b"=>"buffer", 88 | "p"=>"uploads", 89 | "s"=>"snatched", 90 | "l"=>"leeching", 91 | "e"=>"seeding", 92 | "f"=>"forumPosts", 93 | "c"=>"torrentComments", 94 | "h"=>"hourlyRatio" 95 | ); 96 | $statcolors=array("u"=>"#ca8080", 97 | "d"=>"#6C8ABD", 98 | "r"=>"#CA9E6B", 99 | "b"=>"#88CA97", 100 | "p"=>"#6db8bd", 101 | "s"=>"#b9bd6d", 102 | "l"=>"#b07eb3", 103 | "e"=>"#b38d7e", 104 | "f"=>"#b3ab7f", 105 | "c"=>"#7fb393", 106 | "h"=>"#dd9745" 107 | ); 108 | foreach($haslast as $thislasti=>$thislastv){ 109 | $haslast[$indexconv[$thislastv]]=1; 110 | unset($haslast[$thislasti]); 111 | } 112 | $last=array(); 113 | $gdata=array(); 114 | $skipped=0; 115 | $strdata="date"; 116 | foreach(str_split($c['d']) as $d){ 117 | $strdata.=", ".$indexconv[$d]; 118 | } 119 | $graph_key = ""; 120 | foreach(str_split($c['d']) as $d){ 121 | $graph_key .= "
  • ".$indexconv[$d]."
  • "; 122 | } 123 | $graph_colors = ""; 124 | foreach(str_split($c['d']) as $d){ 125 | $graph_colors .= "'".$statcolors[$d]."',"; 126 | } 127 | $graph_colors = rtrim($graph_colors,","); 128 | foreach($data as $d){ 129 | $strdata.=" \\n ".date("Y/m/d H:i:00",$d["date"]); 130 | foreach($d as $i=>$v){ 131 | if($i=="date") continue; 132 | if($i=="buffer"||$i=="uploaded"||$i=="downloaded") $kmg=true;//$v=toGb($v); 133 | if(!isset($haslast[$i])){ 134 | if($skipped){ $strdata.=", $v"; } 135 | }else{ 136 | $diff=$v-$last[$i]; 137 | $last[$i]=$v; 138 | if($skipped){ $strdata.=", $diff"; } 139 | } 140 | $o=$v; 141 | $d[$i]=round($o-$last[$i],2); 142 | $last[$i]=$o; 143 | } 144 | if(!$skipped)$skipped=1; 145 | } 146 | $title=""; 147 | foreach(str_split($c['d']) as $d){ 148 | $title.=", ".$indexconv[$d]; 149 | } 150 | ?> 151 |
    152 |
    153 |

    Custom Graph # (remove)

    154 |
    155 |
      156 | 157 |
    158 |
    159 |
    160 |
    161 | 180 |
    181 | 185 |
    186 |
    187 |
    188 |
    189 | 190 | 191 | 194 | -------------------------------------------------------------------------------- /www/css/application.css: -------------------------------------------------------------------------------- 1 | @import "reset.css"; 2 | 3 | /* General */ 4 | body { background: #fff url('../images/bg.gif') repeat-x 0 0; font: 62.5%/1.8em Helvetica, Arial, sans-serif; padding-bottom: 40px; } 5 | #wrapper { margin: 0 auto; width: 940px; } 6 | 7 | span.highlight, .required { color: #3777b2; } 8 | 9 | .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 10 | 11 | /* Header */ 12 | #header { height: 35px; position: relative; } 13 | #header h2#logo a { 14 | background: url('../images/logo.gif') no-repeat 0 0; 15 | display: block; 16 | height: 26px; 17 | overflow: hidden; 18 | position: relative; 19 | text-indent: -9999px; 20 | top: 4px; 21 | width: 128px; 22 | } 23 | 24 | #logged_in { 25 | font-size: 1.1em; 26 | position: absolute; 27 | right: 0; 28 | text-align: right; 29 | top: 2px; 30 | } 31 | 32 | #logged_in p { display: inline-block; height: 31px; line-height: 31px; } 33 | #logged_in a { color: #fff; font-weight: bold; text-decoration: none; } 34 | #logged_in a:hover { text-decoration: underline; } 35 | 36 | /* Navigation Bar */ 37 | #navigation_bar { 38 | height: 30px; 39 | position: relative; 40 | } 41 | 42 | #navigation_bar ul#navigation { padding-left: 1px; } 43 | #navigation_bar ul#navigation li { float: left; margin-left: -1px; } 44 | #navigation_bar ul#navigation li a { 45 | border: 1px solid #d7d7d7; 46 | border-bottom: 0; 47 | border-top: 0; 48 | color: #3777b2; 49 | display: block; 50 | font-size: 1.1em; 51 | font-weight: bold; 52 | height: 10px; 53 | line-height: 1em; 54 | padding: 10px; 55 | text-decoration: none; 56 | } 57 | 58 | body#user_page li#user_navitem, 59 | body#topten_page li#topten_navitem, 60 | body#preferences_page li#preferences_navitem, 61 | body#graphmanager_page li#graphmanager_navitem { background: #fff; } 62 | 63 | #navigation_bar ul#navigation li.active a, 64 | #navigation_bar ul#navigation li.active a:hover, 65 | #navigation_bar ul#navigation li a:hover { color: #000; } 66 | 67 | #navigation_bar form#search { 68 | position: absolute; 69 | text-align: right; 70 | top: 3px; 71 | right: 0; 72 | } 73 | #navigation_bar form#search input#su { color: #999; } 74 | 75 | /* Content general */ 76 | #content { color: #666; font-size: 1.2em; } 77 | #content a { color: #3777b2; } text-decoration: none; } 78 | #content a:hover { color: #000; } 79 | 80 | /* Page Header */ 81 | #page_header { border-bottom: 1px solid #ebebeb; padding: 20px 0; } 82 | #page_header h1 { color: #999; font-size: 2.4em; font-weight: bold; } 83 | #page_header h1 span { color: #3777b2; } 84 | 85 | /* Section Header */ 86 | .section_head { border-bottom: 1px solid #ebebeb; color: #666; font-size: 1.1em; margin-bottom: -1px; padding: 8px 0; } 87 | .section_head .primary { float: left; font-weight: bold; } 88 | .section_head .primary h3 { color: #3777b2; } 89 | .section_head .primary h3 span { color: #999; } 90 | .section_head .secondary { float: right; text-align: right; } 91 | .section_head a { color: #3777b2; text-decoration: none; } 92 | .section_head a:hover { color: #000; text-decoration: underline; } 93 | .section_head ul.section_head_links li { display: inline; padding: 2px 6px; } 94 | .section_head ul.section_head_links li.active { 95 | background: #3777b2; 96 | border-radius: 5px; 97 | -moz-border-radius: 5px; 98 | -webkit-border-radius: 5px; 99 | } 100 | .section_head ul.section_head_links li.active a { color: #fff !important; } 101 | .section_head ul.section_head_links li.active a:hover { text-decoration: none; } 102 | 103 | /* Statistics Summary */ 104 | #statistics_summary strong { color: #3777b2; } 105 | 106 | #statistics_summary .summary_content_container { 107 | height: 60px; 108 | overflow: hidden; 109 | padding-top: 1px; 110 | position: relative; 111 | } 112 | 113 | #statistics_summary ul.summary_content { 114 | background: #fafafa; 115 | border-top: 1px solid #ebebeb; 116 | font-size: 1.2em; 117 | left: 0; 118 | margin-top: -1px; 119 | } 120 | #statistics_summary ul.summary_content li { float: left; } 121 | #statistics_summary ul.summary_content li { 122 | background: #fafafa; 123 | border-bottom: 1px solid #ebebeb; 124 | border-left: 1px solid #fff; 125 | color: #666; 126 | display: block; 127 | padding: 18px 10px 20px; 128 | text-align: center; 129 | text-decoration: none; 130 | width: 210px; 131 | } 132 | #statistics_summary ul.summary_content li span { color: #333; font-size: 1.6em; margin-right: 2px; position: relative; top: 3px; } 133 | #statistics_summary ul.summary_content li.past_24 { border-left: 0; } 134 | #statistics_summary ul.summary_content li.past_week, #statistics_summary ul.summary_content li.past_month { width: 219px; } 135 | #statistics_summary ul.summary_content li.all_time { width: 209px; } 136 | 137 | #statistics_summary ul.summary_content li.positive { background: #daf0d0; color: #59ad2f; } 138 | #statistics_summary ul.summary_content li.positive span { color: #3d7c1e; } 139 | #statistics_summary ul.summary_content li.negative { background: #F8CBD7; color: #AD2F42; } 140 | #statistics_summary ul.summary_content li.negative span { color: #802A29 } 141 | #statistics_summary ul.summary_content li.minimal { background: #CFEFF8; color: #2D89A9; } 142 | #statistics_summary ul.summary_content li.minimal span { color: #2C7080 } 143 | 144 | /* Hourly Statistics */ 145 | #hourly_statistics table.hourly_statistics_table { border-collapse: collapse; width: 100%; } 146 | #hourly_statistics table.hourly_statistics_table tr th { color: #333; font-weight: bold; text-align: left; } 147 | #hourly_statistics table.hourly_statistics_table span.all-time { color: #aaa; } 148 | #hourly_statistics table.hourly_statistics_table tr td, #hourly_statistics table.hourly_statistics_table tr th { border: 1px solid #ebebeb; border-right: 0; padding: 4px; } 149 | #hourly_statistics table.hourly_statistics_table tr td:first-child, #hourly_statistics table.hourly_statistics_table tr th:first-child { border-left: 0; } 150 | 151 | #hourly_statistics table.hourly_statistics_table tr:hover td { background: #f3f3f3; color: #000; } 152 | #hourly_statistics table.hourly_statistics_table tr:hover td span.all-time { color: #666; } 153 | 154 | #hourly_statistics table.hourly_statistics_table td.positive { background: #daf0d0 !important; color: #3d7c1e !important; } 155 | #hourly_statistics table.hourly_statistics_table td.positive span.all-time { color: #59ad2f !important; } 156 | #hourly_statistics table.hourly_statistics_table td.negative { background: #F8CBD7 !important; color: #802A29 !important; } 157 | #hourly_statistics table.hourly_statistics_table td.negative span.all-time { color: #AD2F42 !important; } 158 | #hourly_statistics table.hourly_statistics_table td.minimal { background: #CFEFF8 !important; color: #2C7080 !important; } 159 | #hourly_statistics table.hourly_statistics_table td.minimal span.all-time { color: #2D89A9 !important; } 160 | 161 | /* Graphs */ 162 | #custom_graphs { border-top: 1px solid #ebebeb; } 163 | #graphmanager_page #custom_graphs { border-bottom: 0; } 164 | #custom_graphs .graph .graph_head, #graphs .graph .graph_head { border-bottom: 1px solid #ebebeb; border-top: 1px solid #ebebeb; color: #666; font-size: 1.1em; margin-bottom: -1px; padding: 8px 0; } 165 | #custom_graphs .graph .graph_head .primary, #graphs .graph .graph_head .primary { float: left; } 166 | #custom_graphs .graph .graph_head .secondary, #graphs .graph .graph_head .secondary { float: right; text-align: right; } 167 | #custom_graphs .graph .graph_head .primary h4, #graphs .graph .graph_head .primary h4 { color: #333; } 168 | #custom_graphs .graph .graph_head .secondary ul.graph_key, #graphs .graph .graph_head .secondary ul.graph_key { color: #aaa; } 169 | #custom_graphs .graph .graph_head .secondary ul.graph_key li, #graphs .graph .graph_head .secondary ul.graph_key li { display: inline; margin-left: 10px; padding-left: 15px; } 170 | #custom_graphs .graph .graph_head .secondary ul.graph_key li span, #graphs .graph .graph_head .secondary ul.graph_key li span { background: #fff; padding-left: 5px; } 171 | #custom_graphs .graph .graph_body, #graphs .graph .graph_body { padding: 10px 0; } 172 | 173 | /* Top Ten */ 174 | #topten_list table { border-collapse: collapse; width: 100%; } 175 | #topten_list table tr th { color: #333; font-weight: bold; text-align: left; } 176 | #topten_list table span.all-time { color: #aaa; } 177 | #topten_list table tr td, #topten_list table tr th { border: 1px solid #ebebeb; border-right: 0; padding: 4px; } 178 | #topten_list table tr td:first-child, #topten_list table tr th:first-child { border-left: 0; } 179 | #topten_list table tr:hover td { background: #f3f3f3; color: #000; } 180 | #topten_list table tr:hover td a:hover { color: #000; } 181 | 182 | #topten_list #day-active .day, #topten_list #week-active .week, #topten_list #month-active .month, #topten_list #year-active .year { 183 | background: #3777b2; 184 | border-radius: 5px; 185 | -moz-border-radius: 5px; 186 | -webkit-border-radius: 5px; 187 | } 188 | #topten_list #day-active .day a, #topten_list #week-active .week a, #topten_list #month-active .month a, #topten_list #year-active .year a { color: #fff; } 189 | #topten_list #day-active .day a:hover, #topten_list #week-active .week a:hover, #topten_list #month-active .month a:hover, #topten_list #year-active .year a:hover { text-decoration: none; } 190 | 191 | /* Preferences */ 192 | #content form.preferences_form { border-bottom: 1px solid #ebebeb; margin-top: -1px; } 193 | #content form.preferences_form fieldset .description { 194 | border-left: 1px solid #ebebeb; 195 | border-top: 1px solid #ebebeb; 196 | float: right; 197 | margin-left: -1px; 198 | padding: 10px; 199 | padding-right: 0; 200 | width: 279px; 201 | } 202 | 203 | #content form.preferences_form fieldset .description h3 { color: #3777b2; font-size: 1.2em; margin-bottom: .5em; } 204 | 205 | #content form.preferences_form fieldset ol { 206 | border-right: 1px solid #ebebeb; 207 | display: block; 208 | float: left; 209 | width: 650px; 210 | } 211 | #content form.preferences_form fieldset ol li { 212 | border-top: 1px solid #ebebeb; 213 | display: block; 214 | padding: 10px 0; 215 | } 216 | #content form.preferences_form fieldset ol li label { 217 | color: #3777b2; 218 | display: inline-block; 219 | font-weight: bold; 220 | position: relative; 221 | top: 4px; 222 | width: 180px; 223 | vertical-align: top; 224 | } 225 | #content form.preferences_form fieldset ol li input[type=text], #content form.preferences_form fieldset ol li textarea { 226 | border: 1px solid #ccc; 227 | color: #666; 228 | font-family: inherit; 229 | font-size: 1.1em; 230 | margin: 0; 231 | padding: 4px; 232 | } 233 | #content form.preferences_form fieldset ol li input[type=text] { width: 350px; } 234 | #content form.preferences_form fieldset ol li input[type=file] { margin-top: 4px; } 235 | #content form.preferences_form fieldset ol li textarea { height: 100px; width: 350px; } 236 | 237 | #content form.preferences_form fieldset.form_submit_buttons { border-top: 1px solid #ebebeb; } 238 | #content form.preferences_form fieldset.form_submit_buttons ol { border-right: 0; } 239 | #content form.preferences_form fieldset.form_submit_buttons ol li { border-top: 0; padding-left: 180px; } 240 | 241 | /* Graph Manager */ 242 | #graph_manager table.custom_graph_table { border-collapse: collapse; width: 100%; } 243 | #graph_manager table.custom_graph_table tr th { color: #333; font-weight: bold; text-align: left; } 244 | #graph_manager table.custom_graph_table span.all-time { color: #aaa; } 245 | #graph_manager table.custom_graph_table tr td, #graph_manager table.custom_graph_table tr th { border: 1px solid #ebebeb; border-right: 0; padding: 4px; } 246 | #graph_manager table.custom_graph_table tr td:first-child, #graph_manager table.custom_graph_table tr th:first-child { border-left: 0; } 247 | 248 | #graph_manager table.custom_graph_table tr:hover td { background: #f3f3f3; color: #000; } 249 | #graph_manager table.custom_graph_table tr:hover td a:hover { color: #000; } -------------------------------------------------------------------------------- /www/config.inc.php: -------------------------------------------------------------------------------- 1 | 1152921504606846976,"PB"=>1125899906842624,"TB"=>1099511627776,"GB"=>1073741824,"MB"=>1048576,"KB"=>1024,"B"=>1); 8 | $conv=$conv[$str[1]]; 9 | return floatval($str[0])*$conv; 10 | } 11 | function toGb($bytes){ 12 | return round($bytes/(1024*1024*1024),2); 13 | } 14 | function getByteStr($b){ 15 | $i=0; 16 | $conv=array("B","KB","MB","GB","TB","PB","EB"); 17 | while(abs($b)>=1024){ 18 | $i++; 19 | $b/=1024; 20 | } 21 | $b=round($b,2); 22 | return "$b {$conv[$i]}"; 23 | } 24 | global $OHS; 25 | if(!isset($OHS)){ 26 | session_set_cookie_params(60*60*24*365); 27 | session_start(); 28 | if(!isset($_SESSION['whatauth'])||!isset($_SESSION['username'])){ 29 | if(!isset($_POST['pass'])||$_POST['pass']!="$site_pw"){ 30 | ?> 31 | 32 | 33 | 34 | 57 | 58 | 59 |
    Sherlock (what.cd)
    60 | {$err[$_GET['err']]}
    "; 69 | } 70 | ?> 71 |
    72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 |
    Username 
    Password 
    85 |
    86 | 87 | 88 | "uploaded , upType", 159 | "d"=>"downloaded , downType", 160 | "r"=>"ratio", 161 | "b"=>"buffer , buffType", 162 | "p"=>"uploads", 163 | "s"=>"snatched", 164 | "l"=>"leeching", 165 | "e"=>"seeding", 166 | "f"=>"forumPosts", 167 | "c"=>"torrentComments", 168 | //"t"=>"date", 169 | "h"=>"hourlyRatio" 170 | ); 171 | $sqlstr="SELECT"; 172 | foreach($information as $i){ 173 | $sqlstr.=" {$dbmap[$i]} , "; 174 | } 175 | $sqlconnection=mysql_connect($sqlserver,$sqluser,$sqlpw); 176 | mysql_select_db($sqldb,$sqlconnection); 177 | $sqlstr.="date\nFROM $sqltable\nWHERE username = '".mysql_real_escape_string($_SESSION['username'])."' AND `date` > '$startDate'\nORDER BY `date` ASC"; 178 | $sqlquery=mysql_query($sqlstr,$sqlconnection); 179 | if(mysql_num_rows($sqlquery)==0){ 180 | 181 | } 182 | while($r=mysql_fetch_assoc($sqlquery)){ 183 | $date=strtotime($r['date']); 184 | $thisrow=array(); 185 | foreach($r as $thisri=>$thisrv){ 186 | switch($thisri){ 187 | case "uploaded": 188 | $thisrow["uploaded"]=getBytes("$thisrv {$r['upType']}"); 189 | break; 190 | case "downloaded": 191 | $thisrow["downloaded"]=getBytes("$thisrv {$r['downType']}"); 192 | break; 193 | case "buffer": 194 | $thisrow["buffer"]=getBytes("$thisrv {$r['buffType']}"); 195 | break; 196 | case "date": 197 | $thisrow["date"]=strtotime($thisrv)+$offset; 198 | break; 199 | default: 200 | if(strstr($thisri,"Type")) continue; 201 | $thisrow[$thisri]=floatval($thisrv); 202 | } 203 | 204 | } 205 | $data[$thisrow["date"]]=$thisrow; 206 | } 207 | mysql_close($sqlconnection); 208 | return $data; 209 | } 210 | 211 | function timeSpan($username,$duration="day"){ 212 | global $sqlserver, $sqluser, $sqlpw, $sqldb; 213 | $data=array(); 214 | switch($duration){ 215 | case "week": 216 | $startDate = date("Y-m-d H:i:s",time()-60*60*24*7); 217 | break; 218 | case "month": 219 | $startDate = date("Y-m-d H:i:s",time()-60*60*24*30); 220 | break; 221 | case "year": 222 | $startDate = date("Y-m-d H:i:s",time()-60*60*24*365); 223 | break; 224 | case "day": 225 | default: 226 | $startDate = date("Y-m-d H:i:s",time()-60*60*24); 227 | break; 228 | } 229 | $sqlconnection=mysql_connect($sqlserver,$sqluser,$sqlpw); 230 | mysql_select_db($sqldb,$sqlconnection); 231 | $sth=mysql_query("SELECT * FROM statistics WHERE username = '$username' && date < '$startDate' ORDER BY date DESC LIMIT 1", $sqlconnection); 232 | $substh=mysql_query("SELECT * FROM statistics WHERE username = '$username' ORDER BY date DESC LIMIT 1", $sqlconnection); 233 | $past = mysql_fetch_assoc($sth); 234 | $present = mysql_fetch_assoc($substh); 235 | foreach($present as $i=>$v){ 236 | switch($i){ 237 | case "uploaded": 238 | $data[$i]=getBytes("{$present['uploaded']} {$present['upType']}")- 239 | getBytes("{$past['uploaded']} {$past['upType']}"); 240 | break; 241 | case "downloaded": 242 | $data[$i]=getBytes("{$present['downloaded']} {$present['downType']}")- 243 | getBytes("{$past['downloaded']} {$past['downType']}"); 244 | break; 245 | case "buffer": 246 | $data[$i]=getBytes("{$present['buffer']} {$present['buffType']}")- 247 | getBytes("{$past['buffer']} {$past['buffType']}"); 248 | break; 249 | default: 250 | if(strstr($i,"Type")||$i=="date"||$i=="id") continue; 251 | $data[$i]=floatval($present[$i])-floatval($past[$i]); 252 | } 253 | } 254 | return $data; 255 | } 256 | 257 | function currentStats($username){ 258 | global $sqlserver, $sqluser, $sqlpw, $sqldb; 259 | $data=array(); 260 | $sqlconnection=mysql_connect($sqlserver,$sqluser,$sqlpw); 261 | mysql_select_db($sqldb,$sqlconnection); 262 | $substh=mysql_query("SELECT * FROM statistics WHERE username = '$username' ORDER BY date DESC LIMIT 1", $sqlconnection); 263 | $present = mysql_fetch_assoc($substh); 264 | if(!is_array($present)) return -1; 265 | foreach($present as $i=>$v){ 266 | switch($i){ 267 | case "uploaded": 268 | $data[$i]=getBytes("{$present['uploaded']} {$present['upType']}"); 269 | break; 270 | case "downloaded": 271 | $data[$i]=getBytes("{$present['downloaded']} {$present['downType']}"); 272 | break; 273 | case "buffer": 274 | $data[$i]=getBytes("{$present['buffer']} {$present['buffType']}"); 275 | break; 276 | default: 277 | if(strstr($i,"Type")||$i=="date"||$i=="id") continue; 278 | $data[$i]=floatval($present[$i]); 279 | } 280 | } 281 | return $data; 282 | } 283 | 284 | function topTen($information,$duration){ 285 | global $sqlserver, $sqluser, $sqlpw, $sqldb; 286 | $topten=array(); 287 | $data=array(); 288 | $sqltable="statistics"; 289 | $information=str_split($information); 290 | $sqlstr="SELECT ".$dbmap[$information[0]]; 291 | switch($duration){ 292 | case "week": 293 | $startDate = date("Y-m-d H:i:s",time()-60*60*24*7); 294 | $checkDate = $startDate = date("Y-m-d H:i:s",time()-60*60*24*14); 295 | break; 296 | case "month": 297 | $startDate = date("Y-m-d H:i:s",time()-60*60*24*30); 298 | $checkDate = $startDate = date("Y-m-d H:i:s",time()-60*60*24*37); 299 | break; 300 | case "year": 301 | $startDate = date("Y-m-d H:i:s",time()-60*60*24*365); 302 | $checkDate = date("Y-m-d H:i:s",time()-60*60*24*370); 303 | break; 304 | case "day": 305 | default: 306 | $startDate = date("Y-m-d H:i:s",time()-60*60*24); 307 | $checkDate = date("Y-m-d H:i:s",time()-60*60*24*2); 308 | break; 309 | } 310 | $sqlconnection=mysql_connect($sqlserver,$sqluser,$sqlpw); 311 | mysql_select_db($sqldb,$sqlconnection); 312 | $userSth=mysql_query("SELECT username FROM usernames",$sqlconnection); 313 | while($username=mysql_fetch_row($userSth)){ 314 | $username=$username[0]; 315 | $sth=mysql_query("SELECT buffer, buffType FROM statistics WHERE username = '$username' && date < '$startDate' ORDER BY date DESC LIMIT 1", $sqlconnection); 316 | if(mysql_num_rows($sth) > 0){ 317 | if($substh=mysql_query("SELECT buffer, buffType FROM statistics WHERE username = '$username' ORDER BY date DESC LIMIT 1", $sqlconnection)){ 318 | $past = mysql_fetch_row($sth); 319 | $present = mysql_fetch_row($substh); 320 | list ($change, $changeType) = calculateBuffer($present[0],$present[1],$past[0],$past[1]); 321 | if($change == 0) { continue; } 322 | $unsorted = array($username, getBytes("$change $changeType")); 323 | array_push($topten, $unsorted); 324 | }} 325 | } 326 | uasort($topten,'top10sort'); 327 | //$topten=array_chunk($topten,10); 328 | return $topten;//[0]; 329 | } 330 | function top10sort($a, $b) { 331 | if ($a[1] == $b[1]) { 332 | return 0; 333 | } 334 | return ($a[1] < $b[1]) ? 1 : -1; 335 | } 336 | 337 | function calculateBuffer($uploaded, $uploadedType, $downloaded, $downloadedType) { 338 | if($uploaded && $downloaded) { 339 | if ($downloadedType == "b") { $dBuffer = $downloaded / 8388608; } 340 | elseif ($downloadedType == 'B') { $dBuffer = $downloaded / 1048576; } 341 | elseif ($downloadedType == 'KB') { $dBuffer = $downloaded / 1024; } 342 | elseif ($downloadedType == 'MB') { $dBuffer = $downloaded; } 343 | elseif ($downloadedType == 'GB') { $dBuffer = $downloaded * 1024; } 344 | elseif ($downloadedType == 'TB') { $dBuffer = $downloaded * 1048576; } 345 | elseif ($downloadedType == 'PB') { $dBuffer = $downloaded * 1073741824; } 346 | elseif ($downloadedType == 'EB') { $dBuffer = $downloaded * 1099511627776; } 347 | 348 | if ($uploadedType == 'b') { $buffer = $uploaded / 8388608; } 349 | elseif ($uploadedType == 'B') { $buffer = $uploaded / 1048576; } 350 | elseif ($uploadedType == 'KB') { $buffer = $uploaded / 1024; } 351 | elseif ($uploadedType == 'MB') { $buffer = $uploaded; } 352 | elseif ($uploadedType == 'GB') { $buffer = $uploaded * 1024; } 353 | elseif ($uploadedType == 'TB') { $buffer = $uploaded * 1048576; } 354 | elseif ($uploadedType == 'PB') { $buffer = $uploaded * 1073741824; } 355 | elseif ($uploadedType == 'EB') { $buffer = $uploaded * 1099511627776; } 356 | 357 | #Convert buffer to the appropriate power 358 | if($dBuffer==0) $dBuffer=1; 359 | $ratio = $buffer / $dBuffer; 360 | $buffer -= $dBuffer; 361 | $bufferType = 'MB'; 362 | $temp = abs($buffer); 363 | if ($temp > 1099511627776) { $buffer /= 1099511627776; $buffer = sprintf("%.2f", $buffer); $bufferType = 'EB'; } 364 | elseif ($temp > 1073741824) { $buffer /= 1073741824; $buffer = sprintf("%.2f", $buffer); $bufferType = 'PB'; } 365 | elseif ($temp > 1048576) { $buffer /= 1048576; $buffer = sprintf("%.2f", $buffer); $bufferType = 'TB'; } 366 | elseif ($temp >= 1024) { $buffer /= 1024; $buffer = sprintf("%.2f", $buffer); $bufferType = 'GB'; } 367 | elseif ($temp < 1024 && $temp >= 1) { $buffer = sprintf("%.2f", $buffer); } 368 | elseif ($temp > 0.0009765625) { $buffer *= 1024; $buffer = sprintf("%.2f", $buffer); $bufferType = 'KB'; } 369 | elseif ($temp > 0.000000953674) { $buffer *= 1048576; $buffer = sprintf("%.2f", $buffer); $bufferType = 'B'; } 370 | elseif ($temp > 0.00000011920929) { $buffer *= 8388608; $buffer = sprintf("%.2f", $buffer); $bufferType = 'b'; } 371 | } 372 | elseif(!$uploaded) { return array(-$downloaded, $downloadedType, 0); } 373 | elseif(!$downloaded) { return array($uploaded, $uploadedType, 0); } 374 | return array($buffer, $bufferType, $ratio); 375 | } 376 | ?> 377 | -------------------------------------------------------------------------------- /www/index.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | Sherlock - The IRC Search Bot & Ratio Monitoring Service 14 | 15 | 16 | 17 | 18 | 19 | 20 |
    21 | 25 | 26 | 38 | 39 |
    40 | 43 | 44 |
    45 |
    46 |
    47 |

    Summary Buffer

    48 |
    49 |
    50 | 56 |
    57 |
    58 |
    59 | 0) { 81 | $daybufferclass = abs($daybuffer) > 3221225472 ? "positive" : "minimal"; 82 | } elseif($daybuffer<0) { 83 | $daybufferclass = "negative"; 84 | } 85 | 86 | // get threshold used for display rows 87 | $threshold = ($day['uploaded'] / 24) * 1.3; 88 | 89 | // Check class for past week buffer 90 | $weekbufferclass = ""; 91 | if($weekbuffer>0) { 92 | $weekbufferclass = abs($weekbuffer) > 3221225472 ? "positive" : "minimal"; 93 | } elseif($weekbuffer<0) { 94 | $weekbufferclass = "negative"; 95 | } 96 | 97 | // Check class for past month buffer 98 | $monthbufferclass = ""; 99 | if($monthbuffer>0) { 100 | $monthbufferclass = abs($monthbuffer) > 3221225472 ? "positive" : "minimal"; 101 | } elseif($monthbuffer<0) { 102 | $monthbufferclass = "negative"; 103 | } 104 | 105 | // Check class for past 24 hour ratio 106 | $dayratioclass = ""; 107 | if($dayratio>0) { 108 | $dayratioclass = abs($dayratio) > 0.05 ? "positive" : "minimal"; 109 | } elseif($dayratio<0) { 110 | $dayratioclass = "negative"; 111 | } 112 | 113 | // Check class for past week ratio 114 | $weekratioclass = ""; 115 | if($weekratio>0) { 116 | $weekratioclass = abs($weekratio) > 0.05 ? "positive" : "minimal"; 117 | } elseif($weekratio<0) { 118 | $weekratioclass = "negative"; 119 | } 120 | 121 | // Check class for past month ratio 122 | $monthratioclass = ""; 123 | if($monthratio>0) { 124 | $monthratioclass = abs($monthratio) > 0.05 ? "positive" : "minimal"; 125 | } elseif($monthratio<0) { 126 | $monthratioclass = "negative"; 127 | } 128 | ?> 129 |
      130 |
    • "> past 24 hours
    • 131 |
    • "> past week
    • 132 |
    • "> past month
    • 133 |
    • "> all-time
    • 134 |
    135 |
      136 |
    • past 24 hours
    • 137 |
    • past week
    • 138 |
    • past month
    • 139 |
    • all-time
    • 140 |
    141 |
      142 |
    • "> past 24 hours
    • 143 |
    • "> past week
    • 144 |
    • "> past month
    • 145 |
    • "> all-time
    • 146 |
    147 |
      148 |
    • "> past 24 hours
    • 149 |
    • "> past week
    • 150 |
    • "> past month
    • 151 |
    • "> all-time
    • 152 |
    153 |
    154 |
    155 | 156 |
    157 |
    158 |

    Hourly Statistics

    159 |
    160 |
    161 |
    162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | ".getByteStr($diffup)."(".getByteStr($up).")"; 187 | $down=$d["downloaded"]; 188 | $diffdown=$down-$lastdown; 189 | $lastdown=$down; 190 | $fdown="".getByteStr($diffdown)."(".getByteStr($down).")"; 191 | $buffer=$d["buffer"]; 192 | $diffbuff=$buffer-$lastbuff; 193 | $lastbuff=$buffer; 194 | 195 | $bufferclass = ""; 196 | $overrange = false; 197 | if(abs($diffbuff) > $threshold){ $overrange = true; } 198 | if($diffbuff==0) { 199 | $bufferclass = "none"; 200 | } elseif($diffbuff>0) { 201 | $bufferclass = $overrange ? "positive" : "minimal"; 202 | } else { 203 | $bufferclass = "negative"; 204 | } 205 | 206 | $fbuff="".getByteStr($diffbuff)."(".getByteStr($buffer).")"; 207 | $ratio=number_format($d["ratio"],4); 208 | $diffratio=number_format($ratio-$lastratio,4); 209 | $lastratio=$ratio; 210 | $hourlyratio=$d["hourlyRatio"]; 211 | # $fratio="$hourlyratio ($ratio)"; 212 | $fratio="$diffratio ($ratio)"; 213 | if(!$skip){ 214 | echo "\n"; 215 | }else{ 216 | $skip--; 217 | } 218 | } 219 | ?> 220 | 221 |
    TimeUploadDownloadBufferRatio
    $time$fup$fdown$fbuff$fratio
    222 |
    223 |
    224 | 225 |
    226 |

    Graphs

    227 |
    228 |
    229 |
    230 |

    Upload and download (per hour)

    231 |
    232 |
      233 |
    • Upload
    • 234 |
    • Download
    • 235 |
    236 |
    237 |
    238 |
    239 |
    240 | 241 |
    242 |
    243 |

    Upload and download (total)

    244 |
    245 |
      246 |
    • Upload
    • 247 |
    • Download
    • 248 |
    249 |
    250 |
    251 |
    252 |
    253 | 254 |
    255 |
    256 |

    Buffer

    257 |
    258 |
      259 |
    • Buffer
    • 260 |
    261 |
    262 |
    263 |
    264 |
    265 | 266 |
    267 |
    268 |

    Ratio

    269 |
    270 |
      271 |
    • Ratio
    • 272 |
    273 |
    274 |
    275 |
    276 |
    277 |
    278 |
    279 | 280 | 281 |
    282 |

    Custom Graphs

    283 |
    284 | $cgraph){ 286 | $i2=$i; 287 | $kmg=false; 288 | $c=array(); 289 | parse_str(parse_url($cgraph,PHP_URL_QUERY),$c); 290 | $data=getData($c['d'],getGS()); 291 | $haslast=str_split($c['c']); 292 | $indexconv=array("u"=>"uploaded", 293 | "d"=>"downloaded", 294 | "r"=>"ratio", 295 | "b"=>"buffer", 296 | "p"=>"uploads", 297 | "s"=>"snatched", 298 | "l"=>"leeching", 299 | "e"=>"seeding", 300 | "f"=>"forumPosts", 301 | "c"=>"torrentComments", 302 | "h"=>"hourlyRatio" 303 | ); 304 | $statcolors=array("u"=>"#ca8080", 305 | "d"=>"#6C8ABD", 306 | "r"=>"#CA9E6B", 307 | "b"=>"#88CA97", 308 | "p"=>"#6db8bd", 309 | "s"=>"#b9bd6d", 310 | "l"=>"#b07eb3", 311 | "e"=>"#b38d7e", 312 | "f"=>"#b3ab7f", 313 | "c"=>"#7fb393", 314 | "h"=>"#dd9745" 315 | ); 316 | foreach($haslast as $thislasti=>$thislastv){ 317 | $haslast[$indexconv[$thislastv]]=1; 318 | unset($haslast[$thislasti]); 319 | } 320 | $last=array(); 321 | $gdata=array(); 322 | $skipped=0; 323 | $strdata="date"; 324 | foreach(str_split($c['d']) as $d){ 325 | $strdata.=", ".$indexconv[$d]; 326 | } 327 | $graph_key = ""; 328 | foreach(str_split($c['d']) as $d){ 329 | $graph_key .= "
  • ".$indexconv[$d]."
  • "; 330 | } 331 | $graph_colors = ""; 332 | foreach(str_split($c['d']) as $d){ 333 | $graph_colors .= "'".$statcolors[$d]."',"; 334 | } 335 | rtrim($graph_colors,","); 336 | foreach($data as $d){ 337 | $strdata.=" \\n ".date("Y/m/d H:i:00",$d["date"]); 338 | foreach($d as $i=>$v){ 339 | if($i=="date") continue; 340 | if($i=="buffer"||$i=="uploaded"||$i=="downloaded") $kmg=true;//$v=toGb($v); 341 | if(!isset($haslast[$i])){ 342 | if($skipped){ $strdata.=", $v"; } 343 | }else{ 344 | $diff=$v-$last[$i]; 345 | $last[$i]=$v; 346 | if($skipped){ $strdata.=", $diff"; } 347 | } 348 | $o=$v; 349 | $d[$i]=round($o-$last[$i],2); 350 | $last[$i]=$o; 351 | } 352 | if(!$skipped)$skipped=1; 353 | } 354 | $title=""; 355 | foreach(str_split($c['d']) as $d){ 356 | $title.=", ".$indexconv[$d]; 357 | } 358 | ?> 359 |
    360 |
    361 |

    Custom Graph #

    362 |
    363 |
      364 | 365 |
    366 |
    367 |
    368 |
    369 | 388 |
    389 | 390 |
    391 |
    392 | 393 |
    394 |
    395 | 519 | 520 | 521 | -------------------------------------------------------------------------------- /www/js/raphael-min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Raphael 1.3.1 - JavaScript Vector Library 3 | * 4 | * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com) 5 | * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. 6 | */ 7 | Raphael=(function(){var a=/[, ]+/,aO=/^(circle|rect|path|ellipse|text|image)$/,L=document,au=window,l={was:"Raphael" in au,is:au.Raphael},an=function(){if(an.is(arguments[0],"array")){var d=arguments[0],e=w[aW](an,d.splice(0,3+an.is(d[0],al))),S=e.set();for(var R=0,a0=d[m];R

    ";if(ag.childNodes[m]!=2){return null;}}an.svg=!(an.vml=an.type=="VML");aT[aY]=an[aY];an._id=0;an._oid=0;an.fn={};an.is=function(e,d){d=aZ.call(d);return((d=="object"||d=="undefined")&&typeof e==d)||(e==null&&d=="null")||aZ.call(aw.call(e).slice(8,-1))==d;};an.setWindow=function(d){au=d;L=au.document;};var aD=function(e){if(an.vml){var d=/^\s+|\s+$/g;aD=aj(function(R){var S;R=(R+at)[aP](d,at);try{var a0=new ActiveXObject("htmlfile");a0.write("");a0.close();S=a0.body;}catch(a2){S=createPopup().document.body;}var i=S.createTextRange();try{S.style.color=R;var a1=i.queryCommandValue("ForeColor");a1=((a1&255)<<16)|(a1&65280)|((a1&16711680)>>>16);return"#"+("000000"+a1[aA](16)).slice(-6);}catch(a2){return"none";}});}else{var E=L.createElement("i");E.title="Rapha\xebl Colour Picker";E.style.display="none";L.body[aL](E);aD=aj(function(i){E.style.color=i;return L.defaultView.getComputedStyle(E,at).getPropertyValue("color");});}return aD(e);};an.hsb2rgb=aj(function(a3,a1,a7){if(an.is(a3,"object")&&"h" in a3&&"s" in a3&&"b" in a3){a7=a3.b;a1=a3.s;a3=a3.h;}var R,S,a8;if(a7==0){return{r:0,g:0,b:0,hex:"#000"};}if(a3>1||a1>1||a7>1){a3/=255;a1/=255;a7/=255;}var a0=~~(a3*6),a4=(a3*6)-a0,E=a7*(1-a1),e=a7*(1-(a1*a4)),a9=a7*(1-(a1*(1-a4)));R=[a7,e,E,E,a9,a7,a7][a0];S=[a9,a7,a7,e,E,E,a9][a0];a8=[E,E,a9,a7,a7,e,E][a0];R*=255;S*=255;a8*=255;var a5={r:R,g:S,b:a8},d=(~~R)[aA](16),a2=(~~S)[aA](16),a6=(~~a8)[aA](16);d=d[aP](aU,"0");a2=a2[aP](aU,"0");a6=a6[aP](aU,"0");a5.hex="#"+d+a2+a6;return a5;},an);an.rgb2hsb=aj(function(d,e,a1){if(an.is(d,"object")&&"r" in d&&"g" in d&&"b" in d){a1=d.b;e=d.g;d=d.r;}if(an.is(d,"string")){var a3=an.getRGB(d);d=a3.r;e=a3.g;a1=a3.b;}if(d>1||e>1||a1>1){d/=255;e/=255;a1/=255;}var a0=g(d,e,a1),i=aI(d,e,a1),R,E,S=a0;if(i==a0){return{h:0,s:0,b:a0};}else{var a2=(a0-i);E=a2/a0;if(d==a0){R=(e-a1)/a2;}else{if(e==a0){R=2+((a1-d)/a2);}else{R=4+((d-e)/a2);}}R/=6;R<0&&R++;R>1&&R--;}return{h:R,s:E,b:S};},an);var aE=/,?([achlmqrstvxz]),?/gi;an._path2string=function(){return this.join(",")[aP](aE,"$1");};function aj(E,e,d){function i(){var R=Array[aY].slice.call(arguments,0),a0=R[az]("\u25ba"),S=i.cache=i.cache||{},a1=i.count=i.count||[];if(S[Q](a0)){return d?d(S[a0]):S[a0];}a1[m]>=1000&&delete S[a1.shift()];a1[f](a0);S[a0]=E[aW](e,R);return d?d(S[a0]):S[a0];}return i;}an.getRGB=aj(function(d){if(!d||!!((d=d+at).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1};}if(d=="none"){return{r:-1,g:-1,b:-1,hex:"none"};}!(({hs:1,rg:1})[Q](d.substring(0,2))||d.charAt()=="#")&&(d=aD(d));var S,i,E,a2,a3,a0=d.match(x);if(a0){if(a0[2]){a2=G(a0[2].substring(5),16);E=G(a0[2].substring(3,5),16);i=G(a0[2].substring(1,3),16);}if(a0[3]){a2=G((a3=a0[3].charAt(3))+a3,16);E=G((a3=a0[3].charAt(2))+a3,16);i=G((a3=a0[3].charAt(1))+a3,16);}if(a0[4]){a0=a0[4][z](/\s*,\s*/);i=W(a0[0]);E=W(a0[1]);a2=W(a0[2]);}if(a0[5]){a0=a0[5][z](/\s*,\s*/);i=W(a0[0])*2.55;E=W(a0[1])*2.55;a2=W(a0[2])*2.55;}if(a0[6]){a0=a0[6][z](/\s*,\s*/);i=W(a0[0]);E=W(a0[1]);a2=W(a0[2]);return an.hsb2rgb(i,E,a2);}if(a0[7]){a0=a0[7][z](/\s*,\s*/);i=W(a0[0])*2.55;E=W(a0[1])*2.55;a2=W(a0[2])*2.55;return an.hsb2rgb(i,E,a2);}a0={r:i,g:E,b:a2};var e=(~~i)[aA](16),R=(~~E)[aA](16),a1=(~~a2)[aA](16);e=e[aP](aU,"0");R=R[aP](aU,"0");a1=a1[aP](aU,"0");a0.hex="#"+e+R+a1;return a0;}return{r:-1,g:-1,b:-1,hex:"none",error:1};},an);an.getColor=function(e){var i=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||0.75},d=this.hsb2rgb(i.h,i.s,i.b);i.h+=0.075;if(i.h>1){i.h=0;i.s-=0.2;i.s<=0&&(this.getColor.start={h:0,s:1,b:i.b});}return d.hex;};an.getColor.reset=function(){delete this.start;};an.parsePathString=aj(function(d){if(!d){return null;}var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=[];if(an.is(d,"array")&&an.is(d[0],"array")){e=av(d);}if(!e[m]){(d+at)[aP](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(R,E,a1){var a0=[],S=aZ.call(E);a1[aP](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(a3,a2){a2&&a0[f](+a2);});while(a0[m]>=i[S]){e[f]([E][aS](a0.splice(0,i[S])));if(!i[S]){break;}}});}e[aA]=an._path2string;return e;});an.findDotsAtSegment=function(e,d,be,bc,a0,R,a2,a1,a8){var a6=1-a8,a5=aM(a6,3)*e+aM(a6,2)*3*a8*be+a6*3*a8*a8*a0+aM(a8,3)*a2,a3=aM(a6,3)*d+aM(a6,2)*3*a8*bc+a6*3*a8*a8*R+aM(a8,3)*a1,ba=e+2*a8*(be-e)+a8*a8*(a0-2*be+e),a9=d+2*a8*(bc-d)+a8*a8*(R-2*bc+d),bd=be+2*a8*(a0-be)+a8*a8*(a2-2*a0+be),bb=bc+2*a8*(R-bc)+a8*a8*(a1-2*R+bc),a7=(1-a8)*e+a8*be,a4=(1-a8)*d+a8*bc,E=(1-a8)*a0+a8*a2,i=(1-a8)*R+a8*a1,S=(90-ab.atan((ba-bd)/(a9-bb))*180/ab.PI);(ba>bd||a91){bi=ab.sqrt(by)*bi;bg=ab.sqrt(by)*bg;}var E=bi*bi,br=bg*bg,bt=(a4==S?-1:1)*ab.sqrt(ab.abs((E*br-E*bn*bn-br*bo*bo)/(E*bn*bn+br*bo*bo))),bd=bt*bi*bn/bg+(a9+a8)/2,bc=bt*-bg*bo/bi+(bE+bD)/2,a3=ab.asin(((bE-bc)/bg).toFixed(7)),a2=ab.asin(((bD-bc)/bg).toFixed(7));a3=a9a2){a3=a3-R*2;}if(!S&&a2>a3){a2=a2-R*2;}}else{a3=bb[0];a2=bb[1];bd=bb[2];bc=bb[3];}var a7=a2-a3;if(ab.abs(a7)>bf){var be=a2,bh=a8,a5=bD;a2=a3+bf*(S&&a2>a3?1:-1);a8=bd+bi*ab.cos(a2);bD=bc+bg*ab.sin(a2);bm=K(a8,bD,bi,bg,ba,0,S,bh,a5,[a2,be,bd,bc]);}a7=a2-a3;var a1=ab.cos(a3),bC=ab.sin(a3),a0=ab.cos(a2),bB=ab.sin(a2),bp=ab.tan(a7/4),bs=4/3*bi*bp,bq=4/3*bg*bp,bz=[a9,bE],bx=[a9+bs*bC,bE-bq*a1],bw=[a8+bs*bB,bD-bq*a0],bu=[a8,bD];bx[0]=2*bz[0]-bx[0];bx[1]=2*bz[1]-bx[1];if(bb){return[bx,bw,bu][aS](bm);}else{bm=[bx,bw,bu][aS](bm)[az]()[z](",");var bk=[];for(var bv=0,bl=bm[m];bv1000000000000&&(a0=0.5);ab.abs(S)>1000000000000&&(S=0.5);if(a0>0&&a0<1){e=M(i,d,R,E,a9,a8,a5,a2,a0);a6[f](e.x);a3[f](e.y);}if(S>0&&S<1){e=M(i,d,R,E,a9,a8,a5,a2,S);a6[f](e.x);a3[f](e.y);}a7=(a8-2*E+d)-(a2-2*a8+E);a4=2*(E-d)-2*(a8-E);a1=d-E;a0=(-a4+ab.sqrt(a4*a4-4*a7*a1))/2/a7;S=(-a4-ab.sqrt(a4*a4-4*a7*a1))/2/a7;ab.abs(a0)>1000000000000&&(a0=0.5);ab.abs(S)>1000000000000&&(S=0.5);if(a0>0&&a0<1){e=M(i,d,R,E,a9,a8,a5,a2,a0);a6[f](e.x);a3[f](e.y);}if(S>0&&S<1){e=M(i,d,R,E,a9,a8,a5,a2,S);a6[f](e.x);a3[f](e.y);}return{min:{x:aI[aW](0,a6),y:aI[aW](0,a3)},max:{x:g[aW](0,a6),y:g[aW](0,a3)}};}),H=aj(function(a9,a4){var R=r(a9),a5=a4&&r(a4),a6={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a0=function(ba,bb){var i,bc;if(!ba){return["C",bb.x,bb.y,bb.x,bb.y,bb.x,bb.y];}!(ba[0] in {T:1,Q:1})&&(bb.qx=bb.qy=null);switch(ba[0]){case"M":bb.X=ba[1];bb.Y=ba[2];break;case"A":ba=["C"][aS](K[aW](0,[bb.x,bb.y][aS](ba.slice(1))));break;case"S":i=bb.x+(bb.x-(bb.bx||bb.x));bc=bb.y+(bb.y-(bb.by||bb.y));ba=["C",i,bc][aS](ba.slice(1));break;case"T":bb.qx=bb.x+(bb.x-(bb.qx||bb.x));bb.qy=bb.y+(bb.y-(bb.qy||bb.y));ba=["C"][aS](aK(bb.x,bb.y,bb.qx,bb.qy,ba[1],ba[2]));break;case"Q":bb.qx=ba[1];bb.qy=ba[2];ba=["C"][aS](aK(bb.x,bb.y,ba[1],ba[2],ba[3],ba[4]));break;case"L":ba=["C"][aS](aX(bb.x,bb.y,ba[1],ba[2]));break;case"H":ba=["C"][aS](aX(bb.x,bb.y,ba[1],bb.y));break;case"V":ba=["C"][aS](aX(bb.x,bb.y,bb.x,ba[1]));break;case"Z":ba=["C"][aS](aX(bb.x,bb.y,bb.X,bb.Y));break;}return ba;},e=function(ba,bb){if(ba[bb][m]>7){ba[bb].shift();var bc=ba[bb];while(bc[m]){ba.splice(bb++,0,["C"][aS](bc.splice(0,6)));}ba.splice(bb,1);a7=g(R[m],a5&&a5[m]||0);}},E=function(be,bd,bb,ba,bc){if(be&&bd&&be[bc][0]=="M"&&bd[bc][0]!="M"){bd.splice(bc,0,["M",ba.x,ba.y]);bb.bx=0;bb.by=0;bb.x=be[bc][1];bb.y=be[bc][2];a7=g(R[m],a5&&a5[m]||0);}};for(var a2=0,a7=g(R[m],a5&&a5[m]||0);a23){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]};}}},aG=function(d,i){var e=this;for(var E in i){if(i[Q](E)&&!(E in d)){switch(typeof i[E]){case"function":(function(R){d[E]=d===e?R:function(){return R[aW](e,arguments);};})(i[E]);break;case"object":d[E]=d[E]||{};aG.call(this,d[E],i[E]);break;default:d[E]=i[E];break;}}}},ak=function(d,e){d==e.top&&(e.top=d.prev);d==e.bottom&&(e.bottom=d.next);d.next&&(d.next.prev=d.prev);d.prev&&(d.prev.next=d.next);},Y=function(d,e){if(e.top===d){return;}ak(d,e);d.next=null;d.prev=e.top;e.top.next=d;e.top=d;},k=function(d,e){if(e.bottom===d){return;}ak(d,e);d.next=e.bottom;d.prev=null;e.bottom.prev=d;e.bottom=d;},A=function(e,d,i){ak(e,i);d==i.top&&(i.top=e);d.next&&(d.next.prev=e);e.next=d.next;e.prev=d;d.next=e;},aq=function(e,d,i){ak(e,i);d==i.bottom&&(i.bottom=e);d.prev&&(d.prev.next=e);e.prev=d.prev;d.prev=e;e.next=d;},s=function(d){return function(){throw new Error("Rapha\xebl: you are calling to method \u201c"+d+"\u201d of removed object");};},ar=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(an.svg){aT[aY].svgns="http://www.w3.org/2000/svg";aT[aY].xlink="http://www.w3.org/1999/xlink";var O=function(d){return +d+(~~d===d)*0.5;},V=function(S){for(var e=0,E=S[m];e0.5)*2-1);aM(a1-0.5,2)+aM(S-0.5,2)>0.25&&(S=ab.sqrt(0.25-aM(a1-0.5,2))*ba+0.5)&&S!=0.5&&(S=S.toFixed(5)-0.00001*ba);}return at;});a7=a7[z](/\s*\-\s*/);if(a4=="linear"){var a0=a7.shift();a0=-W(a0);if(isNaN(a0)){return null;}var R=[0,0,ab.cos(a0*ab.PI/180),ab.sin(a0*ab.PI/180)],a6=1/(g(ab.abs(R[2]),ab.abs(R[3]))||1);R[2]*=a6;R[3]*=a6;if(R[2]<0){R[0]=-R[2];R[2]=0;}if(R[3]<0){R[1]=-R[3];R[3]=0;}}var a3=p(a7);if(!a3){return null;}var e=aJ(a4+"Gradient");e.id="r"+(an._id++)[aA](36);aJ(e,a4=="radial"?{fx:a1,fy:S}:{x1:R[0],y1:R[1],x2:R[2],y2:R[3]});d.defs[aL](e);for(var a2=0,a8=a3[m];a2a1.height)&&(a1.height=a0.y+a0.height-a1.y);(a0.x+a0.width-a1.x>a1.width)&&(a1.width=a0.x+a0.width-a1.x);}}E&&this.hide();return a1;};ax[aY].attr=function(){if(this.removed){return this;}if(arguments[m]==0){var R={};for(var E in this.attrs){if(this.attrs[Q](E)){R[E]=this.attrs[E];}}this._.rt.deg&&(R.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(R.scale=this.scale());R.gradient&&R.fill=="none"&&(R.fill=R.gradient)&&delete R.gradient;return R;}if(arguments[m]==1&&an.is(arguments[0],"string")){if(arguments[0]=="translation"){return t.call(this);}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}if(arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient;}return this.attrs[arguments[0]];}if(arguments[m]==1&&an.is(arguments[0],"array")){var d={};for(var e in arguments[0]){if(arguments[0][Q](e)){d[arguments[0][e]]=this.attrs[arguments[0][e]];}}return d;}if(arguments[m]==2){var S={};S[arguments[0]]=arguments[1];aa(this,S);}else{if(arguments[m]==1&&an.is(arguments[0],"object")){aa(this,arguments[0]);}}return this;};ax[aY].toFront=function(){if(this.removed){return this;}this.node.parentNode[aL](this.node);var d=this.paper;d.top!=this&&Y(this,d);return this;};ax[aY].toBack=function(){if(this.removed){return this;}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);k(this,this.paper);var d=this.paper;}return this;};ax[aY].insertAfter=function(d){if(this.removed){return this;}var e=d.node;if(e.nextSibling){e.parentNode.insertBefore(this.node,e.nextSibling);}else{e.parentNode[aL](this.node);}A(this,d,this.paper);return this;};ax[aY].insertBefore=function(d){if(this.removed){return this;}var e=d.node;e.parentNode.insertBefore(this.node,e);aq(this,d,this.paper);return this;};var P=function(e,d,S,R){d=O(d);S=O(S);var E=aJ("circle");e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={cx:d,cy:S,r:R,fill:"none",stroke:"#000"};i.type="circle";aJ(E,i.attrs);return i;};var aF=function(i,d,a1,e,S,a0){d=O(d);a1=O(a1);var R=aJ("rect");i.canvas&&i.canvas[aL](R);var E=new ax(R,i);E.attrs={x:d,y:a1,width:e,height:S,r:a0||0,rx:a0||0,ry:a0||0,fill:"none",stroke:"#000"};E.type="rect";aJ(R,E.attrs);return E;};var ai=function(e,d,a0,S,R){d=O(d);a0=O(a0);var E=aJ("ellipse");e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={cx:d,cy:a0,rx:S,ry:R,fill:"none",stroke:"#000"};i.type="ellipse";aJ(E,i.attrs);return i;};var o=function(i,a0,d,a1,e,S){var R=aJ("image");aJ(R,{x:d,y:a1,width:e,height:S,preserveAspectRatio:"none"});R.setAttributeNS(i.xlink,"href",a0);i.canvas&&i.canvas[aL](R);var E=new ax(R,i);E.attrs={x:d,y:a1,width:e,height:S,src:a0};E.type="image";return E;};var X=function(e,d,S,R){var E=aJ("text");aJ(E,{x:d,y:S,"text-anchor":"middle"});e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={x:d,y:S,"text-anchor":"middle",text:R,font:j.font,stroke:"none",fill:"#000"};i.type="text";aa(i,i.attrs);return i;};var aV=function(e,d){this.width=e||this.width;this.height=d||this.height;this.canvas[v]("width",this.width);this.canvas[v]("height",this.height);return this;};var w=function(){var E=ao[aW](null,arguments),i=E&&E.container,e=E.x,a0=E.y,R=E.width,d=E.height;if(!i){throw new Error("SVG container not found.");}var S=aJ("svg");R=R||512;d=d||342;aJ(S,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:R,height:d});if(i==1){S.style.cssText="position:absolute;left:"+e+"px;top:"+a0+"px";L.body[aL](S);}else{if(i.firstChild){i.insertBefore(S,i.firstChild);}else{i[aL](S);}}i=new aT;i.width=R;i.height=d;i.canvas=S;aG.call(i,i,an.fn);i.clear();return i;};aT[aY].clear=function(){var d=this.canvas;while(d.firstChild){d.removeChild(d.firstChild);}this.bottom=this.top=null;(this.desc=aJ("desc"))[aL](L.createTextNode("Created with Rapha\xebl"));d[aL](this.desc);d[aL](this.defs=aJ("defs"));};aT[aY].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var d in this){this[d]=s(d);}};}if(an.vml){var aH=function(a8){var a5=/[ahqstv]/ig,a0=r;(a8+at).match(a5)&&(a0=H);a5=/[clmz]/g;if(a0==r&&!(a8+at).match(a5)){var e={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},R=/([clmz]),?([^clmz]*)/gi,S=/-?[^,\s-]+/g;var a4=(a8+at)[aP](R,function(a9,bb,i){var ba=[];i[aP](S,function(bc){ba[f](O(bc));});return e[bb]+ba;});return a4;}var a6=a0(a8),E,a4=[],d;for(var a2=0,a7=a6[m];a21&&(e=1);a7.opacity=e;}a8.fill&&(a7.on=true);if(a7.on==null||a8.fill=="none"){a7.on=false;}if(a7.on&&a8.fill){var i=a8.fill.match(c);if(i){a7.src=i[1];a7.type="tile";}else{a7.color=an.getRGB(a8.fill).hex;a7.src=at;a7.type="solid";if(an.getRGB(a8.fill).error&&(bd.type in {circle:1,ellipse:1}||(a8.fill+at).charAt()!="r")&&b(bd,a8.fill)){a9.fill="none";a9.gradient=a8.fill;}}}ba&&a6[aL](a7);var R=(a6.getElementsByTagName("stroke")&&a6.getElementsByTagName("stroke")[0]),bb=false;!R&&(bb=R=ah("stroke"));if((a8.stroke&&a8.stroke!="none")||a8["stroke-width"]||a8["stroke-opacity"]!=null||a8["stroke-dasharray"]||a8["stroke-miterlimit"]||a8["stroke-linejoin"]||a8["stroke-linecap"]){R.on=true;}(a8.stroke=="none"||R.on==null||a8.stroke==0||a8["stroke-width"]==0)&&(R.on=false);R.on&&a8.stroke&&(R.color=an.getRGB(a8.stroke).hex);var e=((+a9["stroke-opacity"]+1||2)-1)*((+a9.opacity+1||2)-1),a4=(W(a8["stroke-width"])||1)*0.75;e<0&&(e=0);e>1&&(e=1);a8["stroke-width"]==null&&(a4=a9["stroke-width"]);a8["stroke-width"]&&(R.weight=a4);a4&&a4<1&&(e*=a4)&&(R.weight=1);R.opacity=e;a8["stroke-linejoin"]&&(R.joinstyle=a8["stroke-linejoin"]||"miter");R.miterlimit=a8["stroke-miterlimit"]||8;a8["stroke-linecap"]&&(R.endcap=a8["stroke-linecap"]=="butt"?"flat":a8["stroke-linecap"]=="square"?"square":"round");if(a8["stroke-dasharray"]){var a5={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};R.dashstyle=a5[Q](a8["stroke-dasharray"])?a5[a8["stroke-dasharray"]]:at;}bb&&a6[aL](R);}if(bd.type=="text"){var a0=bd.paper.span.style;a9.font&&(a0.font=a9.font);a9["font-family"]&&(a0.fontFamily=a9["font-family"]);a9["font-size"]&&(a0.fontSize=a9["font-size"]);a9["font-weight"]&&(a0.fontWeight=a9["font-weight"]);a9["font-style"]&&(a0.fontStyle=a9["font-style"]);bd.node.string&&(bd.paper.span.innerHTML=(bd.node.string+at)[aP](/"));bd.W=a9.w=bd.paper.span.offsetWidth;bd.H=a9.h=bd.paper.span.offsetHeight;bd.X=a9.x;bd.Y=a9.y+O(bd.H/2);switch(a9["text-anchor"]){case"start":bd.node.style["v-text-align"]="left";bd.bbx=O(bd.W/2);break;case"end":bd.node.style["v-text-align"]="right";bd.bbx=-O(bd.W/2);break;default:bd.node.style["v-text-align"]="center";break;}}};var b=function(d,a1){d.attrs=d.attrs||{};var a2=d.attrs,a4=d.node.getElementsByTagName("fill"),S="linear",a0=".5 .5";d.attrs.gradient=a1;a1=(a1+at)[aP](ar,function(a6,a7,i){S="radial";if(a7&&i){a7=W(a7);i=W(i);aM(a7-0.5,2)+aM(i-0.5,2)>0.25&&(i=ab.sqrt(0.25-aM(a7-0.5,2))*((i>0.5)*2-1)+0.5);a0=a7+am+i;}return at;});a1=a1[z](/\s*\-\s*/);if(S=="linear"){var e=a1.shift();e=-W(e);if(isNaN(e)){return null;}}var R=p(a1);if(!R){return null;}d=d.shape||d.node;a4=a4[0]||ah("fill");if(R[m]){a4.on=true;a4.method="none";a4.type=(S=="radial")?"gradientradial":"gradient";a4.color=R[0].color;a4.color2=R[R[m]-1].color;var a5=[];for(var E=0,a3=R[m];E');};}catch(af){ah=function(d){return L.createElement("<"+d+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');};}var w=function(){var i=ao[aW](null,arguments),d=i.container,a2=i.height,a3,e=i.width,a1=i.x,a0=i.y;if(!d){throw new Error("VML container not found.");}var R=new aT,S=R.canvas=L.createElement("div"),E=S.style;e=e||512;a2=a2||342;e==+e&&(e+="px");a2==+a2&&(a2+="px");R.width=1000;R.height=1000;R.coordsize="1000 1000";R.coordorigin="0 0";R.span=L.createElement("span");R.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";S[aL](R.span);E.cssText=an.format("width:{0};height:{1};position:absolute;clip:rect(0 {0} {1} 0);overflow:hidden",e,a2);if(d==1){L.body[aL](S);E.left=a1+"px";E.top=a0+"px";}else{d.style.width=e;d.style.height=a2;if(d.firstChild){d.insertBefore(S,d.firstChild);}else{d[aL](S);}}aG.call(R,R,an.fn);return R;};aT[aY].clear=function(){this.canvas.innerHTML=at;this.span=L.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[aL](this.span);this.bottom=this.top=null;};aT[aY].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var d in this){this[d]=s(d);}};}if((/^Apple|^Google/).test(navigator.vendor)&&!(navigator.userAgent.indexOf("Version/4.0")+1)){aT[aY].safari=function(){var d=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){d.remove();});};}else{aT[aY].safari=function(){};}var ae=(function(){if(L.addEventListener){return function(R,i,e,d){var E=function(S){return e.call(d,S);};R.addEventListener(i,E,false);return function(){R.removeEventListener(i,E,false);return true;};};}else{if(L.attachEvent){return function(S,E,i,e){var R=function(a0){return i.call(e,a0||au.event);};S.attachEvent("on"+E,R);var d=function(){S.detachEvent("on"+E,R);return true;};return d;};}}})();for(var ac=F[m];ac--;){(function(d){ax[aY][d]=function(e){if(an.is(e,"function")){this.events=this.events||[];this.events.push({name:d,f:e,unbind:ae(this.shape||this.node,d,e,this)});}return this;};ax[aY]["un"+d]=function(E){var i=this.events,e=i[m];while(e--){if(i[e].name==d&&i[e].f==E){i[e].unbind();i.splice(e,1);!i.length&&delete this.events;return this;}}return this;};})(F[ac]);}ax[aY].hover=function(e,d){return this.mouseover(e).mouseout(d);};ax[aY].unhover=function(e,d){return this.unmouseover(e).unmouseout(d);};aT[aY].circle=function(d,i,e){return P(this,d||0,i||0,e||0);};aT[aY].rect=function(d,R,e,i,E){return aF(this,d||0,R||0,e||0,i||0,E||0);};aT[aY].ellipse=function(d,E,i,e){return ai(this,d||0,E||0,i||0,e||0);};aT[aY].path=function(d){d&&!an.is(d,"string")&&!an.is(d[0],"array")&&(d+=at);return q(an.format[aW](an,arguments),this);};aT[aY].image=function(E,d,R,e,i){return o(this,E||"about:blank",d||0,R||0,e||0,i||0);};aT[aY].text=function(d,i,e){return X(this,d||0,i||0,e||at);};aT[aY].set=function(d){arguments[m]>1&&(d=Array[aY].splice.call(arguments,0,arguments[m]));return new T(d);};aT[aY].setSize=aV;aT[aY].top=aT[aY].bottom=null;aT[aY].raphael=an;function u(){return this.x+am+this.y;}ax[aY].scale=function(a6,a5,E,e){if(a6==null&&a5==null){return{x:this._.sx,y:this._.sy,toString:u};}a5=a5||a6;!+a5&&(a5=a6);var ba,a8,a9,a7,bm=this.attrs;if(a6!=0){var a4=this.getBBox(),a1=a4.x+a4.width/2,R=a4.y+a4.height/2,bl=a6/this._.sx,bk=a5/this._.sy;E=(+E||E==0)?E:a1;e=(+e||e==0)?e:R;var a3=~~(a6/ab.abs(a6)),a0=~~(a5/ab.abs(a5)),be=this.node.style,bo=E+(a1-E)*bl,bn=e+(R-e)*bk;switch(this.type){case"rect":case"image":var a2=bm.width*a3*bl,bd=bm.height*a0*bk;this.attr({height:bd,r:bm.r*aI(a3*bl,a0*bk),width:a2,x:bo-a2/2,y:bn-bd/2});break;case"circle":case"ellipse":this.attr({rx:bm.rx*a3*bl,ry:bm.ry*a0*bk,r:bm.r*aI(a3*bl,a0*bk),cx:bo,cy:bn});break;case"path":var bg=ad(bm.path),bh=true;for(var bj=0,bc=bg[m];bjS){if(e&&!a8.start){a6=an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],(S-a3)/a1);R+=["C",a6.start.x,a6.start.y,a6.m.x,a6.m.y,a6.x,a6.y];if(a0){return R;}a8.start=R;R=["M",a6.x,a6.y+"C",a6.n.x,a6.n.y,a6.end.x,a6.end.y,E[5],E[6]][az]();a3+=a1;a5=+E[5];a4=+E[6];continue;}if(!d&&!e){a6=an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],(S-a3)/a1);return{x:a6.x,y:a6.y,alpha:a6.alpha};}}a3+=a1;a5=+E[5];a4=+E[6];}R+=E;}a8.end=R;a6=d?a3:e?a8:an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],1);a6.alpha&&(a6={x:a6.x,y:a6.y,alpha:a6.alpha});return a6;};},n=aj(function(E,d,a0,S,a6,a5,a4,a3){var R={x:0,y:0},a2=0;for(var a1=0;a1<1.01;a1+=0.01){var e=M(E,d,a0,S,a6,a5,a4,a3,a1);a1&&(a2+=ab.sqrt(aM(R.x-e.x,2)+aM(R.y-e.y,2)));R=e;}return a2;});var ap=aB(1),C=aB(),J=aB(0,1);ax[aY].getTotalLength=function(){if(this.type!="path"){return;}return ap(this.attrs.path);};ax[aY].getPointAtLength=function(d){if(this.type!="path"){return;}return C(this.attrs.path,d);};ax[aY].getSubpath=function(i,e){if(this.type!="path"){return;}if(ab.abs(this.getTotalLength()-e)<0.000001){return J(this.attrs.path,i).end;}var d=J(this.attrs.path,e,1);return i?J(d,i).end:d;};an.easing_formulas={linear:function(d){return d;},"<":function(d){return aM(d,3);},">":function(d){return aM(d-1,3)+1;},"<>":function(d){d=d*2;if(d<1){return aM(d,3)/2;}d-=2;return(aM(d,3)+2)/2;},backIn:function(e){var d=1.70158;return e*e*((d+1)*e-d);},backOut:function(e){e=e-1;var d=1.70158;return e*e*((d+1)*e+d)+1;},elastic:function(i){if(i==0||i==1){return i;}var e=0.3,d=e/4;return aM(2,-10*i)*ab.sin((i-d)*(2*ab.PI)/e)+1;},bounce:function(E){var e=7.5625,i=2.75,d;if(E<(1/i)){d=e*E*E;}else{if(E<(2/i)){E-=(1.5/i);d=e*E*E+0.75;}else{if(E<(2.5/i)){E-=(2.25/i);d=e*E*E+0.9375;}else{E-=(2.625/i);d=e*E*E+0.984375;}}}return d;}};var I={length:0},aR=function(){var a2=+new Date;for(var be in I){if(be!="length"&&I[Q](be)){var bj=I[be];if(bj.stop){delete I[be];I[m]--;continue;}var a0=a2-bj.start,bb=bj.ms,ba=bj.easing,bf=bj.from,a7=bj.diff,E=bj.to,a6=bj.t,a9=bj.prev||0,a1=bj.el,R=bj.callback,a8={},d;if(a0255?255:(d<0?0:d);},t=function(d,i){if(d==null){return{x:this._.tx,y:this._.ty,toString:u};}this._.tx+=+d;this._.ty+=+i;switch(this.type){case"circle":case"ellipse":this.attr({cx:+d+this.attrs.cx,cy:+i+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+d+this.attrs.x,y:+i+this.attrs.y});break;case"path":var e=ad(this.attrs.path);e[0][1]+=+d;e[0][2]+=+i;this.attr({path:e});break;}return this;};ax[aY].animateWith=function(e,i,d,R,E){I[e.id]&&(i.start=I[e.id].start);return this.animate(i,d,R,E);};ax[aY].animateAlong=ay();ax[aY].animateAlongBack=ay(1);function ay(d){return function(E,i,e,S){var R={back:d};an.is(e,"function")?(S=e):(R.rot=e);E&&E.constructor==ax&&(E=E.attrs.path);E&&(R.along=E);return this.animate(R,i,S);};}ax[aY].onAnimation=function(d){this._run=d||0;return this;};ax[aY].animate=function(be,a5,a4,E){if(an.is(a4,"function")||!a4){E=a4||null;}var a9={},e={},a2={};for(var a6 in be){if(be[Q](a6)){if(Z[Q](a6)){a9[a6]=this.attr(a6);(a9[a6]==null)&&(a9[a6]=j[a6]);e[a6]=be[a6];switch(Z[a6]){case"along":var bc=ap(be[a6]),a7=C(be[a6],bc*!!be.back),R=this.getBBox();a2[a6]=bc/a5;a2.tx=R.x;a2.ty=R.y;a2.sx=a7.x;a2.sy=a7.y;e.rot=be.rot;e.back=be.back;e.len=bc;be.rot&&(a2.r=W(this.rotate())||0);break;case"number":a2[a6]=(e[a6]-a9[a6])/a5;break;case"colour":a9[a6]=an.getRGB(a9[a6]);var a8=an.getRGB(e[a6]);a2[a6]={r:(a8.r-a9[a6].r)/a5,g:(a8.g-a9[a6].g)/a5,b:(a8.b-a9[a6].b)/a5};break;case"path":var S=H(a9[a6],e[a6]);a9[a6]=S[0];var a3=S[1];a2[a6]=[];for(var bb=0,a1=a9[a6][m];bb-1){i=j.data;i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)}else delete t[p]}i=c(a.target).closest(f,a.currentTarget); 18 | n=0;for(l=i.length;n)[^>]*$|^#([\w-]+)$/,Pa=/^.[^:#\[\.,]*$/,Qa=/\S/, 21 | Ra=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Sa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],M,ca=Object.prototype.toString,da=Object.prototype.hasOwnProperty,ea=Array.prototype.push,R=Array.prototype.slice,V=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(typeof a==="string")if((d=Oa.exec(a))&&(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Sa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])]; 22 | c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=ua([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return U.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a)}else return!b||b.jquery?(b||U).find(a):c(b).find(a);else if(c.isFunction(a))return U.ready(a);if(a.selector!==w){this.selector=a.selector; 23 | this.context=a.context}return c.isArray(a)?this.setArray(a):c.makeArray(a,this)},selector:"",jquery:"1.4",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){a=c(a||null);a.prevObject=this;a.context=this.context;if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;else if(b)a.selector=this.selector+"."+b+"("+d+")";return a},setArray:function(a){this.length= 24 | 0;ea.apply(this,a);return this},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject|| 25 | c(null)},push:ea,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
    a";var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!i)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length, 34 | htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55$/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(j){}a.insertBefore(b, 35 | a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function o(){c.support.noCloneEvent=false;d.detachEvent("onclick",o)});d.cloneNode(true).fireEvent("onclick")}c(function(){var o=s.createElement("div");o.style.width=o.style.paddingLeft="1px";s.body.appendChild(o);c.boxModel=c.support.boxModel=o.offsetWidth===2;s.body.removeChild(o).style.display="none"});a=function(o){var p=s.createElement("div");o="on"+o;var n=o in 36 | p;if(!n){p.setAttribute(o,"return;");n=typeof p[o]==="function"}return n};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=i=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var H="jQuery"+K(),Ta=0,ya={},Ua={};c.extend({cache:{},expando:H,noData:{embed:true,object:true,applet:true},data:function(a, 37 | b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var f=a[H],e=c.cache;if(!b&&!f)return null;f||(f=++Ta);if(typeof b==="object"){a[H]=f;e=e[f]=c.extend(true,{},b)}else e=e[f]?e[f]:typeof d==="undefined"?Ua:(e[f]={});if(d!==w){a[H]=f;e[b]=d}return typeof b==="string"?e[b]:e}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?ya:a;var d=a[H],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{try{delete a[H]}catch(i){a.removeAttribute&& 38 | a.removeAttribute(H)}delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b)})},removeData:function(a){return this.each(function(){c.removeData(this, 39 | a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this, 40 | a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var za=/[\n\t]/g,fa=/\s+/,Va=/\r/g,Wa=/href|src|style/,Xa=/(button|input)/i,Ya=/(button|input|object|select|textarea)/i,Za=/^(a|area)$/i,Aa=/radio|checkbox/;c.fn.extend({attr:function(a, 41 | b){return $(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(p){var n=c(this);n.addClass(a.call(this,p,n.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(fa),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var i=b?d:0;for(d=b?d+1:e.length;i=0;else if(c.nodeName(this,"select")){var z=c.makeArray(t);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),z)>=0});if(!z.length)this.selectedIndex= 46 | -1}else this.value=t}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var i=Wa.test(b);if(b in a&&f&&!i){if(e){if(b==="type"&&Xa.test(a.nodeName)&&a.parentNode)throw"type property can't be changed";a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue; 47 | if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Ya.test(a.nodeName)||Za.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var $a=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType=== 48 | 3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;if(!d.guid)d.guid=c.guid++;if(f!==w){d=c.proxy(d);d.data=f}var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;if(!i){j=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):w};i=c.data(a,"handle",j)}if(i){i.elem=a;b=b.split(/\s+/);for(var o,p=0;o=b[p++];){var n=o.split(".");o=n.shift();d.type=n.slice(0).sort().join(".");var t=e[o],z=this.special[o]||{};if(!t){t=e[o]={}; 49 | if(!z.setup||z.setup.call(a,f,n,d)===false)if(a.addEventListener)a.addEventListener(o,i,false);else a.attachEvent&&a.attachEvent("on"+o,i)}if(z.add)if((n=z.add.call(a,d,f,n,t))&&c.isFunction(n)){n.guid=n.guid||d.guid;d=n}t[d.guid]=d;this.global[o]=true}a=null}}},global:{},remove:function(a,b,d){if(!(a.nodeType===3||a.nodeType===8)){var f=c.data(a,"events"),e,i,j;if(f){if(b===w||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{if(b.type){d=b.handler;b=b.type}b=b.split(/\s+/); 50 | for(var o=0;i=b[o++];){var p=i.split(".");i=p.shift();var n=!p.length,t=c.map(p.slice(0).sort(),$a);t=new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.)?")+"(\\.|$)");var z=this.special[i]||{};if(f[i]){if(d){j=f[i][d.guid];delete f[i][d.guid]}else for(var B in f[i])if(n||t.test(f[i][B].type))delete f[i][B];z.remove&&z.remove.call(a,p,j);for(e in f[i])break;if(!e){if(!z.teardown||z.teardown.call(a,p)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+ 51 | i,c.data(a,"handle"));e=null;delete f[i]}}}}for(e in f)break;if(!e){if(B=c.data(a,"handle"))B.elem=null;c.removeData(a,"events");c.removeData(a,"handle")}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[H]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();this.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== 52 | 8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;var i=c.data(d,"handle");i&&i.apply(d,b);var j,o;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){j=d[e];o=d["on"+e]}}catch(p){}i=c.nodeName(d,"a")&&e==="click";if(!f&&j&&!a.isDefaultPrevented()&&!i){this.triggered=true;try{d[e]()}catch(n){}}else if(o&&d["on"+e].apply(d,b)===false)a.result=false;this.triggered=false;if(!a.isPropagationStopped())(d=d.parentNode||d.ownerDocument)&&c.event.trigger(a,b,d,true)}, 53 | handle:function(a){var b,d;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;d=a.type.split(".");a.type=d.shift();b=!d.length&&!a.exclusive;var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");d=(c.data(this,"events")||{})[a.type];for(var e in d){var i=d[e];if(b||f.test(i.type)){a.handler=i;a.data=i.data;i=i.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result}, 54 | props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[H])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement|| 55 | s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&& 56 | a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a,b){c.extend(a,b||{});a.guid+=b.selector+b.live;c.event.add(this,b.live,qa,b)},remove:function(a){if(a.length){var b=0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");c.each(c.data(this,"events").live||{},function(){d.test(this.type)&&b++});b<1&&c.event.remove(this,a[0],qa)}},special:{}},beforeunload:{setup:function(a, 57 | b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=K();this[H]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped= 58 | ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:aa,isPropagationStopped:aa,isImmediatePropagationStopped:aa};var Ba=function(a){for(var b=a.relatedTarget;b&&b!==this;)try{b=b.parentNode}catch(d){break}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}},Ca=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover", 59 | mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ca:Ba,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ca:Ba)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(a,b,d){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit."+d.guid,function(f){var e=f.target,i=e.type;if((i==="submit"||i==="image")&&c(e).closest("form").length)return pa("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit."+ 60 | d.guid,function(f){var e=f.target,i=e.type;if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return pa("submit",this,arguments)})}else return false},remove:function(a,b){c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));c.event.remove(this,"keypress.specialSubmit"+(b?"."+b.guid:""))}};if(!c.support.changeBubbles){var ga=/textarea|input|select/i;function Da(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex> 61 | -1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d}function ha(a,b){var d=a.target,f,e;if(!(!ga.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Da(d);if(e!==f){if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",e);if(d.type!=="select"&&(f!=null||e)){a.type="change";return c.event.trigger(a,b,this)}}}}c.event.special.change={filters:{focusout:ha,click:function(a){var b=a.target,d=b.type;if(d=== 62 | "radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ha.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ha.call(this,a)},beforeactivate:function(a){a=a.target;a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Da(a))}},setup:function(a,b,d){for(var f in W)c.event.add(this,f+".specialChange."+d.guid,W[f]);return ga.test(this.nodeName)}, 63 | remove:function(a,b){for(var d in W)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),W[d]);return ga.test(this.nodeName)}};var W=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d, 64 | f,e){if(typeof d==="object"){for(var i in d)this[b](i,f,d[i],e);return this}if(c.isFunction(f)){thisObject=e;e=f;f=w}var j=b==="one"?c.proxy(e,function(o){c(this).unbind(o,j);return e.apply(this,arguments)}):e;return d==="unload"&&b!=="one"?this.one(d,f,e,thisObject):this.each(function(){c.event.add(this,d,j,f)})}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault){for(var d in a)this.unbind(d,a[d]);return this}return this.each(function(){c.event.remove(this,a,b)})},trigger:function(a, 65 | b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},toggle:function(a){for(var b=arguments,d=1;d0){y=u;break}}u=u[g]}m[r]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, 69 | e=0,i=Object.prototype.toString,j=false,o=true;[0,0].sort(function(){o=false;return 0});var p=function(g,h,k,m){k=k||[];var r=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return k;for(var q=[],v,u,y,S,I=true,N=x(h),J=g;(f.exec(""),v=f.exec(J))!==null;){J=v[3];q.push(v[1]);if(v[2]){S=v[3];break}}if(q.length>1&&t.exec(g))if(q.length===2&&n.relative[q[0]])u=ia(q[0]+q[1],h);else for(u=n.relative[q[0]]?[h]:p(q.shift(),h);q.length;){g=q.shift();if(n.relative[g])g+=q.shift(); 70 | u=ia(g,u)}else{if(!m&&q.length>1&&h.nodeType===9&&!N&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){v=p.find(q.shift(),h,N);h=v.expr?p.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:q.pop(),set:B(m)}:p.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&h.parentNode?h.parentNode:h,N);u=v.expr?p.filter(v.expr,v.set):v.set;if(q.length>0)y=B(u);else I=false;for(;q.length;){var E=q.pop();v=E;if(n.relative[E])v=q.pop();else E="";if(v==null)v=h;n.relative[E](y,v,N)}}else y=[]}y||(y=u);if(!y)throw"Syntax error, unrecognized expression: "+ 71 | (E||g);if(i.call(y)==="[object Array]")if(I)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&F(h,y[g])))k.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&k.push(u[g]);else k.push.apply(k,y);else B(y,k);if(S){p(S,r,k,m);p.uniqueSort(k)}return k};p.uniqueSort=function(g){if(D){j=o;g.sort(D);if(j)for(var h=1;h":function(g,h){var k=typeof h==="string";if(k&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,r=g.length;m=0))k||m.push(v);else if(k)h[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, 78 | CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,k,m,r,q){h=g[1].replace(/\\/g,"");if(!q&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,k,m,r){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=p(g[3],null,null,h);else{g=p.filter(g[3],h,k,true^r);k||m.push.apply(m, 79 | g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,k){return!!p(k[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, 80 | text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, 81 | setFilters:{first:function(g,h){return h===0},last:function(g,h,k,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,k){return hk[3]-0},nth:function(g,h,k){return k[3]-0===h},eq:function(g,h,k){return k[3]-0===h}},filter:{PSEUDO:function(g,h,k,m){var r=h[1],q=n.filters[r];if(q)return q(g,k,h,m);else if(r==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(r==="not"){h= 82 | h[3];k=0;for(m=h.length;k=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var k=h[1];g=n.attrHandle[k]?n.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);k=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== 84 | "="?k===h:m==="*="?k.indexOf(h)>=0:m==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:m==="!="?k!==h:m==="^="?k.indexOf(h)===0:m==="$="?k.substr(k.length-h.length)===h:m==="|="?k===h||k.substr(0,h.length+1)===h+"-":false},POS:function(g,h,k,m){var r=n.setFilters[h[2]];if(r)return r(g,k,h,m)}}},t=n.match.POS;for(var z in n.match){n.match[z]=new RegExp(n.match[z].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[z]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[z].source.replace(/\\(\d+)/g,function(g, 85 | h){return"\\"+(h-0+1)}))}var B=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){B=function(g,h){h=h||[];if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var k=0,m=g.length;k";var k=s.documentElement;k.insertBefore(g,k.firstChild);if(s.getElementById(h)){n.find.ID=function(m,r,q){if(typeof r.getElementById!=="undefined"&&!q)return(r=r.getElementById(m[1]))?r.id===m[1]||typeof r.getAttributeNode!=="undefined"&& 88 | r.getAttributeNode("id").nodeValue===m[1]?[r]:w:[]};n.filter.ID=function(m,r){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===r}}k.removeChild(g);k=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,k){k=k.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;k[m];m++)k[m].nodeType===1&&h.push(k[m]);k=h}return k};g.innerHTML=""; 89 | if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=p,h=s.createElement("div");h.innerHTML="

    ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){p=function(m,r,q,v){r=r||s;if(!v&&r.nodeType===9&&!x(r))try{return B(r.querySelectorAll(m),q)}catch(u){}return g(m,r,q,v)};for(var k in g)p[k]=g[k];h=null}}(); 90 | (function(){var g=s.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,k,m){if(typeof k.getElementsByClassName!=="undefined"&&!m)return k.getElementsByClassName(h[1])};g=null}}})();var F=s.compareDocumentPosition?function(g,h){return g.compareDocumentPosition(h)&16}:function(g, 91 | h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var i=d;i0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,i= 94 | {},j;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:j,elem:f});delete i[j]}}f=f.parentNode}}return d}var p=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,t){for(;t&&t.ownerDocument&&t!==b;){if(p?p.index(t)>-1:c(t).is(a))return t;t=t.parentNode}return null})},index:function(a){if(!a||typeof a=== 95 | "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(sa(a[0])||sa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", 96 | d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? 97 | a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);ab.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||cb.test(f))&&bb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||!c(a).is(d));){a.nodeType=== 98 | 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ga=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,db=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/"},G={option:[1,""], 99 | legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};G.optgroup=G.option;G.tbody=G.tfoot=G.colgroup=G.caption=G.thead;G.th=G.td;if(!c.support.htmlSerialize)G._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this); 100 | return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, 101 | wrapInner:function(a){return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&& 102 | this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this, 103 | "after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ga,"").replace(Y,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ta(this,b);ta(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType=== 104 | 1?this[0].innerHTML.replace(Ga,""):null;else if(typeof a==="string"&&!/