* v0.0.3
authorJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 2 Sep 2011 22:59:22 +0000 (22:59 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 2 Sep 2011 22:59:22 +0000 (22:59 +0000)
** Generated HTML pages for package versions.

26 files changed:
Makefile.am
Makefile.in
NEWS
configure
configure.ac
scripts/check.sh [deleted file]
scripts/checkpatch.pl [deleted file]
src/Makefile.am
src/Makefile.in
src/chart.c [deleted file]
src/chart.h [deleted file]
src/html.c
src/lp_json.c
src/ppastats.c
src/ppastats.h
tests/Makefile.am [new file with mode: 0644]
tests/Makefile.in [new file with mode: 0644]
tests/checkpatch.pl [new file with mode: 0755]
www/Makefile.am [new file with mode: 0644]
www/Makefile.in [new file with mode: 0644]
www/css/jquery.jqplot.min.css [new file with mode: 0644]
www/css/ppastats.css [new file with mode: 0644]
www/js/jqplot.dateAxisRenderer.min.js [new file with mode: 0644]
www/js/jquery.jqplot.min.js [new file with mode: 0644]
www/js/jquery.min.js [new file with mode: 0644]
www/js/ppastats.js [new file with mode: 0644]

index dac0c30..67692d6 100644 (file)
@@ -1,3 +1,3 @@
-SUBDIRS = src
+SUBDIRS = src tests www
 dist_doc_DATA = README COPYING NEWS AUTHORS INSTALL
 
index 9726068..bbb608b 100644 (file)
@@ -220,7 +220,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = src
+SUBDIRS = src tests www
 dist_doc_DATA = README COPYING NEWS AUTHORS INSTALL
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/NEWS b/NEWS
index ad40848..9323cbc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,2 +1,9 @@
+* v0.0.3
+** Generated HTML pages for package versions.
+
+* v0.0.2
+** Generated HTML pages are now using JQuery+JQPlout instead of Google Chart.
+** Added check target.
+
 * v0.0.1
-** Initial release
\ No newline at end of file
+** Initial release.
index 577938c..5936c42 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for ppastats 0.0.1.
+# Generated by GNU Autoconf 2.67 for ppastats 0.0.2.
 #
 # Report bugs to <jeanfi@gmail.com>.
 #
@@ -552,8 +552,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ppastats'
 PACKAGE_TARNAME='ppastats'
-PACKAGE_VERSION='0.0.1'
-PACKAGE_STRING='ppastats 0.0.1'
+PACKAGE_VERSION='0.0.2'
+PACKAGE_STRING='ppastats 0.0.2'
 PACKAGE_BUGREPORT='jeanfi@gmail.com'
 PACKAGE_URL='http://wpitchoune.net/ppastats'
 
@@ -1253,7 +1253,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ppastats 0.0.1 to adapt to many kinds of systems.
+\`configure' configures ppastats 0.0.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1323,7 +1323,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ppastats 0.0.1:";;
+     short | recursive ) echo "Configuration of ppastats 0.0.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1426,7 +1426,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ppastats configure 0.0.1
+ppastats configure 0.0.2
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1728,7 +1728,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ppastats $as_me 0.0.1, which was
+It was created by ppastats $as_me 0.0.2, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -2544,7 +2544,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='ppastats'
- VERSION='0.0.1'
+ VERSION='0.0.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4702,7 +4702,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile src/Makefile"
+ac_config_files="$ac_config_files Makefile src/Makefile tests/Makefile www/Makefile"
 
 
 for ac_prog in help2man
@@ -5270,7 +5270,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ppastats $as_me 0.0.1, which was
+This file was extended by ppastats $as_me 0.0.2, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5337,7 +5337,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ppastats config.status 0.0.1
+ppastats config.status 0.0.2
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
@@ -5470,6 +5470,8 @@ do
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+    "www/Makefile") CONFIG_FILES="$CONFIG_FILES www/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
   esac
index 3ab3616..1caffa4 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.64])
-AC_INIT([ppastats], [0.0.1],[jeanfi@gmail.com],[ppastats],[http://wpitchoune.net/ppastats])
+AC_INIT([ppastats], [0.0.2],[jeanfi@gmail.com],[ppastats],[http://wpitchoune.net/ppastats])
 
 AM_INIT_AUTOMAKE([-Wall -Werror gnu])
 
@@ -34,6 +34,8 @@ AC_SUBST(JSON_LIBS)
 AC_CONFIG_FILES([
  Makefile
  src/Makefile
+ tests/Makefile
+ www/Makefile
 ])
 
 AC_CHECK_PROGS([HELP2MAN], [help2man])
diff --git a/scripts/check.sh b/scripts/check.sh
deleted file mode 100755 (executable)
index 491fa73..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-find src -name \*.c -exec `dirname $0`/checkpatch.pl -q --no-tree  -emacs -f {} \;
-find src -name \*.h -exec `dirname $0`/checkpatch.pl -q --no-tree  -emacs -f {} \;
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
deleted file mode 100755 (executable)
index 0b0defa..0000000
+++ /dev/null
@@ -1,2823 +0,0 @@
-#!/usr/bin/perl -w
-
-# This script has been copied from Linux Kernel sources.
-#
-# (c) 2001, Dave Jones. (the file handling bit)
-# (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit)
-# (c) 2007,2008, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite)
-# (c) 2008,2009, Andy Whitcroft <apw@canonical.com>
-# Licensed under the terms of the GNU GPL License version 2
-
-use strict;
-
-my $P = $0;
-$P =~ s@.*/@@g;
-
-my $V = '0.30';
-
-use Getopt::Long qw(:config no_auto_abbrev);
-
-my $quiet = 0;
-my $tree = 1;
-my $chk_signoff = 1;
-my $chk_patch = 1;
-my $tst_only;
-my $emacs = 0;
-my $terse = 0;
-my $file = 0;
-my $check = 0;
-my $summary = 1;
-my $mailback = 0;
-my $summary_file = 0;
-my $root;
-my %debug;
-my $help = 0;
-
-sub help {
-       my ($exitcode) = @_;
-
-       print << "EOM";
-Usage: $P [OPTION]... [FILE]...
-Version: $V
-
-Options:
-  -q, --quiet                quiet
-  --no-tree                  run without a kernel tree
-  --no-signoff               do not check for 'Signed-off-by' line
-  --patch                    treat FILE as patchfile (default)
-  --emacs                    emacs compile window format
-  --terse                    one line per report
-  -f, --file                 treat FILE as regular source file
-  --subjective, --strict     enable more subjective tests
-  --root=PATH                PATH to the kernel tree root
-  --no-summary               suppress the per-file summary
-  --mailback                 only produce a report in case of warnings/errors
-  --summary-file             include the filename in summary
-  --debug KEY=[0|1]          turn on/off debugging of KEY, where KEY is one of
-                             'values', 'possible', 'type', and 'attr' (default
-                             is all off)
-  --test-only=WORD           report only warnings/errors containing WORD
-                             literally
-  -h, --help, --version      display this help and exit
-
-When FILE is - read standard input.
-EOM
-
-       exit($exitcode);
-}
-
-GetOptions(
-       'q|quiet+'      => \$quiet,
-       'tree!'         => \$tree,
-       'signoff!'      => \$chk_signoff,
-       'patch!'        => \$chk_patch,
-       'emacs!'        => \$emacs,
-       'terse!'        => \$terse,
-       'f|file!'       => \$file,
-       'subjective!'   => \$check,
-       'strict!'       => \$check,
-       'root=s'        => \$root,
-       'summary!'      => \$summary,
-       'mailback!'     => \$mailback,
-       'summary-file!' => \$summary_file,
-
-       'debug=s'       => \%debug,
-       'test-only=s'   => \$tst_only,
-       'h|help'        => \$help,
-       'version'       => \$help
-) or help(1);
-
-help(0) if ($help);
-
-my $exit = 0;
-
-if ($#ARGV < 0) {
-       print "$P: no input files\n";
-       exit(1);
-}
-
-my $dbg_values = 0;
-my $dbg_possible = 0;
-my $dbg_type = 0;
-my $dbg_attr = 0;
-for my $key (keys %debug) {
-       ## no critic
-       eval "\${dbg_$key} = '$debug{$key}';";
-       die "$@" if ($@);
-}
-
-if ($terse) {
-       $emacs = 1;
-       $quiet++;
-}
-
-if ($tree) {
-       if (defined $root) {
-               if (!top_of_kernel_tree($root)) {
-                       die "$P: $root: --root does not point at a valid tree\n";
-               }
-       } else {
-               if (top_of_kernel_tree('.')) {
-                       $root = '.';
-               } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ &&
-                                               top_of_kernel_tree($1)) {
-                       $root = $1;
-               }
-       }
-
-       if (!defined $root) {
-               print "Must be run from the top-level dir. of a kernel tree\n";
-               exit(2);
-       }
-}
-
-my $emitted_corrupt = 0;
-
-our $Ident     = qr{
-                       [A-Za-z_][A-Za-z\d_]*
-                       (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)*
-               }x;
-our $Storage   = qr{extern|static|asmlinkage};
-our $Sparse    = qr{
-                       __user|
-                       __kernel|
-                       __force|
-                       __iomem|
-                       __must_check|
-                       __init_refok|
-                       __kprobes|
-                       __ref
-               }x;
-
-# Notes to $Attribute:
-# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check
-our $Attribute = qr{
-                       const|
-                       __read_mostly|
-                       __kprobes|
-                       __(?:mem|cpu|dev|)(?:initdata|initconst|init\b)|
-                       ____cacheline_aligned|
-                       ____cacheline_aligned_in_smp|
-                       ____cacheline_internodealigned_in_smp|
-                       __weak
-                 }x;
-our $Modifier;
-our $Inline    = qr{inline|__always_inline|noinline};
-our $Member    = qr{->$Ident|\.$Ident|\[[^]]*\]};
-our $Lval      = qr{$Ident(?:$Member)*};
-
-our $Constant  = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*};
-our $Assignment        = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)};
-our $Compare    = qr{<=|>=|==|!=|<|>};
-our $Operators = qr{
-                       <=|>=|==|!=|
-                       =>|->|<<|>>|<|>|!|~|
-                       &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%
-                 }x;
-
-our $NonptrType;
-our $Type;
-our $Declare;
-
-our $UTF8      = qr {
-       [\x09\x0A\x0D\x20-\x7E]              # ASCII
-       | [\xC2-\xDF][\x80-\xBF]             # non-overlong 2-byte
-       |  \xE0[\xA0-\xBF][\x80-\xBF]        # excluding overlongs
-       | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
-       |  \xED[\x80-\x9F][\x80-\xBF]        # excluding surrogates
-       |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
-       | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
-       |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
-}x;
-
-our $typeTypedefs = qr{(?x:
-       (?:__)?(?:u|s|be|le)(?:8|16|32|64)|
-       atomic_t
-)};
-
-our $logFunctions = qr{(?x:
-       printk|
-       pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)|
-       dev_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)|
-       WARN|
-       panic
-)};
-
-our @typeList = (
-       qr{void},
-       qr{(?:unsigned\s+)?char},
-       qr{(?:unsigned\s+)?short},
-       qr{(?:unsigned\s+)?int},
-       qr{(?:unsigned\s+)?long},
-       qr{(?:unsigned\s+)?long\s+int},
-       qr{(?:unsigned\s+)?long\s+long},
-       qr{(?:unsigned\s+)?long\s+long\s+int},
-       qr{unsigned},
-       qr{float},
-       qr{double},
-       qr{bool},
-       qr{struct\s+$Ident},
-       qr{union\s+$Ident},
-       qr{enum\s+$Ident},
-       qr{${Ident}_t},
-       qr{${Ident}_handler},
-       qr{${Ident}_handler_fn},
-);
-our @modifierList = (
-       qr{fastcall},
-);
-
-sub build_types {
-       my $mods = "(?x:  \n" . join("|\n  ", @modifierList) . "\n)";
-       my $all = "(?x:  \n" . join("|\n  ", @typeList) . "\n)";
-       $Modifier       = qr{(?:$Attribute|$Sparse|$mods)};
-       $NonptrType     = qr{
-                       (?:$Modifier\s+|const\s+)*
-                       (?:
-                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)|
-                               (?:$typeTypedefs\b)|
-                               (?:${all}\b)
-                       )
-                       (?:\s+$Modifier|\s+const)*
-                 }x;
-       $Type   = qr{
-                       $NonptrType
-                       (?:[\s\*]+\s*const|[\s\*]+|(?:\s*\[\s*\])+)?
-                       (?:\s+$Inline|\s+$Modifier)*
-                 }x;
-       $Declare        = qr{(?:$Storage\s+)?$Type};
-}
-build_types();
-
-$chk_signoff = 0 if ($file);
-
-my @dep_includes = ();
-my @dep_functions = ();
-my $removal = "Documentation/feature-removal-schedule.txt";
-if ($tree && -f "$root/$removal") {
-       open(my $REMOVE, '<', "$root/$removal") ||
-                               die "$P: $removal: open failed - $!\n";
-       while (<$REMOVE>) {
-               if (/^Check:\s+(.*\S)/) {
-                       for my $entry (split(/[, ]+/, $1)) {
-                               if ($entry =~ m@include/(.*)@) {
-                                       push(@dep_includes, $1);
-
-                               } elsif ($entry !~ m@/@) {
-                                       push(@dep_functions, $entry);
-                               }
-                       }
-               }
-       }
-       close($REMOVE);
-}
-
-my @rawlines = ();
-my @lines = ();
-my $vname;
-for my $filename (@ARGV) {
-       my $FILE;
-       if ($file) {
-               open($FILE, '-|', "diff -u /dev/null $filename") ||
-                       die "$P: $filename: diff failed - $!\n";
-       } elsif ($filename eq '-') {
-               open($FILE, '<&STDIN');
-       } else {
-               open($FILE, '<', "$filename") ||
-                       die "$P: $filename: open failed - $!\n";
-       }
-       if ($filename eq '-') {
-               $vname = 'Your patch';
-       } else {
-               $vname = $filename;
-       }
-       while (<$FILE>) {
-               chomp;
-               push(@rawlines, $_);
-       }
-       close($FILE);
-       if (!process($filename)) {
-               $exit = 1;
-       }
-       @rawlines = ();
-       @lines = ();
-}
-
-exit($exit);
-
-sub top_of_kernel_tree {
-       my ($root) = @_;
-
-       my @tree_check = (
-               "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile",
-               "README", "Documentation", "arch", "include", "drivers",
-               "fs", "init", "ipc", "kernel", "lib", "scripts",
-       );
-
-       foreach my $check (@tree_check) {
-               if (! -e $root . '/' . $check) {
-                       return 0;
-               }
-       }
-       return 1;
-}
-
-sub expand_tabs {
-       my ($str) = @_;
-
-       my $res = '';
-       my $n = 0;
-       for my $c (split(//, $str)) {
-               if ($c eq "\t") {
-                       $res .= ' ';
-                       $n++;
-                       for (; ($n % 8) != 0; $n++) {
-                               $res .= ' ';
-                       }
-                       next;
-               }
-               $res .= $c;
-               $n++;
-       }
-
-       return $res;
-}
-sub copy_spacing {
-       (my $res = shift) =~ tr/\t/ /c;
-       return $res;
-}
-
-sub line_stats {
-       my ($line) = @_;
-
-       # Drop the diff line leader and expand tabs
-       $line =~ s/^.//;
-       $line = expand_tabs($line);
-
-       # Pick the indent from the front of the line.
-       my ($white) = ($line =~ /^(\s*)/);
-
-       return (length($line), length($white));
-}
-
-my $sanitise_quote = '';
-
-sub sanitise_line_reset {
-       my ($in_comment) = @_;
-
-       if ($in_comment) {
-               $sanitise_quote = '*/';
-       } else {
-               $sanitise_quote = '';
-       }
-}
-sub sanitise_line {
-       my ($line) = @_;
-
-       my $res = '';
-       my $l = '';
-
-       my $qlen = 0;
-       my $off = 0;
-       my $c;
-
-       # Always copy over the diff marker.
-       $res = substr($line, 0, 1);
-
-       for ($off = 1; $off < length($line); $off++) {
-               $c = substr($line, $off, 1);
-
-               # Comments we are wacking completly including the begin
-               # and end, all to $;.
-               if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') {
-                       $sanitise_quote = '*/';
-
-                       substr($res, $off, 2, "$;$;");
-                       $off++;
-                       next;
-               }
-               if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') {
-                       $sanitise_quote = '';
-                       substr($res, $off, 2, "$;$;");
-                       $off++;
-                       next;
-               }
-               if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') {
-                       $sanitise_quote = '//';
-
-                       substr($res, $off, 2, $sanitise_quote);
-                       $off++;
-                       next;
-               }
-
-               # A \ in a string means ignore the next character.
-               if (($sanitise_quote eq "'" || $sanitise_quote eq '"') &&
-                   $c eq "\\") {
-                       substr($res, $off, 2, 'XX');
-                       $off++;
-                       next;
-               }
-               # Regular quotes.
-               if ($c eq "'" || $c eq '"') {
-                       if ($sanitise_quote eq '') {
-                               $sanitise_quote = $c;
-
-                               substr($res, $off, 1, $c);
-                               next;
-                       } elsif ($sanitise_quote eq $c) {
-                               $sanitise_quote = '';
-                       }
-               }
-
-               #print "c<$c> SQ<$sanitise_quote>\n";
-               if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") {
-                       substr($res, $off, 1, $;);
-               } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") {
-                       substr($res, $off, 1, $;);
-               } elsif ($off != 0 && $sanitise_quote && $c ne "\t") {
-                       substr($res, $off, 1, 'X');
-               } else {
-                       substr($res, $off, 1, $c);
-               }
-       }
-
-       if ($sanitise_quote eq '//') {
-               $sanitise_quote = '';
-       }
-
-       # The pathname on a #include may be surrounded by '<' and '>'.
-       if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) {
-               my $clean = 'X' x length($1);
-               $res =~ s@\<.*\>@<$clean>@;
-
-       # The whole of a #error is a string.
-       } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) {
-               my $clean = 'X' x length($1);
-               $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@;
-       }
-
-       return $res;
-}
-
-sub ctx_statement_block {
-       my ($linenr, $remain, $off) = @_;
-       my $line = $linenr - 1;
-       my $blk = '';
-       my $soff = $off;
-       my $coff = $off - 1;
-       my $coff_set = 0;
-
-       my $loff = 0;
-
-       my $type = '';
-       my $level = 0;
-       my @stack = ();
-       my $p;
-       my $c;
-       my $len = 0;
-
-       my $remainder;
-       while (1) {
-               @stack = (['', 0]) if ($#stack == -1);
-
-               #warn "CSB: blk<$blk> remain<$remain>\n";
-               # If we are about to drop off the end, pull in more
-               # context.
-               if ($off >= $len) {
-                       for (; $remain > 0; $line++) {
-                               last if (!defined $lines[$line]);
-                               next if ($lines[$line] =~ /^-/);
-                               $remain--;
-                               $loff = $len;
-                               $blk .= $lines[$line] . "\n";
-                               $len = length($blk);
-                               $line++;
-                               last;
-                       }
-                       # Bail if there is no further context.
-                       #warn "CSB: blk<$blk> off<$off> len<$len>\n";
-                       if ($off >= $len) {
-                               last;
-                       }
-               }
-               $p = $c;
-               $c = substr($blk, $off, 1);
-               $remainder = substr($blk, $off);
-
-               #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n";
-
-               # Handle nested #if/#else.
-               if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) {
-                       push(@stack, [ $type, $level ]);
-               } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) {
-                       ($type, $level) = @{$stack[$#stack - 1]};
-               } elsif ($remainder =~ /^#\s*endif\b/) {
-                       ($type, $level) = @{pop(@stack)};
-               }
-
-               # Statement ends at the ';' or a close '}' at the
-               # outermost level.
-               if ($level == 0 && $c eq ';') {
-                       last;
-               }
-
-               # An else is really a conditional as long as its not else if
-               if ($level == 0 && $coff_set == 0 &&
-                               (!defined($p) || $p =~ /(?:\s|\}|\+)/) &&
-                               $remainder =~ /^(else)(?:\s|{)/ &&
-                               $remainder !~ /^else\s+if\b/) {
-                       $coff = $off + length($1) - 1;
-                       $coff_set = 1;
-                       #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n";
-                       #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n";
-               }
-
-               if (($type eq '' || $type eq '(') && $c eq '(') {
-                       $level++;
-                       $type = '(';
-               }
-               if ($type eq '(' && $c eq ')') {
-                       $level--;
-                       $type = ($level != 0)? '(' : '';
-
-                       if ($level == 0 && $coff < $soff) {
-                               $coff = $off;
-                               $coff_set = 1;
-                               #warn "CSB: mark coff<$coff>\n";
-                       }
-               }
-               if (($type eq '' || $type eq '{') && $c eq '{') {
-                       $level++;
-                       $type = '{';
-               }
-               if ($type eq '{' && $c eq '}') {
-                       $level--;
-                       $type = ($level != 0)? '{' : '';
-
-                       if ($level == 0) {
-                               last;
-                       }
-               }
-               $off++;
-       }
-       # We are truly at the end, so shuffle to the next line.
-       if ($off == $len) {
-               $loff = $len + 1;
-               $line++;
-               $remain--;
-       }
-
-       my $statement = substr($blk, $soff, $off - $soff + 1);
-       my $condition = substr($blk, $soff, $coff - $soff + 1);
-
-       #warn "STATEMENT<$statement>\n";
-       #warn "CONDITION<$condition>\n";
-
-       #print "coff<$coff> soff<$off> loff<$loff>\n";
-
-       return ($statement, $condition,
-                       $line, $remain + 1, $off - $loff + 1, $level);
-}
-
-sub statement_lines {
-       my ($stmt) = @_;
-
-       # Strip the diff line prefixes and rip blank lines at start and end.
-       $stmt =~ s/(^|\n)./$1/g;
-       $stmt =~ s/^\s*//;
-       $stmt =~ s/\s*$//;
-
-       my @stmt_lines = ($stmt =~ /\n/g);
-
-       return $#stmt_lines + 2;
-}
-
-sub statement_rawlines {
-       my ($stmt) = @_;
-
-       my @stmt_lines = ($stmt =~ /\n/g);
-
-       return $#stmt_lines + 2;
-}
-
-sub statement_block_size {
-       my ($stmt) = @_;
-
-       $stmt =~ s/(^|\n)./$1/g;
-       $stmt =~ s/^\s*{//;
-       $stmt =~ s/}\s*$//;
-       $stmt =~ s/^\s*//;
-       $stmt =~ s/\s*$//;
-
-       my @stmt_lines = ($stmt =~ /\n/g);
-       my @stmt_statements = ($stmt =~ /;/g);
-
-       my $stmt_lines = $#stmt_lines + 2;
-       my $stmt_statements = $#stmt_statements + 1;
-
-       if ($stmt_lines > $stmt_statements) {
-               return $stmt_lines;
-       } else {
-               return $stmt_statements;
-       }
-}
-
-sub ctx_statement_full {
-       my ($linenr, $remain, $off) = @_;
-       my ($statement, $condition, $level);
-
-       my (@chunks);
-
-       # Grab the first conditional/block pair.
-       ($statement, $condition, $linenr, $remain, $off, $level) =
-                               ctx_statement_block($linenr, $remain, $off);
-       #print "F: c<$condition> s<$statement> remain<$remain>\n";
-       push(@chunks, [ $condition, $statement ]);
-       if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) {
-               return ($level, $linenr, @chunks);
-       }
-
-       # Pull in the following conditional/block pairs and see if they
-       # could continue the statement.
-       for (;;) {
-               ($statement, $condition, $linenr, $remain, $off, $level) =
-                               ctx_statement_block($linenr, $remain, $off);
-               #print "C: c<$condition> s<$statement> remain<$remain>\n";
-               last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s));
-               #print "C: push\n";
-               push(@chunks, [ $condition, $statement ]);
-       }
-
-       return ($level, $linenr, @chunks);
-}
-
-sub ctx_block_get {
-       my ($linenr, $remain, $outer, $open, $close, $off) = @_;
-       my $line;
-       my $start = $linenr - 1;
-       my $blk = '';
-       my @o;
-       my @c;
-       my @res = ();
-
-       my $level = 0;
-       my @stack = ($level);
-       for ($line = $start; $remain > 0; $line++) {
-               next if ($rawlines[$line] =~ /^-/);
-               $remain--;
-
-               $blk .= $rawlines[$line];
-
-               # Handle nested #if/#else.
-               if ($rawlines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) {
-                       push(@stack, $level);
-               } elsif ($rawlines[$line] =~ /^.\s*#\s*(?:else|elif)\b/) {
-                       $level = $stack[$#stack - 1];
-               } elsif ($rawlines[$line] =~ /^.\s*#\s*endif\b/) {
-                       $level = pop(@stack);
-               }
-
-               foreach my $c (split(//, $rawlines[$line])) {
-                       ##print "C<$c>L<$level><$open$close>O<$off>\n";
-                       if ($off > 0) {
-                               $off--;
-                               next;
-                       }
-
-                       if ($c eq $close && $level > 0) {
-                               $level--;
-                               last if ($level == 0);
-                       } elsif ($c eq $open) {
-                               $level++;
-                       }
-               }
-
-               if (!$outer || $level <= 1) {
-                       push(@res, $rawlines[$line]);
-               }
-
-               last if ($level == 0);
-       }
-
-       return ($level, @res);
-}
-sub ctx_block_outer {
-       my ($linenr, $remain) = @_;
-
-       my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0);
-       return @r;
-}
-sub ctx_block {
-       my ($linenr, $remain) = @_;
-
-       my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0);
-       return @r;
-}
-sub ctx_statement {
-       my ($linenr, $remain, $off) = @_;
-
-       my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off);
-       return @r;
-}
-sub ctx_block_level {
-       my ($linenr, $remain) = @_;
-
-       return ctx_block_get($linenr, $remain, 0, '{', '}', 0);
-}
-sub ctx_statement_level {
-       my ($linenr, $remain, $off) = @_;
-
-       return ctx_block_get($linenr, $remain, 0, '(', ')', $off);
-}
-
-sub ctx_locate_comment {
-       my ($first_line, $end_line) = @_;
-
-       # Catch a comment on the end of the line itself.
-       my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@);
-       return $current_comment if (defined $current_comment);
-
-       # Look through the context and try and figure out if there is a
-       # comment.
-       my $in_comment = 0;
-       $current_comment = '';
-       for (my $linenr = $first_line; $linenr < $end_line; $linenr++) {
-               my $line = $rawlines[$linenr - 1];
-               #warn "           $line\n";
-               if ($linenr == $first_line and $line =~ m@^.\s*\*@) {
-                       $in_comment = 1;
-               }
-               if ($line =~ m@/\*@) {
-                       $in_comment = 1;
-               }
-               if (!$in_comment && $current_comment ne '') {
-                       $current_comment = '';
-               }
-               $current_comment .= $line . "\n" if ($in_comment);
-               if ($line =~ m@\*/@) {
-                       $in_comment = 0;
-               }
-       }
-
-       chomp($current_comment);
-       return($current_comment);
-}
-sub ctx_has_comment {
-       my ($first_line, $end_line) = @_;
-       my $cmt = ctx_locate_comment($first_line, $end_line);
-
-       ##print "LINE: $rawlines[$end_line - 1 ]\n";
-       ##print "CMMT: $cmt\n";
-
-       return ($cmt ne '');
-}
-
-sub raw_line {
-       my ($linenr, $cnt) = @_;
-
-       my $offset = $linenr - 1;
-       $cnt++;
-
-       my $line;
-       while ($cnt) {
-               $line = $rawlines[$offset++];
-               next if (defined($line) && $line =~ /^-/);
-               $cnt--;
-       }
-
-       return $line;
-}
-
-sub cat_vet {
-       my ($vet) = @_;
-       my ($res, $coded);
-
-       $res = '';
-       while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) {
-               $res .= $1;
-               if ($2 ne '') {
-                       $coded = sprintf("^%c", unpack('C', $2) + 64);
-                       $res .= $coded;
-               }
-       }
-       $res =~ s/$/\$/;
-
-       return $res;
-}
-
-my $av_preprocessor = 0;
-my $av_pending;
-my @av_paren_type;
-my $av_pend_colon;
-
-sub annotate_reset {
-       $av_preprocessor = 0;
-       $av_pending = '_';
-       @av_paren_type = ('E');
-       $av_pend_colon = 'O';
-}
-
-sub annotate_values {
-       my ($stream, $type) = @_;
-
-       my $res;
-       my $var = '_' x length($stream);
-       my $cur = $stream;
-
-       print "$stream\n" if ($dbg_values > 1);
-
-       while (length($cur)) {
-               @av_paren_type = ('E') if ($#av_paren_type < 0);
-               print " <" . join('', @av_paren_type) .
-                               "> <$type> <$av_pending>" if ($dbg_values > 1);
-               if ($cur =~ /^(\s+)/o) {
-                       print "WS($1)\n" if ($dbg_values > 1);
-                       if ($1 =~ /\n/ && $av_preprocessor) {
-                               $type = pop(@av_paren_type);
-                               $av_preprocessor = 0;
-                       }
-
-               } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\()/) {
-                       print "DECLARE($1)\n" if ($dbg_values > 1);
-                       $type = 'T';
-
-               } elsif ($cur =~ /^($Modifier)\s*/) {
-                       print "MODIFIER($1)\n" if ($dbg_values > 1);
-                       $type = 'T';
-
-               } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) {
-                       print "DEFINE($1,$2)\n" if ($dbg_values > 1);
-                       $av_preprocessor = 1;
-                       push(@av_paren_type, $type);
-                       if ($2 ne '') {
-                               $av_pending = 'N';
-                       }
-                       $type = 'E';
-
-               } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) {
-                       print "UNDEF($1)\n" if ($dbg_values > 1);
-                       $av_preprocessor = 1;
-                       push(@av_paren_type, $type);
-
-               } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) {
-                       print "PRE_START($1)\n" if ($dbg_values > 1);
-                       $av_preprocessor = 1;
-
-                       push(@av_paren_type, $type);
-                       push(@av_paren_type, $type);
-                       $type = 'E';
-
-               } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) {
-                       print "PRE_RESTART($1)\n" if ($dbg_values > 1);
-                       $av_preprocessor = 1;
-
-                       push(@av_paren_type, $av_paren_type[$#av_paren_type]);
-
-                       $type = 'E';
-
-               } elsif ($cur =~ /^(\#\s*(?:endif))/o) {
-                       print "PRE_END($1)\n" if ($dbg_values > 1);
-
-                       $av_preprocessor = 1;
-
-                       # Assume all arms of the conditional end as this
-                       # one does, and continue as if the #endif was not here.
-                       pop(@av_paren_type);
-                       push(@av_paren_type, $type);
-                       $type = 'E';
-
-               } elsif ($cur =~ /^(\\\n)/o) {
-                       print "PRECONT($1)\n" if ($dbg_values > 1);
-
-               } elsif ($cur =~ /^(__attribute__)\s*\(?/o) {
-                       print "ATTR($1)\n" if ($dbg_values > 1);
-                       $av_pending = $type;
-                       $type = 'N';
-
-               } elsif ($cur =~ /^(sizeof)\s*(\()?/o) {
-                       print "SIZEOF($1)\n" if ($dbg_values > 1);
-                       if (defined $2) {
-                               $av_pending = 'V';
-                       }
-                       $type = 'N';
-
-               } elsif ($cur =~ /^(if|while|for)\b/o) {
-                       print "COND($1)\n" if ($dbg_values > 1);
-                       $av_pending = 'E';
-                       $type = 'N';
-
-               } elsif ($cur =~/^(case)/o) {
-                       print "CASE($1)\n" if ($dbg_values > 1);
-                       $av_pend_colon = 'C';
-                       $type = 'N';
-
-               } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) {
-                       print "KEYWORD($1)\n" if ($dbg_values > 1);
-                       $type = 'N';
-
-               } elsif ($cur =~ /^(\()/o) {
-                       print "PAREN('$1')\n" if ($dbg_values > 1);
-                       push(@av_paren_type, $av_pending);
-                       $av_pending = '_';
-                       $type = 'N';
-
-               } elsif ($cur =~ /^(\))/o) {
-                       my $new_type = pop(@av_paren_type);
-                       if ($new_type ne '_') {
-                               $type = $new_type;
-                               print "PAREN('$1') -> $type\n"
-                                                       if ($dbg_values > 1);
-                       } else {
-                               print "PAREN('$1')\n" if ($dbg_values > 1);
-                       }
-
-               } elsif ($cur =~ /^($Ident)\s*\(/o) {
-                       print "FUNC($1)\n" if ($dbg_values > 1);
-                       $type = 'V';
-                       $av_pending = 'V';
-
-               } elsif ($cur =~ /^($Ident\s*):(?:\s*\d+\s*(,|=|;))?/) {
-                       if (defined $2 && $type eq 'C' || $type eq 'T') {
-                               $av_pend_colon = 'B';
-                       } elsif ($type eq 'E') {
-                               $av_pend_colon = 'L';
-                       }
-                       print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1);
-                       $type = 'V';
-
-               } elsif ($cur =~ /^($Ident|$Constant)/o) {
-                       print "IDENT($1)\n" if ($dbg_values > 1);
-                       $type = 'V';
-
-               } elsif ($cur =~ /^($Assignment)/o) {
-                       print "ASSIGN($1)\n" if ($dbg_values > 1);
-                       $type = 'N';
-
-               } elsif ($cur =~/^(;|{|})/) {
-                       print "END($1)\n" if ($dbg_values > 1);
-                       $type = 'E';
-                       $av_pend_colon = 'O';
-
-               } elsif ($cur =~/^(,)/) {
-                       print "COMMA($1)\n" if ($dbg_values > 1);
-                       $type = 'C';
-
-               } elsif ($cur =~ /^(\?)/o) {
-                       print "QUESTION($1)\n" if ($dbg_values > 1);
-                       $type = 'N';
-
-               } elsif ($cur =~ /^(:)/o) {
-                       print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1);
-
-                       substr($var, length($res), 1, $av_pend_colon);
-                       if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') {
-                               $type = 'E';
-                       } else {
-                               $type = 'N';
-                       }
-                       $av_pend_colon = 'O';
-
-               } elsif ($cur =~ /^(\[)/o) {
-                       print "CLOSE($1)\n" if ($dbg_values > 1);
-                       $type = 'N';
-
-               } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) {
-                       my $variant;
-
-                       print "OPV($1)\n" if ($dbg_values > 1);
-                       if ($type eq 'V') {
-                               $variant = 'B';
-                       } else {
-                               $variant = 'U';
-                       }
-
-                       substr($var, length($res), 1, $variant);
-                       $type = 'N';
-
-               } elsif ($cur =~ /^($Operators)/o) {
-                       print "OP($1)\n" if ($dbg_values > 1);
-                       if ($1 ne '++' && $1 ne '--') {
-                               $type = 'N';
-                       }
-
-               } elsif ($cur =~ /(^.)/o) {
-                       print "C($1)\n" if ($dbg_values > 1);
-               }
-               if (defined $1) {
-                       $cur = substr($cur, length($1));
-                       $res .= $type x length($1);
-               }
-       }
-
-       return ($res, $var);
-}
-
-sub possible {
-       my ($possible, $line) = @_;
-       my $notPermitted = qr{(?:
-               ^(?:
-                       $Modifier|
-                       $Storage|
-                       $Type|
-                       DEFINE_\S+
-               )$|
-               ^(?:
-                       goto|
-                       return|
-                       case|
-                       else|
-                       asm|__asm__|
-                       do
-               )(?:\s|$)|
-               ^(?:typedef|struct|enum)\b
-           )}x;
-       warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2);
-       if ($possible !~ $notPermitted) {
-               # Check for modifiers.
-               $possible =~ s/\s*$Storage\s*//g;
-               $possible =~ s/\s*$Sparse\s*//g;
-               if ($possible =~ /^\s*$/) {
-
-               } elsif ($possible =~ /\s/) {
-                       $possible =~ s/\s*$Type\s*//g;
-                       for my $modifier (split(' ', $possible)) {
-                               if ($modifier !~ $notPermitted) {
-                                       warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible);
-                                       push(@modifierList, $modifier);
-                               }
-                       }
-
-               } else {
-                       warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
-                       push(@typeList, $possible);
-               }
-               build_types();
-       } else {
-               warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1);
-       }
-}
-
-my $prefix = '';
-
-sub report {
-       if (defined $tst_only && $_[0] !~ /\Q$tst_only\E/) {
-               return 0;
-       }
-       my $line = $prefix . $_[0];
-
-       $line = (split('\n', $line))[0] . "\n" if ($terse);
-
-       push(our @report, $line);
-
-       return 1;
-}
-sub report_dump {
-       our @report;
-}
-sub ERROR {
-       if (report("ERROR: $_[0]\n")) {
-               our $clean = 0;
-               our $cnt_error++;
-       }
-}
-sub WARN {
-       if (report("WARNING: $_[0]\n")) {
-               our $clean = 0;
-               our $cnt_warn++;
-       }
-}
-sub CHK {
-       if ($check && report("CHECK: $_[0]\n")) {
-               our $clean = 0;
-               our $cnt_chk++;
-       }
-}
-
-sub check_absolute_file {
-       my ($absolute, $herecurr) = @_;
-       my $file = $absolute;
-
-       ##print "absolute<$absolute>\n";
-
-       # See if any suffix of this path is a path within the tree.
-       while ($file =~ s@^[^/]*/@@) {
-               if (-f "$root/$file") {
-                       ##print "file<$file>\n";
-                       last;
-               }
-       }
-       if (! -f _)  {
-               return 0;
-       }
-
-       # It is, so see if the prefix is acceptable.
-       my $prefix = $absolute;
-       substr($prefix, -length($file)) = '';
-
-       ##print "prefix<$prefix>\n";
-       if ($prefix ne ".../") {
-               WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr);
-       }
-}
-
-sub process {
-       my $filename = shift;
-
-       my $linenr=0;
-       my $prevline="";
-       my $prevrawline="";
-       my $stashline="";
-       my $stashrawline="";
-
-       my $length;
-       my $indent;
-       my $previndent=0;
-       my $stashindent=0;
-
-       our $clean = 1;
-       my $signoff = 0;
-       my $is_patch = 0;
-
-       our @report = ();
-       our $cnt_lines = 0;
-       our $cnt_error = 0;
-       our $cnt_warn = 0;
-       our $cnt_chk = 0;
-
-       # Trace the real file/line as we go.
-       my $realfile = '';
-       my $realline = 0;
-       my $realcnt = 0;
-       my $here = '';
-       my $in_comment = 0;
-       my $comment_edge = 0;
-       my $first_line = 0;
-       my $p1_prefix = '';
-
-       my $prev_values = 'E';
-
-       # suppression flags
-       my %suppress_ifbraces;
-       my %suppress_whiletrailers;
-       my %suppress_export;
-
-       # Pre-scan the patch sanitizing the lines.
-       # Pre-scan the patch looking for any __setup documentation.
-       #
-       my @setup_docs = ();
-       my $setup_docs = 0;
-
-       sanitise_line_reset();
-       my $line;
-       foreach my $rawline (@rawlines) {
-               $linenr++;
-               $line = $rawline;
-
-               if ($rawline=~/^\+\+\+\s+(\S+)/) {
-                       $setup_docs = 0;
-                       if ($1 =~ m@Documentation/kernel-parameters.txt$@) {
-                               $setup_docs = 1;
-                       }
-                       #next;
-               }
-               if ($rawline=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
-                       $realline=$1-1;
-                       if (defined $2) {
-                               $realcnt=$3+1;
-                       } else {
-                               $realcnt=1+1;
-                       }
-                       $in_comment = 0;
-
-                       # Guestimate if this is a continuing comment.  Run
-                       # the context looking for a comment "edge".  If this
-                       # edge is a close comment then we must be in a comment
-                       # at context start.
-                       my $edge;
-                       my $cnt = $realcnt;
-                       for (my $ln = $linenr + 1; $cnt > 0; $ln++) {
-                               next if (defined $rawlines[$ln - 1] &&
-                                        $rawlines[$ln - 1] =~ /^-/);
-                               $cnt--;
-                               #print "RAW<$rawlines[$ln - 1]>\n";
-                               last if (!defined $rawlines[$ln - 1]);
-                               if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ &&
-                                   $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) {
-                                       ($edge) = $1;
-                                       last;
-                               }
-                       }
-                       if (defined $edge && $edge eq '*/') {
-                               $in_comment = 1;
-                       }
-
-                       # Guestimate if this is a continuing comment.  If this
-                       # is the start of a diff block and this line starts
-                       # ' *' then it is very likely a comment.
-                       if (!defined $edge &&
-                           $rawlines[$linenr] =~ m@^.\s*(?:\*\*+| \*)(?:\s|$)@)
-                       {
-                               $in_comment = 1;
-                       }
-
-                       ##print "COMMENT:$in_comment edge<$edge> $rawline\n";
-                       sanitise_line_reset($in_comment);
-
-               } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) {
-                       # Standardise the strings and chars within the input to
-                       # simplify matching -- only bother with positive lines.
-                       $line = sanitise_line($rawline);
-               }
-               push(@lines, $line);
-
-               if ($realcnt > 1) {
-                       $realcnt-- if ($line =~ /^(?:\+| |$)/);
-               } else {
-                       $realcnt = 0;
-               }
-
-               #print "==>$rawline\n";
-               #print "-->$line\n";
-
-               if ($setup_docs && $line =~ /^\+/) {
-                       push(@setup_docs, $line);
-               }
-       }
-
-       $prefix = '';
-
-       $realcnt = 0;
-       $linenr = 0;
-       foreach my $line (@lines) {
-               $linenr++;
-
-               my $rawline = $rawlines[$linenr - 1];
-
-#extract the line range in the file after the patch is applied
-               if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
-                       $is_patch = 1;
-                       $first_line = $linenr + 1;
-                       $realline=$1-1;
-                       if (defined $2) {
-                               $realcnt=$3+1;
-                       } else {
-                               $realcnt=1+1;
-                       }
-                       annotate_reset();
-                       $prev_values = 'E';
-
-                       %suppress_ifbraces = ();
-                       %suppress_whiletrailers = ();
-                       %suppress_export = ();
-                       next;
-
-# track the line number as we move through the hunk, note that
-# new versions of GNU diff omit the leading space on completely
-# blank context lines so we need to count that too.
-               } elsif ($line =~ /^( |\+|$)/) {
-                       $realline++;
-                       $realcnt-- if ($realcnt != 0);
-
-                       # Measure the line length and indent.
-                       ($length, $indent) = line_stats($rawline);
-
-                       # Track the previous line.
-                       ($prevline, $stashline) = ($stashline, $line);
-                       ($previndent, $stashindent) = ($stashindent, $indent);
-                       ($prevrawline, $stashrawline) = ($stashrawline, $rawline);
-
-                       #warn "line<$line>\n";
-
-               } elsif ($realcnt == 1) {
-                       $realcnt--;
-               }
-
-               my $hunk_line = ($realcnt != 0);
-
-#make up the handle for any error we report on this line
-               $prefix = "$filename:$realline: " if ($emacs && $file);
-               $prefix = "$filename:$linenr: " if ($emacs && !$file);
-
-               $here = "#$linenr: " if (!$file);
-               $here = "#$realline: " if ($file);
-
-               # extract the filename as it passes
-               if ($line=~/^\+\+\+\s+(\S+)/) {
-                       $realfile = $1;
-                       $realfile =~ s@^([^/]*)/@@;
-
-                       $p1_prefix = $1;
-                       if (!$file && $tree && $p1_prefix ne '' &&
-                           -e "$root/$p1_prefix") {
-                               WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
-                       }
-
-                       if ($realfile =~ m@^include/asm/@) {
-                               ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
-                       }
-                       next;
-               }
-
-               $here .= "FILE: $realfile:$realline:" if ($realcnt != 0);
-
-               my $hereline = "$here\n$rawline\n";
-               my $herecurr = "$here\n$rawline\n";
-               my $hereprev = "$here\n$prevrawline\n$rawline\n";
-
-               $cnt_lines++ if ($realcnt != 0);
-
-#check the patch for a signoff:
-               if ($line =~ /^\s*signed-off-by:/i) {
-                       # This is a signoff, if ugly, so do not double report.
-                       $signoff++;
-                       if (!($line =~ /^\s*Signed-off-by:/)) {
-                               WARN("Signed-off-by: is the preferred form\n" .
-                                       $herecurr);
-                       }
-                       if ($line =~ /^\s*signed-off-by:\S/i) {
-                               WARN("space required after Signed-off-by:\n" .
-                                       $herecurr);
-                       }
-               }
-
-# Check for wrappage within a valid hunk of the file
-               if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
-                       ERROR("patch seems to be corrupt (line wrapped?)\n" .
-                               $herecurr) if (!$emitted_corrupt++);
-               }
-
-# Check for absolute kernel paths.
-               if ($tree) {
-                       while ($line =~ m{(?:^|\s)(/\S*)}g) {
-                               my $file = $1;
-
-                               if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
-                                   check_absolute_file($1, $herecurr)) {
-                                       #
-                               } else {
-                                       check_absolute_file($file, $herecurr);
-                               }
-                       }
-               }
-
-# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
-               if (($realfile =~ /^$/ || $line =~ /^\+/) &&
-                   $rawline !~ m/^$UTF8*$/) {
-                       my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/);
-
-                       my $blank = copy_spacing($rawline);
-                       my $ptr = substr($blank, 0, length($utf8_prefix)) . "^";
-                       my $hereptr = "$hereline$ptr\n";
-
-                       ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr);
-               }
-
-# ignore non-hunk lines and lines being removed
-               next if (!$hunk_line || $line =~ /^-/);
-
-#trailing whitespace
-               if ($line =~ /^\+.*\015/) {
-                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-                       ERROR("DOS line endings\n" . $herevet);
-
-               } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) {
-                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-                       ERROR("trailing whitespace\n" . $herevet);
-               }
-
-# check for Kconfig help text having a real description
-               if ($realfile =~ /Kconfig/ &&
-                   $line =~ /\+?\s*(---)?help(---)?$/) {
-                       my $length = 0;
-                       for (my $l = $linenr; defined($lines[$l]); $l++) {
-                               my $f = $lines[$l];
-                               $f =~ s/#.*//;
-                               $f =~ s/^\s+//;
-                               next if ($f =~ /^$/);
-                               last if ($f =~ /^\s*config\s/);
-                               $length++;
-                       }
-                       WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4);
-               }
-
-# check we are in a valid source file if not then ignore this hunk
-               next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
-
-#80 column limit
-               if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
-                   $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
-                   $line !~ /^\+\s*$logFunctions\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
-                   $length > 80)
-               {
-                       WARN("line over 80 characters\n" . $herecurr);
-               }
-
-# check for spaces before a quoted newline
-               if ($rawline =~ /^.*\".*\s\\n/) {
-                       WARN("unnecessary whitespace before a quoted newline\n" . $herecurr);
-               }
-
-# check for adding lines without a newline.
-               if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
-                       WARN("adding a line without newline at end of file\n" . $herecurr);
-               }
-
-# Blackfin: use hi/lo macros
-               if ($realfile =~ m@arch/blackfin/.*\.S$@) {
-                       if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) {
-                               my $herevet = "$here\n" . cat_vet($line) . "\n";
-                               ERROR("use the LO() macro, not (... & 0xFFFF)\n" . $herevet);
-                       }
-                       if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) {
-                               my $herevet = "$here\n" . cat_vet($line) . "\n";
-                               ERROR("use the HI() macro, not (... >> 16)\n" . $herevet);
-                       }
-               }
-
-# check we are in a valid source file C or perl if not then ignore this hunk
-               next if ($realfile !~ /\.(h|c|pl)$/);
-
-# at the beginning of a line any tabs must come first and anything
-# more than 8 must use tabs.
-               if ($rawline =~ /^\+\s* \t\s*\S/ ||
-                   $rawline =~ /^\+\s*        \s*/) {
-                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-                       ERROR("code indent should use tabs where possible\n" . $herevet);
-               }
-
-# check for space before tabs.
-               if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
-                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
-                       WARN("please, no space before tabs\n" . $herevet);
-               }
-
-# check we are in a valid C source file if not then ignore this hunk
-               next if ($realfile !~ /\.(h|c)$/);
-
-# check for RCS/CVS revision markers
-               if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
-                       WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr);
-               }
-
-# Blackfin: don't use __builtin_bfin_[cs]sync
-               if ($line =~ /__builtin_bfin_csync/) {
-                       my $herevet = "$here\n" . cat_vet($line) . "\n";
-                       ERROR("use the CSYNC() macro in asm/blackfin.h\n" . $herevet);
-               }
-               if ($line =~ /__builtin_bfin_ssync/) {
-                       my $herevet = "$here\n" . cat_vet($line) . "\n";
-                       ERROR("use the SSYNC() macro in asm/blackfin.h\n" . $herevet);
-               }
-
-# Check for potential 'bare' types
-               my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
-                   $realline_next);
-               if ($realcnt && $line =~ /.\s*\S/) {
-                       ($stat, $cond, $line_nr_next, $remain_next, $off_next) =
-                               ctx_statement_block($linenr, $realcnt, 0);
-                       $stat =~ s/\n./\n /g;
-                       $cond =~ s/\n./\n /g;
-
-                       # Find the real next line.
-                       $realline_next = $line_nr_next;
-                       if (defined $realline_next &&
-                           (!defined $lines[$realline_next - 1] ||
-                            substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) {
-                               $realline_next++;
-                       }
-
-                       my $s = $stat;
-                       $s =~ s/{.*$//s;
-
-                       # Ignore goto labels.
-                       if ($s =~ /$Ident:\*$/s) {
-
-                       # Ignore functions being called
-                       } elsif ($s =~ /^.\s*$Ident\s*\(/s) {
-
-                       } elsif ($s =~ /^.\s*else\b/s) {
-
-                       # declarations always start with types
-                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) {
-                               my $type = $1;
-                               $type =~ s/\s+/ /g;
-                               possible($type, "A:" . $s);
-
-                       # definitions in global scope can only start with types
-                       } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b\s*(?!:)/s) {
-                               possible($1, "B:" . $s);
-                       }
-
-                       # any (foo ... *) is a pointer cast, and foo is a type
-                       while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) {
-                               possible($1, "C:" . $s);
-                       }
-
-                       # Check for any sort of function declaration.
-                       # int foo(something bar, other baz);
-                       # void (*store_gdt)(x86_descr_ptr *);
-                       if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/s) {
-                               my ($name_len) = length($1);
-
-                               my $ctx = $s;
-                               substr($ctx, 0, $name_len + 1, '');
-                               $ctx =~ s/\)[^\)]*$//;
-
-                               for my $arg (split(/\s*,\s*/, $ctx)) {
-                                       if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) {
-
-                                               possible($1, "D:" . $s);
-                                       }
-                               }
-                       }
-
-               }
-
-#
-# Checks which may be anchored in the context.
-#
-
-# Check for switch () and associated case and default
-# statements should be at the same indent.
-               if ($line=~/\bswitch\s*\(.*\)/) {
-                       my $err = '';
-                       my $sep = '';
-                       my @ctx = ctx_block_outer($linenr, $realcnt);
-                       shift(@ctx);
-                       for my $ctx (@ctx) {
-                               my ($clen, $cindent) = line_stats($ctx);
-                               if ($ctx =~ /^\+\s*(case\s+|default:)/ &&
-                                                       $indent != $cindent) {
-                                       $err .= "$sep$ctx\n";
-                                       $sep = '';
-                               } else {
-                                       $sep = "[...]\n";
-                               }
-                       }
-                       if ($err ne '') {
-                               ERROR("switch and case should be at the same indent\n$hereline$err");
-                       }
-               }
-
-# if/while/etc brace do not go on next line, unless defining a do while loop,
-# or if that brace on the next line is for something else
-               if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
-                       my $pre_ctx = "$1$2";
-
-                       my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
-                       my $ctx_cnt = $realcnt - $#ctx - 1;
-                       my $ctx = join("\n", @ctx);
-
-                       my $ctx_ln = $linenr;
-                       my $ctx_skip = $realcnt;
-
-                       while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt &&
-                                       defined $lines[$ctx_ln - 1] &&
-                                       $lines[$ctx_ln - 1] =~ /^-/)) {
-                               ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n";
-                               $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/);
-                               $ctx_ln++;
-                       }
-
-                       #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
-                       #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";
-
-                       if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
-                               ERROR("that open brace { should be on the previous line\n" .
-                                       "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
-                       }
-                       if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
-                           $ctx =~ /\)\s*\;\s*$/ &&
-                           defined $lines[$ctx_ln - 1])
-                       {
-                               my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
-                               if ($nindent > $indent) {
-                                       WARN("trailing semicolon indicates no statements, indent implies otherwise\n" .
-                                               "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
-                               }
-                       }
-               }
-
-# Check relative indent for conditionals and blocks.
-               if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
-                       my ($s, $c) = ($stat, $cond);
-
-                       substr($s, 0, length($c), '');
-
-                       # Make sure we remove the line prefixes as we have
-                       # none on the first line, and are going to readd them
-                       # where necessary.
-                       $s =~ s/\n./\n/gs;
-
-                       # Find out how long the conditional actually is.
-                       my @newlines = ($c =~ /\n/gs);
-                       my $cond_lines = 1 + $#newlines;
-
-                       # We want to check the first line inside the block
-                       # starting at the end of the conditional, so remove:
-                       #  1) any blank line termination
-                       #  2) any opening brace { on end of the line
-                       #  3) any do (...) {
-                       my $continuation = 0;
-                       my $check = 0;
-                       $s =~ s/^.*\bdo\b//;
-                       $s =~ s/^\s*{//;
-                       if ($s =~ s/^\s*\\//) {
-                               $continuation = 1;
-                       }
-                       if ($s =~ s/^\s*?\n//) {
-                               $check = 1;
-                               $cond_lines++;
-                       }
-
-                       # Also ignore a loop construct at the end of a
-                       # preprocessor statement.
-                       if (($prevline =~ /^.\s*#\s*define\s/ ||
-                           $prevline =~ /\\\s*$/) && $continuation == 0) {
-                               $check = 0;
-                       }
-
-                       my $cond_ptr = -1;
-                       $continuation = 0;
-                       while ($cond_ptr != $cond_lines) {
-                               $cond_ptr = $cond_lines;
-
-                               # If we see an #else/#elif then the code
-                               # is not linear.
-                               if ($s =~ /^\s*\#\s*(?:else|elif)/) {
-                                       $check = 0;
-                               }
-
-                               # Ignore:
-                               #  1) blank lines, they should be at 0,
-                               #  2) preprocessor lines, and
-                               #  3) labels.
-                               if ($continuation ||
-                                   $s =~ /^\s*?\n/ ||
-                                   $s =~ /^\s*#\s*?/ ||
-                                   $s =~ /^\s*$Ident\s*:/) {
-                                       $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0;
-                                       if ($s =~ s/^.*?\n//) {
-                                               $cond_lines++;
-                                       }
-                               }
-                       }
-
-                       my (undef, $sindent) = line_stats("+" . $s);
-                       my $stat_real = raw_line($linenr, $cond_lines);
-
-                       # Check if either of these lines are modified, else
-                       # this is not this patch's fault.
-                       if (!defined($stat_real) ||
-                           $stat !~ /^\+/ && $stat_real !~ /^\+/) {
-                               $check = 0;
-                       }
-                       if (defined($stat_real) && $cond_lines > 1) {
-                               $stat_real = "[...]\n$stat_real";
-                       }
-
-                       #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";
-
-                       if ($check && (($sindent % 8) != 0 ||
-                           ($sindent <= $indent && $s ne ''))) {
-                               WARN("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
-                       }
-               }
-
-               # Track the 'values' across context and added lines.
-               my $opline = $line; $opline =~ s/^./ /;
-               my ($curr_values, $curr_vars) =
-                               annotate_values($opline . "\n", $prev_values);
-               $curr_values = $prev_values . $curr_values;
-               if ($dbg_values) {
-                       my $outline = $opline; $outline =~ s/\t/ /g;
-                       print "$linenr > .$outline\n";
-                       print "$linenr > $curr_values\n";
-                       print "$linenr >  $curr_vars\n";
-               }
-               $prev_values = substr($curr_values, -1);
-
-#ignore lines not being added
-               if ($line=~/^[^\+]/) {next;}
-
-# TEST: allow direct testing of the type matcher.
-               if ($dbg_type) {
-                       if ($line =~ /^.\s*$Declare\s*$/) {
-                               ERROR("TEST: is type\n" . $herecurr);
-                       } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) {
-                               ERROR("TEST: is not type ($1 is)\n". $herecurr);
-                       }
-                       next;
-               }
-# TEST: allow direct testing of the attribute matcher.
-               if ($dbg_attr) {
-                       if ($line =~ /^.\s*$Modifier\s*$/) {
-                               ERROR("TEST: is attr\n" . $herecurr);
-                       } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) {
-                               ERROR("TEST: is not attr ($1 is)\n". $herecurr);
-                       }
-                       next;
-               }
-
-# check for initialisation to aggregates open brace on the next line
-               if ($line =~ /^.\s*{/ &&
-                   $prevline =~ /(?:^|[^=])=\s*$/) {
-                       ERROR("that open brace { should be on the previous line\n" . $hereprev);
-               }
-
-#
-# Checks which are anchored on the added line.
-#
-
-# check for malformed paths in #include statements (uses RAW line)
-               if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {
-                       my $path = $1;
-                       if ($path =~ m{//}) {
-                               ERROR("malformed #include filename\n" .
-                                       $herecurr);
-                       }
-               }
-
-# no C99 // comments
-               if ($line =~ m{//}) {
-                       ERROR("do not use C99 // comments\n" . $herecurr);
-               }
-               # Remove C99 comments.
-               $line =~ s@//.*@@;
-               $opline =~ s@//.*@@;
-
-# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider
-# the whole statement.
-#print "APW <$lines[$realline_next - 1]>\n";
-               if (defined $realline_next &&
-                   exists $lines[$realline_next - 1] &&
-                   !defined $suppress_export{$realline_next} &&
-                   ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
-                    $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
-                       my $name = $1;
-                       if ($stat !~ /(?:
-                               \n.}\s*$|
-                               ^.DEFINE_$Ident\(\Q$name\E\)|
-                               ^.DECLARE_$Ident\(\Q$name\E\)|
-                               ^.LIST_HEAD\(\Q$name\E\)|
-                               ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
-                               \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\()
-                           )/x) {
-#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n";
-                               $suppress_export{$realline_next} = 2;
-                       } else {
-                               $suppress_export{$realline_next} = 1;
-                       }
-               }
-               if (!defined $suppress_export{$linenr} &&
-                   $prevline =~ /^.\s*$/ &&
-                   ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
-                    $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
-#print "FOO B <$lines[$linenr - 1]>\n";
-                       $suppress_export{$linenr} = 2;
-               }
-               if (defined $suppress_export{$linenr} &&
-                   $suppress_export{$linenr} == 2) {
-                       WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr);
-               }
-
-# check for external initialisers.
-               if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) {
-                       ERROR("do not initialise externals to 0 or NULL\n" .
-                               $herecurr);
-               }
-# check for static initialisers.
-               if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) {
-                       ERROR("do not initialise statics to 0 or NULL\n" .
-                               $herecurr);
-               }
-
-# check for new typedefs, only function parameters and sparse annotations
-# make sense.
-               if ($line =~ /\btypedef\s/ &&
-                   $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ &&
-                   $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
-                   $line !~ /\b$typeTypedefs\b/ &&
-                   $line !~ /\b__bitwise(?:__|)\b/) {
-                       WARN("do not add new typedefs\n" . $herecurr);
-               }
-
-# * goes on variable not on type
-               # (char*[ const])
-               if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) {
-                       my ($from, $to) = ($1, $1);
-
-                       # Should start with a space.
-                       $to =~ s/^(\S)/ $1/;
-                       # Should not end with a space.
-                       $to =~ s/\s+$//;
-                       # '*'s should not have spaces between.
-                       while ($to =~ s/\*\s+\*/\*\*/) {
-                       }
-
-                       #print "from<$from> to<$to>\n";
-                       if ($from ne $to) {
-                               ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" .  $herecurr);
-                       }
-               } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) {
-                       my ($from, $to, $ident) = ($1, $1, $2);
-
-                       # Should start with a space.
-                       $to =~ s/^(\S)/ $1/;
-                       # Should not end with a space.
-                       $to =~ s/\s+$//;
-                       # '*'s should not have spaces between.
-                       while ($to =~ s/\*\s+\*/\*\*/) {
-                       }
-                       # Modifiers should have spaces.
-                       $to =~ s/(\b$Modifier$)/$1 /;
-
-                       #print "from<$from> to<$to> ident<$ident>\n";
-                       if ($from ne $to && $ident !~ /^$Modifier$/) {
-                               ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" .  $herecurr);
-                       }
-               }
-
-# # no BUG() or BUG_ON()
-#              if ($line =~ /\b(BUG|BUG_ON)\b/) {
-#                      print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n";
-#                      print "$herecurr";
-#                      $clean = 0;
-#              }
-
-               if ($line =~ /\bLINUX_VERSION_CODE\b/) {
-                       WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr);
-               }
-
-# printk should use KERN_* levels.  Note that follow on printk's on the
-# same line do not need a level, so we use the current block context
-# to try and find and validate the current printk.  In summary the current
-# printk includes all preceeding printk's which have no newline on the end.
-# we assume the first bad printk is the one to report.
-               if ($line =~ /\bprintk\((?!KERN_)\s*"/) {
-                       my $ok = 0;
-                       for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) {
-                               #print "CHECK<$lines[$ln - 1]\n";
-                               # we have a preceeding printk if it ends
-                               # with "\n" ignore it, else it is to blame
-                               if ($lines[$ln - 1] =~ m{\bprintk\(}) {
-                                       if ($rawlines[$ln - 1] !~ m{\\n"}) {
-                                               $ok = 1;
-                                       }
-                                       last;
-                               }
-                       }
-                       if ($ok == 0) {
-                               WARN("printk() should include KERN_ facility level\n" . $herecurr);
-                       }
-               }
-
-# function brace can't be on same line, except for #defines of do while,
-# or if closed on same line
-               if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
-                   !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
-                       ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
-               }
-
-# open braces for enum, union and struct go on the same line.
-               if ($line =~ /^.\s*{/ &&
-                   $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) {
-                       ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
-               }
-
-# check for spacing round square brackets; allowed:
-#  1. with a type on the left -- int [] a;
-#  2. at the beginning of a line for slice initialisers -- [0...10] = 5,
-#  3. inside a curly brace -- = { [0...10] = 5 }
-               while ($line =~ /(.*?\s)\[/g) {
-                       my ($where, $prefix) = ($-[1], $1);
-                       if ($prefix !~ /$Type\s+$/ &&
-                           ($where != 0 || $prefix !~ /^.\s+$/) &&
-                           $prefix !~ /{\s+$/) {
-                               ERROR("space prohibited before open square bracket '['\n" . $herecurr);
-                       }
-               }
-
-# check for spaces between functions and their parentheses.
-               while ($line =~ /($Ident)\s+\(/g) {
-                       my $name = $1;
-                       my $ctx_before = substr($line, 0, $-[1]);
-                       my $ctx = "$ctx_before$name";
-
-                       # Ignore those directives where spaces _are_ permitted.
-                       if ($name =~ /^(?:
-                               if|for|while|switch|return|case|
-                               volatile|__volatile__|
-                               __attribute__|format|__extension__|
-                               asm|__asm__)$/x)
-                       {
-
-                       # cpp #define statements have non-optional spaces, ie
-                       # if there is a space between the name and the open
-                       # parenthesis it is simply not a parameter group.
-                       } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) {
-
-                       # cpp #elif statement condition may start with a (
-                       } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) {
-
-                       # If this whole things ends with a type its most
-                       # likely a typedef for a function.
-                       } elsif ($ctx =~ /$Type$/) {
-
-                       } else {
-                               WARN("space prohibited between function name and open parenthesis '('\n" . $herecurr);
-                       }
-               }
-# Check operator spacing.
-               if (!($line=~/\#\s*include/)) {
-                       my $ops = qr{
-                               <<=|>>=|<=|>=|==|!=|
-                               \+=|-=|\*=|\/=|%=|\^=|\|=|&=|
-                               =>|->|<<|>>|<|>|=|!|~|
-                               &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%|
-                               \?|:
-                       }x;
-                       my @elements = split(/($ops|;)/, $opline);
-                       my $off = 0;
-
-                       my $blank = copy_spacing($opline);
-
-                       for (my $n = 0; $n < $#elements; $n += 2) {
-                               $off += length($elements[$n]);
-
-                               # Pick up the preceeding and succeeding characters.
-                               my $ca = substr($opline, 0, $off);
-                               my $cc = '';
-                               if (length($opline) >= ($off + length($elements[$n + 1]))) {
-                                       $cc = substr($opline, $off + length($elements[$n + 1]));
-                               }
-                               my $cb = "$ca$;$cc";
-
-                               my $a = '';
-                               $a = 'V' if ($elements[$n] ne '');
-                               $a = 'W' if ($elements[$n] =~ /\s$/);
-                               $a = 'C' if ($elements[$n] =~ /$;$/);
-                               $a = 'B' if ($elements[$n] =~ /(\[|\()$/);
-                               $a = 'O' if ($elements[$n] eq '');
-                               $a = 'E' if ($ca =~ /^\s*$/);
-
-                               my $op = $elements[$n + 1];
-
-                               my $c = '';
-                               if (defined $elements[$n + 2]) {
-                                       $c = 'V' if ($elements[$n + 2] ne '');
-                                       $c = 'W' if ($elements[$n + 2] =~ /^\s/);
-                                       $c = 'C' if ($elements[$n + 2] =~ /^$;/);
-                                       $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/);
-                                       $c = 'O' if ($elements[$n + 2] eq '');
-                                       $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/);
-                               } else {
-                                       $c = 'E';
-                               }
-
-                               my $ctx = "${a}x${c}";
-
-                               my $at = "(ctx:$ctx)";
-
-                               my $ptr = substr($blank, 0, $off) . "^";
-                               my $hereptr = "$hereline$ptr\n";
-
-                               # Pull out the value of this operator.
-                               my $op_type = substr($curr_values, $off + 1, 1);
-
-                               # Get the full operator variant.
-                               my $opv = $op . substr($curr_vars, $off, 1);
-
-                               # Ignore operators passed as parameters.
-                               if ($op_type ne 'V' &&
-                                   $ca =~ /\s$/ && $cc =~ /^\s*,/) {
-
-#                              # Ignore comments
-#                              } elsif ($op =~ /^$;+$/) {
-
-                               # ; should have either the end of line or a space or \ after it
-                               } elsif ($op eq ';') {
-                                       if ($ctx !~ /.x[WEBC]/ &&
-                                           $cc !~ /^\\/ && $cc !~ /^;/) {
-                                               ERROR("space required after that '$op' $at\n" . $hereptr);
-                                       }
-
-                               # // is a comment
-                               } elsif ($op eq '//') {
-
-                               # No spaces for:
-                               #   ->
-                               #   :   when part of a bitfield
-                               } elsif ($op eq '->' || $opv eq ':B') {
-                                       if ($ctx =~ /Wx.|.xW/) {
-                                               ERROR("spaces prohibited around that '$op' $at\n" . $hereptr);
-                                       }
-
-                               # , must have a space on the right.
-                               } elsif ($op eq ',') {
-                                       if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
-                                               ERROR("space required after that '$op' $at\n" . $hereptr);
-                                       }
-
-                               # '*' as part of a type definition -- reported already.
-                               } elsif ($opv eq '*_') {
-                                       #warn "'*' is part of type\n";
-
-                               # unary operators should have a space before and
-                               # none after.  May be left adjacent to another
-                               # unary operator, or a cast
-                               } elsif ($op eq '!' || $op eq '~' ||
-                                        $opv eq '*U' || $opv eq '-U' ||
-                                        $opv eq '&U' || $opv eq '&&U') {
-                                       if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
-                                               ERROR("space required before that '$op' $at\n" . $hereptr);
-                                       }
-                                       if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
-                                               # A unary '*' may be const
-
-                                       } elsif ($ctx =~ /.xW/) {
-                                               ERROR("space prohibited after that '$op' $at\n" . $hereptr);
-                                       }
-
-                               # unary ++ and unary -- are allowed no space on one side.
-                               } elsif ($op eq '++' or $op eq '--') {
-                                       if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) {
-                                               ERROR("space required one side of that '$op' $at\n" . $hereptr);
-                                       }
-                                       if ($ctx =~ /Wx[BE]/ ||
-                                           ($ctx =~ /Wx./ && $cc =~ /^;/)) {
-                                               ERROR("space prohibited before that '$op' $at\n" . $hereptr);
-                                       }
-                                       if ($ctx =~ /ExW/) {
-                                               ERROR("space prohibited after that '$op' $at\n" . $hereptr);
-                                       }
-
-
-                               # << and >> may either have or not have spaces both sides
-                               } elsif ($op eq '<<' or $op eq '>>' or
-                                        $op eq '&' or $op eq '^' or $op eq '|' or
-                                        $op eq '+' or $op eq '-' or
-                                        $op eq '*' or $op eq '/' or
-                                        $op eq '%')
-                               {
-                                       if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
-                                               ERROR("need consistent spacing around '$op' $at\n" .
-                                                       $hereptr);
-                                       }
-
-                               # A colon needs no spaces before when it is
-                               # terminating a case value or a label.
-                               } elsif ($opv eq ':C' || $opv eq ':L') {
-                                       if ($ctx =~ /Wx./) {
-                                               ERROR("space prohibited before that '$op' $at\n" . $hereptr);
-                                       }
-
-                               # All the others need spaces both sides.
-                               } elsif ($ctx !~ /[EWC]x[CWE]/) {
-                                       my $ok = 0;
-
-                                       # Ignore email addresses <foo@bar>
-                                       if (($op eq '<' &&
-                                            $cc =~ /^\S+\@\S+>/) ||
-                                           ($op eq '>' &&
-                                            $ca =~ /<\S+\@\S+$/))
-                                       {
-                                               $ok = 1;
-                                       }
-
-                                       # Ignore ?:
-                                       if (($opv eq ':O' && $ca =~ /\?$/) ||
-                                           ($op eq '?' && $cc =~ /^:/)) {
-                                               $ok = 1;
-                                       }
-
-                                       if ($ok == 0) {
-                                               ERROR("spaces required around that '$op' $at\n" . $hereptr);
-                                       }
-                               }
-                               $off += length($elements[$n + 1]);
-                       }
-               }
-
-# check for multiple assignments
-               if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
-                       CHK("multiple assignments should be avoided\n" . $herecurr);
-               }
-
-## # check for multiple declarations, allowing for a function declaration
-## # continuation.
-##             if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
-##                 $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) {
-##
-##                     # Remove any bracketed sections to ensure we do not
-##                     # falsly report the parameters of functions.
-##                     my $ln = $line;
-##                     while ($ln =~ s/\([^\(\)]*\)//g) {
-##                     }
-##                     if ($ln =~ /,/) {
-##                             WARN("declaring multiple variables together should be avoided\n" . $herecurr);
-##                     }
-##             }
-
-#need space before brace following if, while, etc
-               if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
-                   $line =~ /do{/) {
-                       ERROR("space required before the open brace '{'\n" . $herecurr);
-               }
-
-# closing brace should have a space following it when it has anything
-# on the line
-               if ($line =~ /}(?!(?:,|;|\)))\S/) {
-                       ERROR("space required after that close brace '}'\n" . $herecurr);
-               }
-
-# check spacing on square brackets
-               if ($line =~ /\[\s/ && $line !~ /\[\s*$/) {
-                       ERROR("space prohibited after that open square bracket '['\n" . $herecurr);
-               }
-               if ($line =~ /\s\]/) {
-                       ERROR("space prohibited before that close square bracket ']'\n" . $herecurr);
-               }
-
-# check spacing on parentheses
-               if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ &&
-                   $line !~ /for\s*\(\s+;/) {
-                       ERROR("space prohibited after that open parenthesis '('\n" . $herecurr);
-               }
-               if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
-                   $line !~ /for\s*\(.*;\s+\)/ &&
-                   $line !~ /:\s+\)/) {
-                       ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr);
-               }
-
-#goto labels aren't indented, allow a single space however
-               if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
-                  !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
-                       WARN("labels should not be indented\n" . $herecurr);
-               }
-
-# Return is not a function.
-               if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
-                       my $spacing = $1;
-                       my $value = $2;
-
-                       # Flatten any parentheses
-                       $value =~ s/\)\(/\) \(/g;
-                       while ($value =~ s/\[[^\{\}]*\]/1/ ||
-                              $value !~ /(?:$Ident|-?$Constant)\s*
-                                            $Compare\s*
-                                            (?:$Ident|-?$Constant)/x &&
-                              $value =~ s/\([^\(\)]*\)/1/) {
-                       }
-
-                       if ($value =~ /^(?:$Ident|-?$Constant)$/) {
-                               ERROR("return is not a function, parentheses are not required\n" . $herecurr);
-
-                       } elsif ($spacing !~ /\s+/) {
-                               ERROR("space required before the open parenthesis '('\n" . $herecurr);
-                       }
-               }
-
-# Need a space before open parenthesis after if, while etc
-               if ($line=~/\b(if|while|for|switch)\(/) {
-                       ERROR("space required before the open parenthesis '('\n" . $herecurr);
-               }
-
-# Check for illegal assignment in if conditional -- and check for trailing
-# statements after the conditional.
-               if ($line =~ /do\s*(?!{)/) {
-                       my ($stat_next) = ctx_statement_block($line_nr_next,
-                                               $remain_next, $off_next);
-                       $stat_next =~ s/\n./\n /g;
-                       ##print "stat<$stat> stat_next<$stat_next>\n";
-
-                       if ($stat_next =~ /^\s*while\b/) {
-                               # If the statement carries leading newlines,
-                               # then count those as offsets.
-                               my ($whitespace) =
-                                       ($stat_next =~ /^((?:\s*\n[+-])*\s*)/s);
-                               my $offset =
-                                       statement_rawlines($whitespace) - 1;
-
-                               $suppress_whiletrailers{$line_nr_next +
-                                                               $offset} = 1;
-                       }
-               }
-               if (!defined $suppress_whiletrailers{$linenr} &&
-                   $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {
-                       my ($s, $c) = ($stat, $cond);
-
-                       if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) {
-                               ERROR("do not use assignment in if condition\n" . $herecurr);
-                       }
-
-                       # Find out what is on the end of the line after the
-                       # conditional.
-                       substr($s, 0, length($c), '');
-                       $s =~ s/\n.*//g;
-                       $s =~ s/$;//g;  # Remove any comments
-                       if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ &&
-                           $c !~ /}\s*while\s*/)
-                       {
-                               # Find out how long the conditional actually is.
-                               my @newlines = ($c =~ /\n/gs);
-                               my $cond_lines = 1 + $#newlines;
-                               my $stat_real = '';
-
-                               $stat_real = raw_line($linenr, $cond_lines)
-                                                       . "\n" if ($cond_lines);
-                               if (defined($stat_real) && $cond_lines > 1) {
-                                       $stat_real = "[...]\n$stat_real";
-                               }
-
-                               ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real);
-                       }
-               }
-
-# Check for bitwise tests written as boolean
-               if ($line =~ /
-                       (?:
-                               (?:\[|\(|\&\&|\|\|)
-                               \s*0[xX][0-9]+\s*
-                               (?:\&\&|\|\|)
-                       |
-                               (?:\&\&|\|\|)
-                               \s*0[xX][0-9]+\s*
-                               (?:\&\&|\|\||\)|\])
-                       )/x)
-               {
-                       WARN("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr);
-               }
-
-# if and else should not have general statements after it
-               if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) {
-                       my $s = $1;
-                       $s =~ s/$;//g;  # Remove any comments
-                       if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) {
-                               ERROR("trailing statements should be on next line\n" . $herecurr);
-                       }
-               }
-# if should not continue a brace
-               if ($line =~ /}\s*if\b/) {
-                       ERROR("trailing statements should be on next line\n" .
-                               $herecurr);
-               }
-# case and default should not have general statements after them
-               if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
-                   $line !~ /\G(?:
-                       (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$|
-                       \s*return\s+
-                   )/xg)
-               {
-                       ERROR("trailing statements should be on next line\n" . $herecurr);
-               }
-
-               # Check for }<nl>else {, these must be at the same
-               # indent level to be relevant to each other.
-               if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and
-                                               $previndent == $indent) {
-                       ERROR("else should follow close brace '}'\n" . $hereprev);
-               }
-
-               if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and
-                                               $previndent == $indent) {
-                       my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0);
-
-                       # Find out what is on the end of the line after the
-                       # conditional.
-                       substr($s, 0, length($c), '');
-                       $s =~ s/\n.*//g;
-
-                       if ($s =~ /^\s*;/) {
-                               ERROR("while should follow close brace '}'\n" . $hereprev);
-                       }
-               }
-
-#studly caps, commented out until figure out how to distinguish between use of existing and adding new
-#              if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) {
-#                  print "No studly caps, use _\n";
-#                  print "$herecurr";
-#                  $clean = 0;
-#              }
-
-#no spaces allowed after \ in define
-               if ($line=~/\#\s*define.*\\\s$/) {
-                       WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr);
-               }
-
-#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
-               if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
-                       my $file = "$1.h";
-                       my $checkfile = "include/linux/$file";
-                       if (-f "$root/$checkfile" &&
-                           $realfile ne $checkfile &&
-                           $1 ne 'irq')
-                       {
-                               if ($realfile =~ m{^arch/}) {
-                                       CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
-                               } else {
-                                       WARN("Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
-                               }
-                       }
-               }
-
-# multi-statement macros should be enclosed in a do while loop, grab the
-# first statement and ensure its the whole macro if its not enclosed
-# in a known good container
-               if ($realfile !~ m@/vmlinux.lds.h$@ &&
-                   $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
-                       my $ln = $linenr;
-                       my $cnt = $realcnt;
-                       my ($off, $dstat, $dcond, $rest);
-                       my $ctx = '';
-
-                       my $args = defined($1);
-
-                       # Find the end of the macro and limit our statement
-                       # search to that.
-                       while ($cnt > 0 && defined $lines[$ln - 1] &&
-                               $lines[$ln - 1] =~ /^(?:-|..*\\$)/)
-                       {
-                               $ctx .= $rawlines[$ln - 1] . "\n";
-                               $cnt-- if ($lines[$ln - 1] !~ /^-/);
-                               $ln++;
-                       }
-                       $ctx .= $rawlines[$ln - 1];
-
-                       ($dstat, $dcond, $ln, $cnt, $off) =
-                               ctx_statement_block($linenr, $ln - $linenr + 1, 0);
-                       #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n";
-                       #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n";
-
-                       # Extract the remainder of the define (if any) and
-                       # rip off surrounding spaces, and trailing \'s.
-                       $rest = '';
-                       while ($off != 0 || ($cnt > 0 && $rest =~ /\\\s*$/)) {
-                               #print "ADDING cnt<$cnt> $off <" . substr($lines[$ln - 1], $off) . "> rest<$rest>\n";
-                               if ($off != 0 || $lines[$ln - 1] !~ /^-/) {
-                                       $rest .= substr($lines[$ln - 1], $off) . "\n";
-                                       $cnt--;
-                               }
-                               $ln++;
-                               $off = 0;
-                       }
-                       $rest =~ s/\\\n.//g;
-                       $rest =~ s/^\s*//s;
-                       $rest =~ s/\s*$//s;
-
-                       # Clean up the original statement.
-                       if ($args) {
-                               substr($dstat, 0, length($dcond), '');
-                       } else {
-                               $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//;
-                       }
-                       $dstat =~ s/$;//g;
-                       $dstat =~ s/\\\n.//g;
-                       $dstat =~ s/^\s*//s;
-                       $dstat =~ s/\s*$//s;
-
-                       # Flatten any parentheses and braces
-                       while ($dstat =~ s/\([^\(\)]*\)/1/ ||
-                              $dstat =~ s/\{[^\{\}]*\}/1/ ||
-                              $dstat =~ s/\[[^\{\}]*\]/1/)
-                       {
-                       }
-
-                       my $exceptions = qr{
-                               $Declare|
-                               module_param_named|
-                               MODULE_PARAM_DESC|
-                               DECLARE_PER_CPU|
-                               DEFINE_PER_CPU|
-                               __typeof__\(|
-                               union|
-                               struct|
-                               \.$Ident\s*=\s*|
-                               ^\"|\"$
-                       }x;
-                       #print "REST<$rest> dstat<$dstat>\n";
-                       if ($rest ne '') {
-                               if ($rest !~ /while\s*\(/ &&
-                                   $dstat !~ /$exceptions/)
-                               {
-                                       ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n");
-                               }
-
-                       } elsif ($ctx !~ /;/) {
-                               if ($dstat ne '' &&
-                                   $dstat !~ /^(?:$Ident|-?$Constant)$/ &&
-                                   $dstat !~ /$exceptions/ &&
-                                   $dstat !~ /^\.$Ident\s*=/ &&
-                                   $dstat =~ /$Operators/)
-                               {
-                                       ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n");
-                               }
-                       }
-               }
-
-# make sure symbols are always wrapped with VMLINUX_SYMBOL() ...
-# all assignments may have only one of the following with an assignment:
-#      .
-#      ALIGN(...)
-#      VMLINUX_SYMBOL(...)
-               if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) {
-                       WARN("vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr);
-               }
-
-# check for redundant bracing round if etc
-               if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) {
-                       my ($level, $endln, @chunks) =
-                               ctx_statement_full($linenr, $realcnt, 1);
-                       #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n";
-                       #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n";
-                       if ($#chunks > 0 && $level == 0) {
-                               my $allowed = 0;
-                               my $seen = 0;
-                               my $herectx = $here . "\n";
-                               my $ln = $linenr - 1;
-                               for my $chunk (@chunks) {
-                                       my ($cond, $block) = @{$chunk};
-
-                                       # If the condition carries leading newlines, then count those as offsets.
-                                       my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s);
-                                       my $offset = statement_rawlines($whitespace) - 1;
-
-                                       #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n";
-
-                                       # We have looked at and allowed this specific line.
-                                       $suppress_ifbraces{$ln + $offset} = 1;
-
-                                       $herectx .= "$rawlines[$ln + $offset]\n[...]\n";
-                                       $ln += statement_rawlines($block) - 1;
-
-                                       substr($block, 0, length($cond), '');
-
-                                       $seen++ if ($block =~ /^\s*{/);
-
-                                       #print "cond<$cond> block<$block> allowed<$allowed>\n";
-                                       if (statement_lines($cond) > 1) {
-                                               #print "APW: ALLOWED: cond<$cond>\n";
-                                               $allowed = 1;
-                                       }
-                                       if ($block =~/\b(?:if|for|while)\b/) {
-                                               #print "APW: ALLOWED: block<$block>\n";
-                                               $allowed = 1;
-                                       }
-                                       if (statement_block_size($block) > 1) {
-                                               #print "APW: ALLOWED: lines block<$block>\n";
-                                               $allowed = 1;
-                                       }
-                               }
-                               if ($seen && !$allowed) {
-                                       WARN("braces {} are not necessary for any arm of this statement\n" . $herectx);
-                               }
-                       }
-               }
-               if (!defined $suppress_ifbraces{$linenr - 1} &&
-                                       $line =~ /\b(if|while|for|else)\b/) {
-                       my $allowed = 0;
-
-                       # Check the pre-context.
-                       if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
-                               #print "APW: ALLOWED: pre<$1>\n";
-                               $allowed = 1;
-                       }
-
-                       my ($level, $endln, @chunks) =
-                               ctx_statement_full($linenr, $realcnt, $-[0]);
-
-                       # Check the condition.
-                       my ($cond, $block) = @{$chunks[0]};
-                       #print "CHECKING<$linenr> cond<$cond> block<$block>\n";
-                       if (defined $cond) {
-                               substr($block, 0, length($cond), '');
-                       }
-                       if (statement_lines($cond) > 1) {
-                               #print "APW: ALLOWED: cond<$cond>\n";
-                               $allowed = 1;
-                       }
-                       if ($block =~/\b(?:if|for|while)\b/) {
-                               #print "APW: ALLOWED: block<$block>\n";
-                               $allowed = 1;
-                       }
-                       if (statement_block_size($block) > 1) {
-                               #print "APW: ALLOWED: lines block<$block>\n";
-                               $allowed = 1;
-                       }
-                       # Check the post-context.
-                       if (defined $chunks[1]) {
-                               my ($cond, $block) = @{$chunks[1]};
-                               if (defined $cond) {
-                                       substr($block, 0, length($cond), '');
-                               }
-                               if ($block =~ /^\s*\{/) {
-                                       #print "APW: ALLOWED: chunk-1 block<$block>\n";
-                                       $allowed = 1;
-                               }
-                       }
-                       if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) {
-                               my $herectx = $here . "\n";;
-                               my $cnt = statement_rawlines($block);
-
-                               for (my $n = 0; $n < $cnt; $n++) {
-                                       $herectx .= raw_line($linenr, $n) . "\n";;
-                               }
-
-                               WARN("braces {} are not necessary for single statement blocks\n" . $herectx);
-                       }
-               }
-
-# don't include deprecated include files (uses RAW line)
-               for my $inc (@dep_includes) {
-                       if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) {
-                               ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr);
-                       }
-               }
-
-# don't use deprecated functions
-               for my $func (@dep_functions) {
-                       if ($line =~ /\b$func\b/) {
-                               ERROR("Don't use $func(): see Documentation/feature-removal-schedule.txt\n" . $herecurr);
-                       }
-               }
-
-# no volatiles please
-               my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
-               if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
-                       WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
-               }
-
-# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated
-               if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) {
-                       ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr);
-               }
-
-# warn about #if 0
-               if ($line =~ /^.\s*\#\s*if\s+0\b/) {
-                       CHK("if this code is redundant consider removing it\n" .
-                               $herecurr);
-               }
-
-# check for needless kfree() checks
-               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
-                       my $expr = $1;
-                       if ($line =~ /\bkfree\(\Q$expr\E\);/) {
-                               WARN("kfree(NULL) is safe this check is probably not required\n" . $hereprev);
-                       }
-               }
-# check for needless usb_free_urb() checks
-               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
-                       my $expr = $1;
-                       if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
-                               WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev);
-                       }
-               }
-
-# warn about #ifdefs in C files
-#              if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
-#                      print "#ifdef in C files should be avoided\n";
-#                      print "$herecurr";
-#                      $clean = 0;
-#              }
-
-# warn about spacing in #ifdefs
-               if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
-                       ERROR("exactly one space required after that #$1\n" . $herecurr);
-               }
-
-# check for spinlock_t definitions without a comment.
-               if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ ||
-                   $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) {
-                       my $which = $1;
-                       if (!ctx_has_comment($first_line, $linenr)) {
-                               CHK("$1 definition without comment\n" . $herecurr);
-                       }
-               }
-# check for memory barriers without a comment.
-               if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) {
-                       if (!ctx_has_comment($first_line, $linenr)) {
-                               CHK("memory barrier without comment\n" . $herecurr);
-                       }
-               }
-# check of hardware specific defines
-               if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
-                       CHK("architecture specific defines should be avoided\n" .  $herecurr);
-               }
-
-# Check that the storage class is at the beginning of a declaration
-               if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
-                       WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
-               }
-
-# check the location of the inline attribute, that it is between
-# storage class and type.
-               if ($line =~ /\b$Type\s+$Inline\b/ ||
-                   $line =~ /\b$Inline\s+$Storage\b/) {
-                       ERROR("inline keyword should sit between storage class and type\n" . $herecurr);
-               }
-
-# Check for __inline__ and __inline, prefer inline
-               if ($line =~ /\b(__inline__|__inline)\b/) {
-                       WARN("plain inline is preferred over $1\n" . $herecurr);
-               }
-
-# check for sizeof(&)
-               if ($line =~ /\bsizeof\s*\(\s*\&/) {
-                       WARN("sizeof(& should be avoided\n" . $herecurr);
-               }
-
-# check for new externs in .c files.
-               if ($realfile =~ /\.c$/ && defined $stat &&
-                   $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
-               {
-                       my $function_name = $1;
-                       my $paren_space = $2;
-
-                       my $s = $stat;
-                       if (defined $cond) {
-                               substr($s, 0, length($cond), '');
-                       }
-                       if ($s =~ /^\s*;/ &&
-                           $function_name ne 'uninitialized_var')
-                       {
-                               WARN("externs should be avoided in .c files\n" .  $herecurr);
-                       }
-
-                       if ($paren_space =~ /\n/) {
-                               WARN("arguments for function declarations should follow identifier\n" . $herecurr);
-                       }
-
-               } elsif ($realfile =~ /\.c$/ && defined $stat &&
-                   $stat =~ /^.\s*extern\s+/)
-               {
-                       WARN("externs should be avoided in .c files\n" .  $herecurr);
-               }
-
-# checks for new __setup's
-               if ($rawline =~ /\b__setup\("([^"]*)"/) {
-                       my $name = $1;
-
-                       if (!grep(/$name/, @setup_docs)) {
-                               CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr);
-                       }
-               }
-
-# check for pointless casting of kmalloc return
-               if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) {
-                       WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
-               }
-
-# check for gcc specific __FUNCTION__
-               if ($line =~ /__FUNCTION__/) {
-                       WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
-               }
-
-# check for semaphores used as mutexes
-               if ($line =~ /^.\s*(DECLARE_MUTEX|init_MUTEX)\s*\(/) {
-                       WARN("mutexes are preferred for single holder semaphores\n" . $herecurr);
-               }
-# check for semaphores used as mutexes
-               if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) {
-                       WARN("consider using a completion\n" . $herecurr);
-
-               }
-# recommend strict_strto* over simple_strto*
-               if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
-                       WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr);
-               }
-# check for __initcall(), use device_initcall() explicitly please
-               if ($line =~ /^.\s*__initcall\s*\(/) {
-                       WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
-               }
-# check for various ops structs, ensure they are const.
-               my $struct_ops = qr{acpi_dock_ops|
-                               address_space_operations|
-                               backlight_ops|
-                               block_device_operations|
-                               dentry_operations|
-                               dev_pm_ops|
-                               dma_map_ops|
-                               extent_io_ops|
-                               file_lock_operations|
-                               file_operations|
-                               hv_ops|
-                               ide_dma_ops|
-                               intel_dvo_dev_ops|
-                               item_operations|
-                               iwl_ops|
-                               kgdb_arch|
-                               kgdb_io|
-                               kset_uevent_ops|
-                               lock_manager_operations|
-                               microcode_ops|
-                               mtrr_ops|
-                               neigh_ops|
-                               nlmsvc_binding|
-                               pci_raw_ops|
-                               pipe_buf_operations|
-                               platform_hibernation_ops|
-                               platform_suspend_ops|
-                               proto_ops|
-                               rpc_pipe_ops|
-                               seq_operations|
-                               snd_ac97_build_ops|
-                               soc_pcmcia_socket_ops|
-                               stacktrace_ops|
-                               sysfs_ops|
-                               tty_operations|
-                               usb_mon_operations|
-                               wd_ops}x;
-               if ($line !~ /\bconst\b/ &&
-                   $line =~ /\bstruct\s+($struct_ops)\b/) {
-                       WARN("struct $1 should normally be const\n" .
-                               $herecurr);
-               }
-
-# use of NR_CPUS is usually wrong
-# ignore definitions of NR_CPUS and usage to define arrays as likely right
-               if ($line =~ /\bNR_CPUS\b/ &&
-                   $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ &&
-                   $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ &&
-                   $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ &&
-                   $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ &&
-                   $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/)
-               {
-                       WARN("usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr);
-               }
-
-# check for %L{u,d,i} in strings
-               my $string;
-               while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
-                       $string = substr($rawline, $-[1], $+[1] - $-[1]);
-                       $string =~ s/%%/__/g;
-                       if ($string =~ /(?<!%)%L[udi]/) {
-                               WARN("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
-                               last;
-                       }
-               }
-
-# whine mightly about in_atomic
-               if ($line =~ /\bin_atomic\s*\(/) {
-                       if ($realfile =~ m@^drivers/@) {
-                               ERROR("do not use in_atomic in drivers\n" . $herecurr);
-                       } elsif ($realfile !~ m@^kernel/@) {
-                               WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
-                       }
-               }
-
-# check for lockdep_set_novalidate_class
-               if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
-                   $line =~ /__lockdep_no_validate__\s*\)/ ) {
-                       if ($realfile !~ m@^kernel/lockdep@ &&
-                           $realfile !~ m@^include/linux/lockdep@ &&
-                           $realfile !~ m@^drivers/base/core@) {
-                               ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
-                       }
-               }
-       }
-
-       # If we have no input at all, then there is nothing to report on
-       # so just keep quiet.
-       if ($#rawlines == -1) {
-               exit(0);
-       }
-
-       # In mailback mode only produce a report in the negative, for
-       # things that appear to be patches.
-       if ($mailback && ($clean == 1 || !$is_patch)) {
-               exit(0);
-       }
-
-       # This is not a patch, and we are are in 'no-patch' mode so
-       # just keep quiet.
-       if (!$chk_patch && !$is_patch) {
-               exit(0);
-       }
-
-       if (!$is_patch) {
-               ERROR("Does not appear to be a unified-diff format patch\n");
-       }
-       if ($is_patch && $chk_signoff && $signoff == 0) {
-               ERROR("Missing Signed-off-by: line(s)\n");
-       }
-
-       print report_dump();
-       if ($summary && !($clean == 1 && $quiet == 1)) {
-               print "$filename " if ($summary_file);
-               print "total: $cnt_error errors, $cnt_warn warnings, " .
-                       (($check)? "$cnt_chk checks, " : "") .
-                       "$cnt_lines lines checked\n";
-               print "\n" if ($quiet == 0);
-       }
-
-       if ($clean == 1 && $quiet == 0) {
-               print "$vname has no obvious style problems and is ready for submission.\n"
-       }
-       if ($clean == 0 && $quiet == 0) {
-               print "$vname has style problems, please review.  If any of these errors\n";
-               print "are false positives report them to the maintainer, see\n";
-               print "CHECKPATCH in MAINTAINERS.\n";
-       }
-
-       return $clean;
-}
index 9fc8b01..4b42165 100644 (file)
@@ -1,5 +1,6 @@
 
-AM_CPPFLAGS = -Wall -std=gnu99 -Werror \
+AM_CPPFLAGS = -Wall -std=gnu99 -Werror\
+        -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
        $(CURL_CFLAGS) $(JSON_CFLAGS)
 
 LIBS += $(CURL_LIBS) $(JSON_LIBS)
@@ -7,7 +8,6 @@ LIBS += $(CURL_LIBS) $(JSON_LIBS)
 bin_PROGRAMS = ppastats
 ppastats_SOURCES = \
        cache.h cache.c\
-       chart.h chart.c\
        html.h html.c\
        list.h list.c\
        lp.h lp.c\
index d63cb70..bcbf144 100644 (file)
@@ -46,9 +46,9 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_ppastats_OBJECTS = cache.$(OBJEXT) chart.$(OBJEXT) html.$(OBJEXT) \
-       list.$(OBJEXT) lp.$(OBJEXT) lp_json.$(OBJEXT) lp_ws.$(OBJEXT) \
-       main.$(OBJEXT) ppastats.$(OBJEXT)
+am_ppastats_OBJECTS = cache.$(OBJEXT) html.$(OBJEXT) list.$(OBJEXT) \
+       lp.$(OBJEXT) lp_json.$(OBJEXT) lp_ws.$(OBJEXT) main.$(OBJEXT) \
+       ppastats.$(OBJEXT)
 ppastats_OBJECTS = $(am_ppastats_OBJECTS)
 ppastats_LDADD = $(LDADD)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@@ -184,12 +184,12 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -Wall -std=gnu99 -Werror \
+AM_CPPFLAGS = -Wall -std=gnu99 -Werror\
+        -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\"\
        $(CURL_CFLAGS) $(JSON_CFLAGS)
 
 ppastats_SOURCES = \
        cache.h cache.c\
-       chart.h chart.c\
        html.h html.c\
        list.h list.c\
        lp.h lp.c\
@@ -281,7 +281,6 @@ distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chart.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/html.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lp.Po@am__quote@
diff --git a/src/chart.c b/src/chart.c
deleted file mode 100644 (file)
index 132bd35..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-    Copyright (C) 2011 jeanfi@gmail.com
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-    02110-1301 USA
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <json/json.h>
-
-#include "chart.h"
-#include "ppastats.h"
-
-#define HTML_TEMPLATE \
-"<html>\n\
-  <head>\n\
-    <script type='text/javascript'\
-           src='https://www.google.com/jsapi'></script>\n\
-    <script type='text/javascript'>\n\
-      google.load('visualization', '1', {packages:['corechart']});\
-      google.setOnLoadCallback(drawChart);\n\
-      function drawChart() {\n\
-       var data = new google.visualization.DataTable();\n\
-       data.addColumn('string', 'Date');\n\
-       data.addColumn('number', 'Daily Download');\n\
-       data.addRows(%s);\n\
-       data.sort(0);\n\
-       var chart = new google.visualization.LineChart\
-               (document.getElementById('chart_div'));\n\
-       chart.draw(data, {width: 1024, height: 768,\
-                         title: 'PPA Statistics'});\n\
-      }\n\
-    </script>\n\
-  </head>\n\
-\n\
-  <body>\n\
-    <div id='chart_div'></div>\n\
-  </body>\n\
-</html>\n"
-
-char *tm_to_str(struct tm *date)
-{
-       char *str = malloc(10+1);
-
-       sprintf(str, "%d-%02d-%02d",
-               date->tm_year+1900,
-               date->tm_mon+1,
-               date->tm_mday);
-
-       return str;
-}
-
-void
-generate_chart(const char *path,
-              const char *title,
-              const char *name,
-              struct daily_download_total **totals)
-{
-       FILE *f;
-       struct daily_download_total **cur;
-       struct daily_download_total *total;
-       char *str_date;
-       json_object *arr, *item;
-
-       if (debug)
-               fprintf(stderr, "Generates %s\n", path);
-
-       if (!totals) {
-               fprintf(stderr, "ERROR: no totals\n");
-               return ;
-       }
-
-       f = fopen(path, "w");
-
-       if (!f) {
-               fprintf(stderr, "ERROR: failed to open: %s\n", path);
-               return ;
-       }
-
-       arr = json_object_new_array();
-       cur = totals;
-       while (*cur) {
-               total = *cur;
-
-               str_date = tm_to_str(&(total->date));
-
-               item = json_object_new_array();
-
-               json_object_array_add(item, json_object_new_string(str_date));
-               json_object_array_add(item,
-                                     json_object_new_int(total->count));
-
-               json_object_array_add(arr, item);
-
-               free(str_date);
-
-               cur++;
-       }
-
-       fprintf(f,
-               HTML_TEMPLATE,
-               json_object_to_json_string(arr));
-
-       json_object_put(arr);
-
-       fclose(f);
-}
diff --git a/src/chart.h b/src/chart.h
deleted file mode 100644 (file)
index 0791a91..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-    Copyright (C) 2011 jeanfi@gmail.com
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-    02110-1301 USA
-*/
-
-#ifndef _PPASTATS_CHART_H_
-#define _PPASTATS_CHART_H_
-
-#include "lp.h"
-
-void
-generate_chart(const char *path,
-              const char *title,
-              const char *name,
-              struct daily_download_total **totals);
-
-#endif
index 314b9a0..9a35c14 100644 (file)
     02110-1301 USA
 */
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <json/json.h>
 
-#include "chart.h"
 #include "html.h"
+#include "lp.h"
 #include "lp_ws.h"
 #include "ppastats.h"
 
-#include <stdio.h>
-#include <stdlib.h>
+enum file_copy_error {
+       FILE_COPY_ERROR_OPEN_SRC = 1,
+       FILE_COPY_ERROR_OPEN_DST,
+       FILE_COPY_ERROR_READ,
+       FILE_COPY_ERROR_WRITE,
+       FILE_COPY_ERROR_ALLOC_BUFFER
+};
+
+#define HTML_PKG_TEMPLATE \
+"<html>\n\
+  <head>\n\
+    <link type=\"text/css\"\n\
+         rel=\"stylesheet\"\n\
+         href=\n\
+\"http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=Latin\">\n\
+    <link type=\"text/css\" href=\"css/ppastats.css\" rel=\"stylesheet\" />\n\
+    <link type=\"text/css\" href=\"css/jquery.jqplot.min.css\"\n\
+         rel=\"stylesheet\" />\n\
+    <script type=\"text/javascript\" src=\"js/jquery.min.js\"></script>\n\
+    <script type=\"text/javascript\"\n\
+           src=\"js/jquery.jqplot.min.js\"></script>\n\
+    <script type=\"text/javascript\"\n\
+           src=\"js/jqplot.dateAxisRenderer.min.js\"></script>\n\
+    <script type=\"text/javascript\" src=\"js/ppastats.js\"></script>\n\
+    <script>var data = %s;\n\
+           ppastats_pkg();\n\
+    </script>\n\
+  </head>\n\
+  <body>\n\
+    <h1><span id=\"pkg_name\">N/A</span></h1>\n\
+    <p><em>PPA</em>: \n\
+       <a href=\".\">\n\
+          <span id=\"ppa_owner\">N/A</span>/<span id=\"ppa_name\">N/A</span>\n\
+       </a></p>\n\
+    <div id=\"chart\"></div>\n\
+    <div id=\"versions\"><em>Versions:</em></div>\n\
+  </body>\n\
+</html>"
+
+#define HTML_VERSION_TEMPLATE \
+"<html>\n\
+  <head>\n\
+    <link type=\"text/css\"\n\
+         rel=\"stylesheet\"\n\
+         href=\n\
+\"http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=Latin\">\n\
+    <link type=\"text/css\" href=\"css/ppastats.css\" rel=\"stylesheet\" />\n\
+    <link type=\"text/css\" href=\"css/jquery.jqplot.min.css\"\n\
+         rel=\"stylesheet\" />\n\
+    <script type=\"text/javascript\" src=\"js/jquery.min.js\"></script>\n\
+    <script type=\"text/javascript\"\n\
+           src=\"js/jquery.jqplot.min.js\"></script>\n\
+    <script type=\"text/javascript\"\n\
+           src=\"js/jqplot.dateAxisRenderer.min.js\"></script>\n\
+    <script type=\"text/javascript\" src=\"js/ppastats.js\"></script>\n\
+    <script>var data = %s;\n\
+           ppastats_ver();\n\
+    </script>\n\
+  </head>\n\
+  <body>\n\
+    <h1><span id=\"pkg_name\">N/A</span></h1>\n\
+    <div id=\"version\"><em>Version:</em></div>\n\
+    <p><em>PPA</em>: \n\
+       <a href=\".\">\n\
+          <span id=\"ppa_owner\">N/A</span>/<span id=\"ppa_name\">N/A</span>\n\
+       </a></p>\n\
+    <div id=\"chart\"></div>\n\
+  </body>\n\
+</html>"
+
+#define FCOPY_BUF_SZ 4096
+static int file_copy(FILE * src, FILE * dst)
+{
+       int ret = 0;
+       char *buf = malloc(FCOPY_BUF_SZ);
+       int n;
+
+       if (!buf)
+               return FILE_COPY_ERROR_ALLOC_BUFFER;
+
+       while (!ret) {
+               n = fread(buf, 1, FCOPY_BUF_SZ, src);
+               if (n) {
+                       if (fwrite(buf, 1, n, dst) != n)
+                               ret = FILE_COPY_ERROR_WRITE;
+               } else {
+                       if (!feof(src))
+                               ret = FILE_COPY_ERROR_READ;
+                       else
+                               break;
+               }
+       }
+
+       free(buf);
+
+       return ret;
+}
+
+int
+fcopy(const char *src, const char *dst)
+{
+       FILE *fsrc, *fdst;
+       int ret = 0;
+
+       if (debug)
+               printf("DEBUG: copy: %s to %s\n", src, dst);
+
+       fsrc = fopen(src, "r");
+
+       if (fsrc) {
+               fdst = fopen(dst, "w+");
+
+               if (fdst) {
+                       ret = file_copy(fsrc, fdst);
+                       fclose(fdst);
+               } else {
+                       ret = FILE_COPY_ERROR_OPEN_DST;
+               }
+
+               fclose(fsrc);
+       } else {
+               ret = FILE_COPY_ERROR_OPEN_SRC;
+       }
+
+       return ret;
+}
 
 static char *get_path(const char *dir, const char *file)
 {
@@ -42,45 +173,246 @@ static char *get_path(const char *dir, const char *file)
        return path;
 }
 
+static struct json_object *date_to_json(struct tm *tm)
+{
+       json_object *json;
+
+       json = json_object_new_array();
+       json_object_array_add(json, json_object_new_int(tm->tm_year+1900));
+       json_object_array_add(json, json_object_new_int(tm->tm_mon+1));
+       json_object_array_add(json, json_object_new_int(tm->tm_mday));
+
+       return json;
+}
+
+static void json_add_ddts(json_object *json,
+                         struct daily_download_total **ddts)
+{
+       json_object *json_ddt, *json_ddts;
+       struct daily_download_total *ddt;
+
+       json_ddts = json_object_new_array();
+       json_object_object_add(json, "ddts", json_ddts);
+
+       if (!ddts)
+               return ;
+
+       while (*ddts) {
+               ddt = *ddts;
+
+               json_ddt = json_object_new_object();
+               json_object_object_add(json_ddt,
+                                      "value",
+                                      json_object_new_int(ddt->count));
+               json_object_object_add(json_ddt,
+                                      "time",
+                                      date_to_json(&ddt->date));
+
+               json_object_array_add(json_ddts, json_ddt);
+
+               ddts++;
+       }
+}
+
+static char *pkg_to_json(struct ppa_stats *ppa, struct package_stats *pkg)
+{
+       json_object *json, *json_versions;
+       char *ret;
+       struct version_stats **versions;
+
+       json = json_object_new_object();
+
+       json_object_object_add(json,
+                              "ppa_name", json_object_new_string(ppa->name));
+       json_object_object_add(json,
+                              "ppa_owner",
+                              json_object_new_string(ppa->owner));
+
+       json_object_object_add(json,
+                              "name", json_object_new_string(pkg->name));
+
+       json_versions = json_object_new_array();
+       json_object_object_add(json, "versions", json_versions);
+       versions = pkg->versions;
+       while (*versions) {
+               json_object_array_add
+                       (json_versions,
+                        json_object_new_string((*versions)->version));
+
+               versions++;
+       }
+
+       json_add_ddts(json, pkg->daily_download_totals);
+
+       ret = strdup(json_object_to_json_string(json));
+
+       json_object_put(json);
+
+       return ret;
+}
+
+static char *version_to_json(struct ppa_stats *ppa,
+                            struct package_stats *pkg,
+                            struct version_stats *ver)
+{
+       json_object *json;
+       char *ret;
+
+       json = json_object_new_object();
+
+       json_object_object_add(json,
+                              "ppa_name", json_object_new_string(ppa->name));
+       json_object_object_add(json,
+                              "ppa_owner",
+                              json_object_new_string(ppa->owner));
+
+       json_object_object_add(json,
+                              "pkg_name", json_object_new_string(pkg->name));
+
+       json_object_object_add(json,
+                              "name", json_object_new_string(ver->version));
+
+       json_add_ddts(json, ver->daily_download_totals);
+
+       ret = strdup(json_object_to_json_string(json));
+
+       json_object_put(json);
+
+       return ret;
+}
+
 static void
-packages_to_html(struct package_stats **packages,
+pkg_to_html(struct ppa_stats *ppa, struct package_stats *pkg, const char *dir)
+{
+       char *path;
+       FILE *f;
+       char *json;
+
+       path = get_path(dir, pkg->name);
+       f = fopen(path, "w");
+
+       if (!f) {
+               fprintf(stderr, "ERROR: failed to open: %s\n", path);
+               return ;
+       }
+
+       json = pkg_to_json(ppa, pkg);
+
+       fprintf(f, HTML_PKG_TEMPLATE, json);
+
+       fclose(f);
+
+       free(path);
+       free(json);
+}
+
+static void
+version_to_html(struct ppa_stats *ppa,
+               struct package_stats *pkg,
+               struct version_stats *version,
+               const char *dir)
+{
+       char *f_name, *path;
+       FILE *f;
+
+       f_name = malloc(strlen(pkg->name)+1+strlen(version->version)+1);
+       sprintf(f_name, "%s_%s", pkg->name, version->version);
+
+       path = get_path(dir, f_name);
+       f = fopen(path, "w");
+
+       if (!f) {
+               fprintf(stderr, "ERROR: failed to open: %s\n", path);
+               return ;
+       }
+
+       fprintf(f, HTML_VERSION_TEMPLATE, version_to_json(ppa, pkg, version));
+
+       fclose(f);
+
+       free(path);
+       free(f_name);
+}
+
+static void
+packages_to_html(struct ppa_stats *ppa,
+                struct package_stats **packages,
                 const char *dir)
 {
        struct package_stats **cur;
-       struct package_stats *p;
-       char *path;
+       struct version_stats **versions;
 
        cur = packages;
        while (*cur) {
-               p = *cur;
+               pkg_to_html(ppa, *cur, dir);
 
-               path = get_path(dir, p->name);
-               generate_chart(path, p->name, p->name,
-                              p->daily_download_totals);
-               free(path);
+               versions = (*cur)->versions;
+               while (*versions) {
+                       version_to_html(ppa, *cur, *versions, dir);
+
+                       versions++;
+               }
 
                cur++;
        }
 }
 
+static char *append_path(const char *odir, const char *name)
+{
+       char *dir;
+
+       dir = malloc(strlen(odir)+1+strlen(name)+1);
+
+       sprintf(dir, "%s/%s", odir, name);
+
+       return dir;
+}
+
 void
 ppa_to_html(const char *owner,
            const char *ppa,
            const char *package_status,
            const char *output_dir)
 {
-       char *path;
        struct ppa_stats *ppastats;
        struct daily_download_total **totals;
+       char *path, *f_dst;
+       char *css_dir, *js_dir;
+       int i;
+       static char *www_files[]
+               = { DEFAULT_WWW_DIR"/jquery.min.js", "js/jquery.min.js",
+                   DEFAULT_WWW_DIR"/ppastats.js", "js/ppastats.js",
+                   DEFAULT_WWW_DIR"/jqplot.dateAxisRenderer.min.js",
+                   "js/jqplot.dateAxisRenderer.min.js",
+                   DEFAULT_WWW_DIR"/jquery.jqplot.min.js",
+                   "js/jquery.jqplot.min.js",
+                   DEFAULT_WWW_DIR"/ppastats.css", "css/ppastats.css",
+                   DEFAULT_WWW_DIR"/jquery.jqplot.min.css",
+                   "css/jquery.jqplot.min.css" };
+
+       css_dir = append_path(output_dir, "css");
+       js_dir = append_path(output_dir, "js");
+
+       mkdir(css_dir, 0777);
+       mkdir(js_dir, 0777);
+
+       for (i = 0; i < 6; i++) {
+               f_dst = append_path(output_dir, www_files[2*i+1]);
+               fcopy(www_files[2*i], f_dst);
+
+               free(f_dst);
+       }
 
        ppastats = create_ppa_stats(owner, ppa, package_status);
        totals = ppastats->daily_download_totals;
 
        path = get_path(output_dir, "ppa");
-       generate_chart(path, "PPA Statistics", ppa, totals);
-       free(path);
 
-       packages_to_html(ppastats->packages, output_dir);
+       packages_to_html(ppastats, ppastats->packages, output_dir);
 
        ppa_stats_free(ppastats);
+
+       free(path);
+       free(css_dir);
+       free(js_dir);
 }
index 2279220..7cd0a86 100644 (file)
@@ -91,6 +91,7 @@ struct distro_arch_series *json_object_to_distro_arch_series(json_object *o)
                                      is_nominated_arch_indep,
                                      distroseries_link);
 }
+
 struct distro_series *json_object_to_distro_series(json_object *o)
 {
        const char *displayname;
@@ -116,8 +117,6 @@ struct distro_series *json_object_to_distro_series(json_object *o)
                                 displayname);
 }
 
-
-
 struct binary_package_publishing_history * *
 json_object_to_binary_package_publishing_history_list(json_object *o)
 {
index 3a4b0ef..032a537 100644 (file)
@@ -255,6 +255,10 @@ create_ppa_stats(const char *owner,
                        = add_totals(package->daily_download_totals,
                                     totals);
 
+               version->daily_download_totals
+                       = add_totals(version->daily_download_totals,
+                                    totals);
+
                daily_download_total_list_free(totals);
 
                h_cur++;
index be2f971..615e2c2 100644 (file)
@@ -44,7 +44,7 @@ struct version_stats {
 
        struct distro_stats **distros;
        int download_count;
-       struct daily_download_total *daily_download_totals;
+       struct daily_download_total **daily_download_totals;
 };
 
 struct package_stats {
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..c305cb9
--- /dev/null
@@ -0,0 +1,5 @@
+check-local: checkpatch.pl
+       find $(top_srcdir)/src -name \*.c -exec $(srcdir)/checkpatch.pl -q --no-tree  -emacs -f {} \;
+       find $(top_srcdir)/src -name \*.h -exec $(srcdir)/checkpatch.pl -q --no-tree  -emacs -f {} \;
+
+EXTRA_DIST = checkpatch.pl 
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644 (file)
index 0000000..da1c123
--- /dev/null
@@ -0,0 +1,329 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+HELP2MAN = @HELP2MAN@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CFLAGS = @JSON_CFLAGS@
+JSON_LIBS = @JSON_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = checkpatch.pl 
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-am check-local clean clean-generic \
+       distclean distclean-generic distdir dvi dvi-am html html-am \
+       info info-am install install-am install-data install-data-am \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+       uninstall-am
+
+check-local: checkpatch.pl
+       find $(top_srcdir)/src -name \*.c -exec $(srcdir)/checkpatch.pl -q --no-tree  -emacs -f {} \;
+       find $(top_srcdir)/src -name \*.h -exec $(srcdir)/checkpatch.pl -q --no-tree  -emacs -f {} \;
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/checkpatch.pl b/tests/checkpatch.pl
new file mode 100755 (executable)
index 0000000..0b0defa
--- /dev/null
@@ -0,0 +1,2823 @@
+#!/usr/bin/perl -w
+
+# This script has been copied from Linux Kernel sources.
+#
+# (c) 2001, Dave Jones. (the file handling bit)
+# (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit)
+# (c) 2007,2008, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite)
+# (c) 2008,2009, Andy Whitcroft <apw@canonical.com>
+# Licensed under the terms of the GNU GPL License version 2
+
+use strict;
+
+my $P = $0;
+$P =~ s@.*/@@g;
+
+my $V = '0.30';
+
+use Getopt::Long qw(:config no_auto_abbrev);
+
+my $quiet = 0;
+my $tree = 1;
+my $chk_signoff = 1;
+my $chk_patch = 1;
+my $tst_only;
+my $emacs = 0;
+my $terse = 0;
+my $file = 0;
+my $check = 0;
+my $summary = 1;
+my $mailback = 0;
+my $summary_file = 0;
+my $root;
+my %debug;
+my $help = 0;
+
+sub help {
+       my ($exitcode) = @_;
+
+       print << "EOM";
+Usage: $P [OPTION]... [FILE]...
+Version: $V
+
+Options:
+  -q, --quiet                quiet
+  --no-tree                  run without a kernel tree
+  --no-signoff               do not check for 'Signed-off-by' line
+  --patch                    treat FILE as patchfile (default)
+  --emacs                    emacs compile window format
+  --terse                    one line per report
+  -f, --file                 treat FILE as regular source file
+  --subjective, --strict     enable more subjective tests
+  --root=PATH                PATH to the kernel tree root
+  --no-summary               suppress the per-file summary
+  --mailback                 only produce a report in case of warnings/errors
+  --summary-file             include the filename in summary
+  --debug KEY=[0|1]          turn on/off debugging of KEY, where KEY is one of
+                             'values', 'possible', 'type', and 'attr' (default
+                             is all off)
+  --test-only=WORD           report only warnings/errors containing WORD
+                             literally
+  -h, --help, --version      display this help and exit
+
+When FILE is - read standard input.
+EOM
+
+       exit($exitcode);
+}
+
+GetOptions(
+       'q|quiet+'      => \$quiet,
+       'tree!'         => \$tree,
+       'signoff!'      => \$chk_signoff,
+       'patch!'        => \$chk_patch,
+       'emacs!'        => \$emacs,
+       'terse!'        => \$terse,
+       'f|file!'       => \$file,
+       'subjective!'   => \$check,
+       'strict!'       => \$check,
+       'root=s'        => \$root,
+       'summary!'      => \$summary,
+       'mailback!'     => \$mailback,
+       'summary-file!' => \$summary_file,
+
+       'debug=s'       => \%debug,
+       'test-only=s'   => \$tst_only,
+       'h|help'        => \$help,
+       'version'       => \$help
+) or help(1);
+
+help(0) if ($help);
+
+my $exit = 0;
+
+if ($#ARGV < 0) {
+       print "$P: no input files\n";
+       exit(1);
+}
+
+my $dbg_values = 0;
+my $dbg_possible = 0;
+my $dbg_type = 0;
+my $dbg_attr = 0;
+for my $key (keys %debug) {
+       ## no critic
+       eval "\${dbg_$key} = '$debug{$key}';";
+       die "$@" if ($@);
+}
+
+if ($terse) {
+       $emacs = 1;
+       $quiet++;
+}
+
+if ($tree) {
+       if (defined $root) {
+               if (!top_of_kernel_tree($root)) {
+                       die "$P: $root: --root does not point at a valid tree\n";
+               }
+       } else {
+               if (top_of_kernel_tree('.')) {
+                       $root = '.';
+               } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ &&
+                                               top_of_kernel_tree($1)) {
+                       $root = $1;
+               }
+       }
+
+       if (!defined $root) {
+               print "Must be run from the top-level dir. of a kernel tree\n";
+               exit(2);
+       }
+}
+
+my $emitted_corrupt = 0;
+
+our $Ident     = qr{
+                       [A-Za-z_][A-Za-z\d_]*
+                       (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)*
+               }x;
+our $Storage   = qr{extern|static|asmlinkage};
+our $Sparse    = qr{
+                       __user|
+                       __kernel|
+                       __force|
+                       __iomem|
+                       __must_check|
+                       __init_refok|
+                       __kprobes|
+                       __ref
+               }x;
+
+# Notes to $Attribute:
+# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check
+our $Attribute = qr{
+                       const|
+                       __read_mostly|
+                       __kprobes|
+                       __(?:mem|cpu|dev|)(?:initdata|initconst|init\b)|
+                       ____cacheline_aligned|
+                       ____cacheline_aligned_in_smp|
+                       ____cacheline_internodealigned_in_smp|
+                       __weak
+                 }x;
+our $Modifier;
+our $Inline    = qr{inline|__always_inline|noinline};
+our $Member    = qr{->$Ident|\.$Ident|\[[^]]*\]};
+our $Lval      = qr{$Ident(?:$Member)*};
+
+our $Constant  = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*};
+our $Assignment        = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)};
+our $Compare    = qr{<=|>=|==|!=|<|>};
+our $Operators = qr{
+                       <=|>=|==|!=|
+                       =>|->|<<|>>|<|>|!|~|
+                       &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%
+                 }x;
+
+our $NonptrType;
+our $Type;
+our $Declare;
+
+our $UTF8      = qr {
+       [\x09\x0A\x0D\x20-\x7E]              # ASCII
+       | [\xC2-\xDF][\x80-\xBF]             # non-overlong 2-byte
+       |  \xE0[\xA0-\xBF][\x80-\xBF]        # excluding overlongs
+       | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
+       |  \xED[\x80-\x9F][\x80-\xBF]        # excluding surrogates
+       |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
+       | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
+       |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
+}x;
+
+our $typeTypedefs = qr{(?x:
+       (?:__)?(?:u|s|be|le)(?:8|16|32|64)|
+       atomic_t
+)};
+
+our $logFunctions = qr{(?x:
+       printk|
+       pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)|
+       dev_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)|
+       WARN|
+       panic
+)};
+
+our @typeList = (
+       qr{void},
+       qr{(?:unsigned\s+)?char},
+       qr{(?:unsigned\s+)?short},
+       qr{(?:unsigned\s+)?int},
+       qr{(?:unsigned\s+)?long},
+       qr{(?:unsigned\s+)?long\s+int},
+       qr{(?:unsigned\s+)?long\s+long},
+       qr{(?:unsigned\s+)?long\s+long\s+int},
+       qr{unsigned},
+       qr{float},
+       qr{double},
+       qr{bool},
+       qr{struct\s+$Ident},
+       qr{union\s+$Ident},
+       qr{enum\s+$Ident},
+       qr{${Ident}_t},
+       qr{${Ident}_handler},
+       qr{${Ident}_handler_fn},
+);
+our @modifierList = (
+       qr{fastcall},
+);
+
+sub build_types {
+       my $mods = "(?x:  \n" . join("|\n  ", @modifierList) . "\n)";
+       my $all = "(?x:  \n" . join("|\n  ", @typeList) . "\n)";
+       $Modifier       = qr{(?:$Attribute|$Sparse|$mods)};
+       $NonptrType     = qr{
+                       (?:$Modifier\s+|const\s+)*
+                       (?:
+                               (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)|
+                               (?:$typeTypedefs\b)|
+                               (?:${all}\b)
+                       )
+                       (?:\s+$Modifier|\s+const)*
+                 }x;
+       $Type   = qr{
+                       $NonptrType
+                       (?:[\s\*]+\s*const|[\s\*]+|(?:\s*\[\s*\])+)?
+                       (?:\s+$Inline|\s+$Modifier)*
+                 }x;
+       $Declare        = qr{(?:$Storage\s+)?$Type};
+}
+build_types();
+
+$chk_signoff = 0 if ($file);
+
+my @dep_includes = ();
+my @dep_functions = ();
+my $removal = "Documentation/feature-removal-schedule.txt";
+if ($tree && -f "$root/$removal") {
+       open(my $REMOVE, '<', "$root/$removal") ||
+                               die "$P: $removal: open failed - $!\n";
+       while (<$REMOVE>) {
+               if (/^Check:\s+(.*\S)/) {
+                       for my $entry (split(/[, ]+/, $1)) {
+                               if ($entry =~ m@include/(.*)@) {
+                                       push(@dep_includes, $1);
+
+                               } elsif ($entry !~ m@/@) {
+                                       push(@dep_functions, $entry);
+                               }
+                       }
+               }
+       }
+       close($REMOVE);
+}
+
+my @rawlines = ();
+my @lines = ();
+my $vname;
+for my $filename (@ARGV) {
+       my $FILE;
+       if ($file) {
+               open($FILE, '-|', "diff -u /dev/null $filename") ||
+                       die "$P: $filename: diff failed - $!\n";
+       } elsif ($filename eq '-') {
+               open($FILE, '<&STDIN');
+       } else {
+               open($FILE, '<', "$filename") ||
+                       die "$P: $filename: open failed - $!\n";
+       }
+       if ($filename eq '-') {
+               $vname = 'Your patch';
+       } else {
+               $vname = $filename;
+       }
+       while (<$FILE>) {
+               chomp;
+               push(@rawlines, $_);
+       }
+       close($FILE);
+       if (!process($filename)) {
+               $exit = 1;
+       }
+       @rawlines = ();
+       @lines = ();
+}
+
+exit($exit);
+
+sub top_of_kernel_tree {
+       my ($root) = @_;
+
+       my @tree_check = (
+               "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile",
+               "README", "Documentation", "arch", "include", "drivers",
+               "fs", "init", "ipc", "kernel", "lib", "scripts",
+       );
+
+       foreach my $check (@tree_check) {
+               if (! -e $root . '/' . $check) {
+                       return 0;
+               }
+       }
+       return 1;
+}
+
+sub expand_tabs {
+       my ($str) = @_;
+
+       my $res = '';
+       my $n = 0;
+       for my $c (split(//, $str)) {
+               if ($c eq "\t") {
+                       $res .= ' ';
+                       $n++;
+                       for (; ($n % 8) != 0; $n++) {
+                               $res .= ' ';
+                       }
+                       next;
+               }
+               $res .= $c;
+               $n++;
+       }
+
+       return $res;
+}
+sub copy_spacing {
+       (my $res = shift) =~ tr/\t/ /c;
+       return $res;
+}
+
+sub line_stats {
+       my ($line) = @_;
+
+       # Drop the diff line leader and expand tabs
+       $line =~ s/^.//;
+       $line = expand_tabs($line);
+
+       # Pick the indent from the front of the line.
+       my ($white) = ($line =~ /^(\s*)/);
+
+       return (length($line), length($white));
+}
+
+my $sanitise_quote = '';
+
+sub sanitise_line_reset {
+       my ($in_comment) = @_;
+
+       if ($in_comment) {
+               $sanitise_quote = '*/';
+       } else {
+               $sanitise_quote = '';
+       }
+}
+sub sanitise_line {
+       my ($line) = @_;
+
+       my $res = '';
+       my $l = '';
+
+       my $qlen = 0;
+       my $off = 0;
+       my $c;
+
+       # Always copy over the diff marker.
+       $res = substr($line, 0, 1);
+
+       for ($off = 1; $off < length($line); $off++) {
+               $c = substr($line, $off, 1);
+
+               # Comments we are wacking completly including the begin
+               # and end, all to $;.
+               if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') {
+                       $sanitise_quote = '*/';
+
+                       substr($res, $off, 2, "$;$;");
+                       $off++;
+                       next;
+               }
+               if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') {
+                       $sanitise_quote = '';
+                       substr($res, $off, 2, "$;$;");
+                       $off++;
+                       next;
+               }
+               if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') {
+                       $sanitise_quote = '//';
+
+                       substr($res, $off, 2, $sanitise_quote);
+                       $off++;
+                       next;
+               }
+
+               # A \ in a string means ignore the next character.
+               if (($sanitise_quote eq "'" || $sanitise_quote eq '"') &&
+                   $c eq "\\") {
+                       substr($res, $off, 2, 'XX');
+                       $off++;
+                       next;
+               }
+               # Regular quotes.
+               if ($c eq "'" || $c eq '"') {
+                       if ($sanitise_quote eq '') {
+                               $sanitise_quote = $c;
+
+                               substr($res, $off, 1, $c);
+                               next;
+                       } elsif ($sanitise_quote eq $c) {
+                               $sanitise_quote = '';
+                       }
+               }
+
+               #print "c<$c> SQ<$sanitise_quote>\n";
+               if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") {
+                       substr($res, $off, 1, $;);
+               } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") {
+                       substr($res, $off, 1, $;);
+               } elsif ($off != 0 && $sanitise_quote && $c ne "\t") {
+                       substr($res, $off, 1, 'X');
+               } else {
+                       substr($res, $off, 1, $c);
+               }
+       }
+
+       if ($sanitise_quote eq '//') {
+               $sanitise_quote = '';
+       }
+
+       # The pathname on a #include may be surrounded by '<' and '>'.
+       if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) {
+               my $clean = 'X' x length($1);
+               $res =~ s@\<.*\>@<$clean>@;
+
+       # The whole of a #error is a string.
+       } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) {
+               my $clean = 'X' x length($1);
+               $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@;
+       }
+
+       return $res;
+}
+
+sub ctx_statement_block {
+       my ($linenr, $remain, $off) = @_;
+       my $line = $linenr - 1;
+       my $blk = '';
+       my $soff = $off;
+       my $coff = $off - 1;
+       my $coff_set = 0;
+
+       my $loff = 0;
+
+       my $type = '';
+       my $level = 0;
+       my @stack = ();
+       my $p;
+       my $c;
+       my $len = 0;
+
+       my $remainder;
+       while (1) {
+               @stack = (['', 0]) if ($#stack == -1);
+
+               #warn "CSB: blk<$blk> remain<$remain>\n";
+               # If we are about to drop off the end, pull in more
+               # context.
+               if ($off >= $len) {
+                       for (; $remain > 0; $line++) {
+                               last if (!defined $lines[$line]);
+                               next if ($lines[$line] =~ /^-/);
+                               $remain--;
+                               $loff = $len;
+                               $blk .= $lines[$line] . "\n";
+                               $len = length($blk);
+                               $line++;
+                               last;
+                       }
+                       # Bail if there is no further context.
+                       #warn "CSB: blk<$blk> off<$off> len<$len>\n";
+                       if ($off >= $len) {
+                               last;
+                       }
+               }
+               $p = $c;
+               $c = substr($blk, $off, 1);
+               $remainder = substr($blk, $off);
+
+               #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n";
+
+               # Handle nested #if/#else.
+               if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) {
+                       push(@stack, [ $type, $level ]);
+               } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) {
+                       ($type, $level) = @{$stack[$#stack - 1]};
+               } elsif ($remainder =~ /^#\s*endif\b/) {
+                       ($type, $level) = @{pop(@stack)};
+               }
+
+               # Statement ends at the ';' or a close '}' at the
+               # outermost level.
+               if ($level == 0 && $c eq ';') {
+                       last;
+               }
+
+               # An else is really a conditional as long as its not else if
+               if ($level == 0 && $coff_set == 0 &&
+                               (!defined($p) || $p =~ /(?:\s|\}|\+)/) &&
+                               $remainder =~ /^(else)(?:\s|{)/ &&
+                               $remainder !~ /^else\s+if\b/) {
+                       $coff = $off + length($1) - 1;
+                       $coff_set = 1;
+                       #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n";
+                       #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n";
+               }
+
+               if (($type eq '' || $type eq '(') && $c eq '(') {
+                       $level++;
+                       $type = '(';
+               }
+               if ($type eq '(' && $c eq ')') {
+                       $level--;
+                       $type = ($level != 0)? '(' : '';
+
+                       if ($level == 0 && $coff < $soff) {
+                               $coff = $off;
+                               $coff_set = 1;
+                               #warn "CSB: mark coff<$coff>\n";
+                       }
+               }
+               if (($type eq '' || $type eq '{') && $c eq '{') {
+                       $level++;
+                       $type = '{';
+               }
+               if ($type eq '{' && $c eq '}') {
+                       $level--;
+                       $type = ($level != 0)? '{' : '';
+
+                       if ($level == 0) {
+                               last;
+                       }
+               }
+               $off++;
+       }
+       # We are truly at the end, so shuffle to the next line.
+       if ($off == $len) {
+               $loff = $len + 1;
+               $line++;
+               $remain--;
+       }
+
+       my $statement = substr($blk, $soff, $off - $soff + 1);
+       my $condition = substr($blk, $soff, $coff - $soff + 1);
+
+       #warn "STATEMENT<$statement>\n";
+       #warn "CONDITION<$condition>\n";
+
+       #print "coff<$coff> soff<$off> loff<$loff>\n";
+
+       return ($statement, $condition,
+                       $line, $remain + 1, $off - $loff + 1, $level);
+}
+
+sub statement_lines {
+       my ($stmt) = @_;
+
+       # Strip the diff line prefixes and rip blank lines at start and end.
+       $stmt =~ s/(^|\n)./$1/g;
+       $stmt =~ s/^\s*//;
+       $stmt =~ s/\s*$//;
+
+       my @stmt_lines = ($stmt =~ /\n/g);
+
+       return $#stmt_lines + 2;
+}
+
+sub statement_rawlines {
+       my ($stmt) = @_;
+
+       my @stmt_lines = ($stmt =~ /\n/g);
+
+       return $#stmt_lines + 2;
+}
+
+sub statement_block_size {
+       my ($stmt) = @_;
+
+       $stmt =~ s/(^|\n)./$1/g;
+       $stmt =~ s/^\s*{//;
+       $stmt =~ s/}\s*$//;
+       $stmt =~ s/^\s*//;
+       $stmt =~ s/\s*$//;
+
+       my @stmt_lines = ($stmt =~ /\n/g);
+       my @stmt_statements = ($stmt =~ /;/g);
+
+       my $stmt_lines = $#stmt_lines + 2;
+       my $stmt_statements = $#stmt_statements + 1;
+
+       if ($stmt_lines > $stmt_statements) {
+               return $stmt_lines;
+       } else {
+               return $stmt_statements;
+       }
+}
+
+sub ctx_statement_full {
+       my ($linenr, $remain, $off) = @_;
+       my ($statement, $condition, $level);
+
+       my (@chunks);
+
+       # Grab the first conditional/block pair.
+       ($statement, $condition, $linenr, $remain, $off, $level) =
+                               ctx_statement_block($linenr, $remain, $off);
+       #print "F: c<$condition> s<$statement> remain<$remain>\n";
+       push(@chunks, [ $condition, $statement ]);
+       if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) {
+               return ($level, $linenr, @chunks);
+       }
+
+       # Pull in the following conditional/block pairs and see if they
+       # could continue the statement.
+       for (;;) {
+               ($statement, $condition, $linenr, $remain, $off, $level) =
+                               ctx_statement_block($linenr, $remain, $off);
+               #print "C: c<$condition> s<$statement> remain<$remain>\n";
+               last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s));
+               #print "C: push\n";
+               push(@chunks, [ $condition, $statement ]);
+       }
+
+       return ($level, $linenr, @chunks);
+}
+
+sub ctx_block_get {
+       my ($linenr, $remain, $outer, $open, $close, $off) = @_;
+       my $line;
+       my $start = $linenr - 1;
+       my $blk = '';
+       my @o;
+       my @c;
+       my @res = ();
+
+       my $level = 0;
+       my @stack = ($level);
+       for ($line = $start; $remain > 0; $line++) {
+               next if ($rawlines[$line] =~ /^-/);
+               $remain--;
+
+               $blk .= $rawlines[$line];
+
+               # Handle nested #if/#else.
+               if ($rawlines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) {
+                       push(@stack, $level);
+               } elsif ($rawlines[$line] =~ /^.\s*#\s*(?:else|elif)\b/) {
+                       $level = $stack[$#stack - 1];
+               } elsif ($rawlines[$line] =~ /^.\s*#\s*endif\b/) {
+                       $level = pop(@stack);
+               }
+
+               foreach my $c (split(//, $rawlines[$line])) {
+                       ##print "C<$c>L<$level><$open$close>O<$off>\n";
+                       if ($off > 0) {
+                               $off--;
+                               next;
+                       }
+
+                       if ($c eq $close && $level > 0) {
+                               $level--;
+                               last if ($level == 0);
+                       } elsif ($c eq $open) {
+                               $level++;
+                       }
+               }
+
+               if (!$outer || $level <= 1) {
+                       push(@res, $rawlines[$line]);
+               }
+
+               last if ($level == 0);
+       }
+
+       return ($level, @res);
+}
+sub ctx_block_outer {
+       my ($linenr, $remain) = @_;
+
+       my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0);
+       return @r;
+}
+sub ctx_block {
+       my ($linenr, $remain) = @_;
+
+       my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0);
+       return @r;
+}
+sub ctx_statement {
+       my ($linenr, $remain, $off) = @_;
+
+       my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off);
+       return @r;
+}
+sub ctx_block_level {
+       my ($linenr, $remain) = @_;
+
+       return ctx_block_get($linenr, $remain, 0, '{', '}', 0);
+}
+sub ctx_statement_level {
+       my ($linenr, $remain, $off) = @_;
+
+       return ctx_block_get($linenr, $remain, 0, '(', ')', $off);
+}
+
+sub ctx_locate_comment {
+       my ($first_line, $end_line) = @_;
+
+       # Catch a comment on the end of the line itself.
+       my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@);
+       return $current_comment if (defined $current_comment);
+
+       # Look through the context and try and figure out if there is a
+       # comment.
+       my $in_comment = 0;
+       $current_comment = '';
+       for (my $linenr = $first_line; $linenr < $end_line; $linenr++) {
+               my $line = $rawlines[$linenr - 1];
+               #warn "           $line\n";
+               if ($linenr == $first_line and $line =~ m@^.\s*\*@) {
+                       $in_comment = 1;
+               }
+               if ($line =~ m@/\*@) {
+                       $in_comment = 1;
+               }
+               if (!$in_comment && $current_comment ne '') {
+                       $current_comment = '';
+               }
+               $current_comment .= $line . "\n" if ($in_comment);
+               if ($line =~ m@\*/@) {
+                       $in_comment = 0;
+               }
+       }
+
+       chomp($current_comment);
+       return($current_comment);
+}
+sub ctx_has_comment {
+       my ($first_line, $end_line) = @_;
+       my $cmt = ctx_locate_comment($first_line, $end_line);
+
+       ##print "LINE: $rawlines[$end_line - 1 ]\n";
+       ##print "CMMT: $cmt\n";
+
+       return ($cmt ne '');
+}
+
+sub raw_line {
+       my ($linenr, $cnt) = @_;
+
+       my $offset = $linenr - 1;
+       $cnt++;
+
+       my $line;
+       while ($cnt) {
+               $line = $rawlines[$offset++];
+               next if (defined($line) && $line =~ /^-/);
+               $cnt--;
+       }
+
+       return $line;
+}
+
+sub cat_vet {
+       my ($vet) = @_;
+       my ($res, $coded);
+
+       $res = '';
+       while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) {
+               $res .= $1;
+               if ($2 ne '') {
+                       $coded = sprintf("^%c", unpack('C', $2) + 64);
+                       $res .= $coded;
+               }
+       }
+       $res =~ s/$/\$/;
+
+       return $res;
+}
+
+my $av_preprocessor = 0;
+my $av_pending;
+my @av_paren_type;
+my $av_pend_colon;
+
+sub annotate_reset {
+       $av_preprocessor = 0;
+       $av_pending = '_';
+       @av_paren_type = ('E');
+       $av_pend_colon = 'O';
+}
+
+sub annotate_values {
+       my ($stream, $type) = @_;
+
+       my $res;
+       my $var = '_' x length($stream);
+       my $cur = $stream;
+
+       print "$stream\n" if ($dbg_values > 1);
+
+       while (length($cur)) {
+               @av_paren_type = ('E') if ($#av_paren_type < 0);
+               print " <" . join('', @av_paren_type) .
+                               "> <$type> <$av_pending>" if ($dbg_values > 1);
+               if ($cur =~ /^(\s+)/o) {
+                       print "WS($1)\n" if ($dbg_values > 1);
+                       if ($1 =~ /\n/ && $av_preprocessor) {
+                               $type = pop(@av_paren_type);
+                               $av_preprocessor = 0;
+                       }
+
+               } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\()/) {
+                       print "DECLARE($1)\n" if ($dbg_values > 1);
+                       $type = 'T';
+
+               } elsif ($cur =~ /^($Modifier)\s*/) {
+                       print "MODIFIER($1)\n" if ($dbg_values > 1);
+                       $type = 'T';
+
+               } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) {
+                       print "DEFINE($1,$2)\n" if ($dbg_values > 1);
+                       $av_preprocessor = 1;
+                       push(@av_paren_type, $type);
+                       if ($2 ne '') {
+                               $av_pending = 'N';
+                       }
+                       $type = 'E';
+
+               } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) {
+                       print "UNDEF($1)\n" if ($dbg_values > 1);
+                       $av_preprocessor = 1;
+                       push(@av_paren_type, $type);
+
+               } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) {
+                       print "PRE_START($1)\n" if ($dbg_values > 1);
+                       $av_preprocessor = 1;
+
+                       push(@av_paren_type, $type);
+                       push(@av_paren_type, $type);
+                       $type = 'E';
+
+               } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) {
+                       print "PRE_RESTART($1)\n" if ($dbg_values > 1);
+                       $av_preprocessor = 1;
+
+                       push(@av_paren_type, $av_paren_type[$#av_paren_type]);
+
+                       $type = 'E';
+
+               } elsif ($cur =~ /^(\#\s*(?:endif))/o) {
+                       print "PRE_END($1)\n" if ($dbg_values > 1);
+
+                       $av_preprocessor = 1;
+
+                       # Assume all arms of the conditional end as this
+                       # one does, and continue as if the #endif was not here.
+                       pop(@av_paren_type);
+                       push(@av_paren_type, $type);
+                       $type = 'E';
+
+               } elsif ($cur =~ /^(\\\n)/o) {
+                       print "PRECONT($1)\n" if ($dbg_values > 1);
+
+               } elsif ($cur =~ /^(__attribute__)\s*\(?/o) {
+                       print "ATTR($1)\n" if ($dbg_values > 1);
+                       $av_pending = $type;
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(sizeof)\s*(\()?/o) {
+                       print "SIZEOF($1)\n" if ($dbg_values > 1);
+                       if (defined $2) {
+                               $av_pending = 'V';
+                       }
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(if|while|for)\b/o) {
+                       print "COND($1)\n" if ($dbg_values > 1);
+                       $av_pending = 'E';
+                       $type = 'N';
+
+               } elsif ($cur =~/^(case)/o) {
+                       print "CASE($1)\n" if ($dbg_values > 1);
+                       $av_pend_colon = 'C';
+                       $type = 'N';
+
+               } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) {
+                       print "KEYWORD($1)\n" if ($dbg_values > 1);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(\()/o) {
+                       print "PAREN('$1')\n" if ($dbg_values > 1);
+                       push(@av_paren_type, $av_pending);
+                       $av_pending = '_';
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(\))/o) {
+                       my $new_type = pop(@av_paren_type);
+                       if ($new_type ne '_') {
+                               $type = $new_type;
+                               print "PAREN('$1') -> $type\n"
+                                                       if ($dbg_values > 1);
+                       } else {
+                               print "PAREN('$1')\n" if ($dbg_values > 1);
+                       }
+
+               } elsif ($cur =~ /^($Ident)\s*\(/o) {
+                       print "FUNC($1)\n" if ($dbg_values > 1);
+                       $type = 'V';
+                       $av_pending = 'V';
+
+               } elsif ($cur =~ /^($Ident\s*):(?:\s*\d+\s*(,|=|;))?/) {
+                       if (defined $2 && $type eq 'C' || $type eq 'T') {
+                               $av_pend_colon = 'B';
+                       } elsif ($type eq 'E') {
+                               $av_pend_colon = 'L';
+                       }
+                       print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1);
+                       $type = 'V';
+
+               } elsif ($cur =~ /^($Ident|$Constant)/o) {
+                       print "IDENT($1)\n" if ($dbg_values > 1);
+                       $type = 'V';
+
+               } elsif ($cur =~ /^($Assignment)/o) {
+                       print "ASSIGN($1)\n" if ($dbg_values > 1);
+                       $type = 'N';
+
+               } elsif ($cur =~/^(;|{|})/) {
+                       print "END($1)\n" if ($dbg_values > 1);
+                       $type = 'E';
+                       $av_pend_colon = 'O';
+
+               } elsif ($cur =~/^(,)/) {
+                       print "COMMA($1)\n" if ($dbg_values > 1);
+                       $type = 'C';
+
+               } elsif ($cur =~ /^(\?)/o) {
+                       print "QUESTION($1)\n" if ($dbg_values > 1);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(:)/o) {
+                       print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1);
+
+                       substr($var, length($res), 1, $av_pend_colon);
+                       if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') {
+                               $type = 'E';
+                       } else {
+                               $type = 'N';
+                       }
+                       $av_pend_colon = 'O';
+
+               } elsif ($cur =~ /^(\[)/o) {
+                       print "CLOSE($1)\n" if ($dbg_values > 1);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) {
+                       my $variant;
+
+                       print "OPV($1)\n" if ($dbg_values > 1);
+                       if ($type eq 'V') {
+                               $variant = 'B';
+                       } else {
+                               $variant = 'U';
+                       }
+
+                       substr($var, length($res), 1, $variant);
+                       $type = 'N';
+
+               } elsif ($cur =~ /^($Operators)/o) {
+                       print "OP($1)\n" if ($dbg_values > 1);
+                       if ($1 ne '++' && $1 ne '--') {
+                               $type = 'N';
+                       }
+
+               } elsif ($cur =~ /(^.)/o) {
+                       print "C($1)\n" if ($dbg_values > 1);
+               }
+               if (defined $1) {
+                       $cur = substr($cur, length($1));
+                       $res .= $type x length($1);
+               }
+       }
+
+       return ($res, $var);
+}
+
+sub possible {
+       my ($possible, $line) = @_;
+       my $notPermitted = qr{(?:
+               ^(?:
+                       $Modifier|
+                       $Storage|
+                       $Type|
+                       DEFINE_\S+
+               )$|
+               ^(?:
+                       goto|
+                       return|
+                       case|
+                       else|
+                       asm|__asm__|
+                       do
+               )(?:\s|$)|
+               ^(?:typedef|struct|enum)\b
+           )}x;
+       warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2);
+       if ($possible !~ $notPermitted) {
+               # Check for modifiers.
+               $possible =~ s/\s*$Storage\s*//g;
+               $possible =~ s/\s*$Sparse\s*//g;
+               if ($possible =~ /^\s*$/) {
+
+               } elsif ($possible =~ /\s/) {
+                       $possible =~ s/\s*$Type\s*//g;
+                       for my $modifier (split(' ', $possible)) {
+                               if ($modifier !~ $notPermitted) {
+                                       warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible);
+                                       push(@modifierList, $modifier);
+                               }
+                       }
+
+               } else {
+                       warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible);
+                       push(@typeList, $possible);
+               }
+               build_types();
+       } else {
+               warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1);
+       }
+}
+
+my $prefix = '';
+
+sub report {
+       if (defined $tst_only && $_[0] !~ /\Q$tst_only\E/) {
+               return 0;
+       }
+       my $line = $prefix . $_[0];
+
+       $line = (split('\n', $line))[0] . "\n" if ($terse);
+
+       push(our @report, $line);
+
+       return 1;
+}
+sub report_dump {
+       our @report;
+}
+sub ERROR {
+       if (report("ERROR: $_[0]\n")) {
+               our $clean = 0;
+               our $cnt_error++;
+       }
+}
+sub WARN {
+       if (report("WARNING: $_[0]\n")) {
+               our $clean = 0;
+               our $cnt_warn++;
+       }
+}
+sub CHK {
+       if ($check && report("CHECK: $_[0]\n")) {
+               our $clean = 0;
+               our $cnt_chk++;
+       }
+}
+
+sub check_absolute_file {
+       my ($absolute, $herecurr) = @_;
+       my $file = $absolute;
+
+       ##print "absolute<$absolute>\n";
+
+       # See if any suffix of this path is a path within the tree.
+       while ($file =~ s@^[^/]*/@@) {
+               if (-f "$root/$file") {
+                       ##print "file<$file>\n";
+                       last;
+               }
+       }
+       if (! -f _)  {
+               return 0;
+       }
+
+       # It is, so see if the prefix is acceptable.
+       my $prefix = $absolute;
+       substr($prefix, -length($file)) = '';
+
+       ##print "prefix<$prefix>\n";
+       if ($prefix ne ".../") {
+               WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr);
+       }
+}
+
+sub process {
+       my $filename = shift;
+
+       my $linenr=0;
+       my $prevline="";
+       my $prevrawline="";
+       my $stashline="";
+       my $stashrawline="";
+
+       my $length;
+       my $indent;
+       my $previndent=0;
+       my $stashindent=0;
+
+       our $clean = 1;
+       my $signoff = 0;
+       my $is_patch = 0;
+
+       our @report = ();
+       our $cnt_lines = 0;
+       our $cnt_error = 0;
+       our $cnt_warn = 0;
+       our $cnt_chk = 0;
+
+       # Trace the real file/line as we go.
+       my $realfile = '';
+       my $realline = 0;
+       my $realcnt = 0;
+       my $here = '';
+       my $in_comment = 0;
+       my $comment_edge = 0;
+       my $first_line = 0;
+       my $p1_prefix = '';
+
+       my $prev_values = 'E';
+
+       # suppression flags
+       my %suppress_ifbraces;
+       my %suppress_whiletrailers;
+       my %suppress_export;
+
+       # Pre-scan the patch sanitizing the lines.
+       # Pre-scan the patch looking for any __setup documentation.
+       #
+       my @setup_docs = ();
+       my $setup_docs = 0;
+
+       sanitise_line_reset();
+       my $line;
+       foreach my $rawline (@rawlines) {
+               $linenr++;
+               $line = $rawline;
+
+               if ($rawline=~/^\+\+\+\s+(\S+)/) {
+                       $setup_docs = 0;
+                       if ($1 =~ m@Documentation/kernel-parameters.txt$@) {
+                               $setup_docs = 1;
+                       }
+                       #next;
+               }
+               if ($rawline=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
+                       $realline=$1-1;
+                       if (defined $2) {
+                               $realcnt=$3+1;
+                       } else {
+                               $realcnt=1+1;
+                       }
+                       $in_comment = 0;
+
+                       # Guestimate if this is a continuing comment.  Run
+                       # the context looking for a comment "edge".  If this
+                       # edge is a close comment then we must be in a comment
+                       # at context start.
+                       my $edge;
+                       my $cnt = $realcnt;
+                       for (my $ln = $linenr + 1; $cnt > 0; $ln++) {
+                               next if (defined $rawlines[$ln - 1] &&
+                                        $rawlines[$ln - 1] =~ /^-/);
+                               $cnt--;
+                               #print "RAW<$rawlines[$ln - 1]>\n";
+                               last if (!defined $rawlines[$ln - 1]);
+                               if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ &&
+                                   $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) {
+                                       ($edge) = $1;
+                                       last;
+                               }
+                       }
+                       if (defined $edge && $edge eq '*/') {
+                               $in_comment = 1;
+                       }
+
+                       # Guestimate if this is a continuing comment.  If this
+                       # is the start of a diff block and this line starts
+                       # ' *' then it is very likely a comment.
+                       if (!defined $edge &&
+                           $rawlines[$linenr] =~ m@^.\s*(?:\*\*+| \*)(?:\s|$)@)
+                       {
+                               $in_comment = 1;
+                       }
+
+                       ##print "COMMENT:$in_comment edge<$edge> $rawline\n";
+                       sanitise_line_reset($in_comment);
+
+               } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) {
+                       # Standardise the strings and chars within the input to
+                       # simplify matching -- only bother with positive lines.
+                       $line = sanitise_line($rawline);
+               }
+               push(@lines, $line);
+
+               if ($realcnt > 1) {
+                       $realcnt-- if ($line =~ /^(?:\+| |$)/);
+               } else {
+                       $realcnt = 0;
+               }
+
+               #print "==>$rawline\n";
+               #print "-->$line\n";
+
+               if ($setup_docs && $line =~ /^\+/) {
+                       push(@setup_docs, $line);
+               }
+       }
+
+       $prefix = '';
+
+       $realcnt = 0;
+       $linenr = 0;
+       foreach my $line (@lines) {
+               $linenr++;
+
+               my $rawline = $rawlines[$linenr - 1];
+
+#extract the line range in the file after the patch is applied
+               if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
+                       $is_patch = 1;
+                       $first_line = $linenr + 1;
+                       $realline=$1-1;
+                       if (defined $2) {
+                               $realcnt=$3+1;
+                       } else {
+                               $realcnt=1+1;
+                       }
+                       annotate_reset();
+                       $prev_values = 'E';
+
+                       %suppress_ifbraces = ();
+                       %suppress_whiletrailers = ();
+                       %suppress_export = ();
+                       next;
+
+# track the line number as we move through the hunk, note that
+# new versions of GNU diff omit the leading space on completely
+# blank context lines so we need to count that too.
+               } elsif ($line =~ /^( |\+|$)/) {
+                       $realline++;
+                       $realcnt-- if ($realcnt != 0);
+
+                       # Measure the line length and indent.
+                       ($length, $indent) = line_stats($rawline);
+
+                       # Track the previous line.
+                       ($prevline, $stashline) = ($stashline, $line);
+                       ($previndent, $stashindent) = ($stashindent, $indent);
+                       ($prevrawline, $stashrawline) = ($stashrawline, $rawline);
+
+                       #warn "line<$line>\n";
+
+               } elsif ($realcnt == 1) {
+                       $realcnt--;
+               }
+
+               my $hunk_line = ($realcnt != 0);
+
+#make up the handle for any error we report on this line
+               $prefix = "$filename:$realline: " if ($emacs && $file);
+               $prefix = "$filename:$linenr: " if ($emacs && !$file);
+
+               $here = "#$linenr: " if (!$file);
+               $here = "#$realline: " if ($file);
+
+               # extract the filename as it passes
+               if ($line=~/^\+\+\+\s+(\S+)/) {
+                       $realfile = $1;
+                       $realfile =~ s@^([^/]*)/@@;
+
+                       $p1_prefix = $1;
+                       if (!$file && $tree && $p1_prefix ne '' &&
+                           -e "$root/$p1_prefix") {
+                               WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
+                       }
+
+                       if ($realfile =~ m@^include/asm/@) {
+                               ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
+                       }
+                       next;
+               }
+
+               $here .= "FILE: $realfile:$realline:" if ($realcnt != 0);
+
+               my $hereline = "$here\n$rawline\n";
+               my $herecurr = "$here\n$rawline\n";
+               my $hereprev = "$here\n$prevrawline\n$rawline\n";
+
+               $cnt_lines++ if ($realcnt != 0);
+
+#check the patch for a signoff:
+               if ($line =~ /^\s*signed-off-by:/i) {
+                       # This is a signoff, if ugly, so do not double report.
+                       $signoff++;
+                       if (!($line =~ /^\s*Signed-off-by:/)) {
+                               WARN("Signed-off-by: is the preferred form\n" .
+                                       $herecurr);
+                       }
+                       if ($line =~ /^\s*signed-off-by:\S/i) {
+                               WARN("space required after Signed-off-by:\n" .
+                                       $herecurr);
+                       }
+               }
+
+# Check for wrappage within a valid hunk of the file
+               if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
+                       ERROR("patch seems to be corrupt (line wrapped?)\n" .
+                               $herecurr) if (!$emitted_corrupt++);
+               }
+
+# Check for absolute kernel paths.
+               if ($tree) {
+                       while ($line =~ m{(?:^|\s)(/\S*)}g) {
+                               my $file = $1;
+
+                               if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
+                                   check_absolute_file($1, $herecurr)) {
+                                       #
+                               } else {
+                                       check_absolute_file($file, $herecurr);
+                               }
+                       }
+               }
+
+# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
+               if (($realfile =~ /^$/ || $line =~ /^\+/) &&
+                   $rawline !~ m/^$UTF8*$/) {
+                       my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/);
+
+                       my $blank = copy_spacing($rawline);
+                       my $ptr = substr($blank, 0, length($utf8_prefix)) . "^";
+                       my $hereptr = "$hereline$ptr\n";
+
+                       ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr);
+               }
+
+# ignore non-hunk lines and lines being removed
+               next if (!$hunk_line || $line =~ /^-/);
+
+#trailing whitespace
+               if ($line =~ /^\+.*\015/) {
+                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
+                       ERROR("DOS line endings\n" . $herevet);
+
+               } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) {
+                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
+                       ERROR("trailing whitespace\n" . $herevet);
+               }
+
+# check for Kconfig help text having a real description
+               if ($realfile =~ /Kconfig/ &&
+                   $line =~ /\+?\s*(---)?help(---)?$/) {
+                       my $length = 0;
+                       for (my $l = $linenr; defined($lines[$l]); $l++) {
+                               my $f = $lines[$l];
+                               $f =~ s/#.*//;
+                               $f =~ s/^\s+//;
+                               next if ($f =~ /^$/);
+                               last if ($f =~ /^\s*config\s/);
+                               $length++;
+                       }
+                       WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4);
+               }
+
+# check we are in a valid source file if not then ignore this hunk
+               next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
+
+#80 column limit
+               if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
+                   $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
+                   $line !~ /^\+\s*$logFunctions\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
+                   $length > 80)
+               {
+                       WARN("line over 80 characters\n" . $herecurr);
+               }
+
+# check for spaces before a quoted newline
+               if ($rawline =~ /^.*\".*\s\\n/) {
+                       WARN("unnecessary whitespace before a quoted newline\n" . $herecurr);
+               }
+
+# check for adding lines without a newline.
+               if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
+                       WARN("adding a line without newline at end of file\n" . $herecurr);
+               }
+
+# Blackfin: use hi/lo macros
+               if ($realfile =~ m@arch/blackfin/.*\.S$@) {
+                       if ($line =~ /\.[lL][[:space:]]*=.*&[[:space:]]*0x[fF][fF][fF][fF]/) {
+                               my $herevet = "$here\n" . cat_vet($line) . "\n";
+                               ERROR("use the LO() macro, not (... & 0xFFFF)\n" . $herevet);
+                       }
+                       if ($line =~ /\.[hH][[:space:]]*=.*>>[[:space:]]*16/) {
+                               my $herevet = "$here\n" . cat_vet($line) . "\n";
+                               ERROR("use the HI() macro, not (... >> 16)\n" . $herevet);
+                       }
+               }
+
+# check we are in a valid source file C or perl if not then ignore this hunk
+               next if ($realfile !~ /\.(h|c|pl)$/);
+
+# at the beginning of a line any tabs must come first and anything
+# more than 8 must use tabs.
+               if ($rawline =~ /^\+\s* \t\s*\S/ ||
+                   $rawline =~ /^\+\s*        \s*/) {
+                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
+                       ERROR("code indent should use tabs where possible\n" . $herevet);
+               }
+
+# check for space before tabs.
+               if ($rawline =~ /^\+/ && $rawline =~ / \t/) {
+                       my $herevet = "$here\n" . cat_vet($rawline) . "\n";
+                       WARN("please, no space before tabs\n" . $herevet);
+               }
+
+# check we are in a valid C source file if not then ignore this hunk
+               next if ($realfile !~ /\.(h|c)$/);
+
+# check for RCS/CVS revision markers
+               if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
+                       WARN("CVS style keyword markers, these will _not_ be updated\n". $herecurr);
+               }
+
+# Blackfin: don't use __builtin_bfin_[cs]sync
+               if ($line =~ /__builtin_bfin_csync/) {
+                       my $herevet = "$here\n" . cat_vet($line) . "\n";
+                       ERROR("use the CSYNC() macro in asm/blackfin.h\n" . $herevet);
+               }
+               if ($line =~ /__builtin_bfin_ssync/) {
+                       my $herevet = "$here\n" . cat_vet($line) . "\n";
+                       ERROR("use the SSYNC() macro in asm/blackfin.h\n" . $herevet);
+               }
+
+# Check for potential 'bare' types
+               my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
+                   $realline_next);
+               if ($realcnt && $line =~ /.\s*\S/) {
+                       ($stat, $cond, $line_nr_next, $remain_next, $off_next) =
+                               ctx_statement_block($linenr, $realcnt, 0);
+                       $stat =~ s/\n./\n /g;
+                       $cond =~ s/\n./\n /g;
+
+                       # Find the real next line.
+                       $realline_next = $line_nr_next;
+                       if (defined $realline_next &&
+                           (!defined $lines[$realline_next - 1] ||
+                            substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) {
+                               $realline_next++;
+                       }
+
+                       my $s = $stat;
+                       $s =~ s/{.*$//s;
+
+                       # Ignore goto labels.
+                       if ($s =~ /$Ident:\*$/s) {
+
+                       # Ignore functions being called
+                       } elsif ($s =~ /^.\s*$Ident\s*\(/s) {
+
+                       } elsif ($s =~ /^.\s*else\b/s) {
+
+                       # declarations always start with types
+                       } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) {
+                               my $type = $1;
+                               $type =~ s/\s+/ /g;
+                               possible($type, "A:" . $s);
+
+                       # definitions in global scope can only start with types
+                       } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b\s*(?!:)/s) {
+                               possible($1, "B:" . $s);
+                       }
+
+                       # any (foo ... *) is a pointer cast, and foo is a type
+                       while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) {
+                               possible($1, "C:" . $s);
+                       }
+
+                       # Check for any sort of function declaration.
+                       # int foo(something bar, other baz);
+                       # void (*store_gdt)(x86_descr_ptr *);
+                       if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/s) {
+                               my ($name_len) = length($1);
+
+                               my $ctx = $s;
+                               substr($ctx, 0, $name_len + 1, '');
+                               $ctx =~ s/\)[^\)]*$//;
+
+                               for my $arg (split(/\s*,\s*/, $ctx)) {
+                                       if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) {
+
+                                               possible($1, "D:" . $s);
+                                       }
+                               }
+                       }
+
+               }
+
+#
+# Checks which may be anchored in the context.
+#
+
+# Check for switch () and associated case and default
+# statements should be at the same indent.
+               if ($line=~/\bswitch\s*\(.*\)/) {
+                       my $err = '';
+                       my $sep = '';
+                       my @ctx = ctx_block_outer($linenr, $realcnt);
+                       shift(@ctx);
+                       for my $ctx (@ctx) {
+                               my ($clen, $cindent) = line_stats($ctx);
+                               if ($ctx =~ /^\+\s*(case\s+|default:)/ &&
+                                                       $indent != $cindent) {
+                                       $err .= "$sep$ctx\n";
+                                       $sep = '';
+                               } else {
+                                       $sep = "[...]\n";
+                               }
+                       }
+                       if ($err ne '') {
+                               ERROR("switch and case should be at the same indent\n$hereline$err");
+                       }
+               }
+
+# if/while/etc brace do not go on next line, unless defining a do while loop,
+# or if that brace on the next line is for something else
+               if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
+                       my $pre_ctx = "$1$2";
+
+                       my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
+                       my $ctx_cnt = $realcnt - $#ctx - 1;
+                       my $ctx = join("\n", @ctx);
+
+                       my $ctx_ln = $linenr;
+                       my $ctx_skip = $realcnt;
+
+                       while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt &&
+                                       defined $lines[$ctx_ln - 1] &&
+                                       $lines[$ctx_ln - 1] =~ /^-/)) {
+                               ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n";
+                               $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/);
+                               $ctx_ln++;
+                       }
+
+                       #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
+                       #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";
+
+                       if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
+                               ERROR("that open brace { should be on the previous line\n" .
+                                       "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
+                       }
+                       if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ &&
+                           $ctx =~ /\)\s*\;\s*$/ &&
+                           defined $lines[$ctx_ln - 1])
+                       {
+                               my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]);
+                               if ($nindent > $indent) {
+                                       WARN("trailing semicolon indicates no statements, indent implies otherwise\n" .
+                                               "$here\n$ctx\n$lines[$ctx_ln - 1]\n");
+                               }
+                       }
+               }
+
+# Check relative indent for conditionals and blocks.
+               if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
+                       my ($s, $c) = ($stat, $cond);
+
+                       substr($s, 0, length($c), '');
+
+                       # Make sure we remove the line prefixes as we have
+                       # none on the first line, and are going to readd them
+                       # where necessary.
+                       $s =~ s/\n./\n/gs;
+
+                       # Find out how long the conditional actually is.
+                       my @newlines = ($c =~ /\n/gs);
+                       my $cond_lines = 1 + $#newlines;
+
+                       # We want to check the first line inside the block
+                       # starting at the end of the conditional, so remove:
+                       #  1) any blank line termination
+                       #  2) any opening brace { on end of the line
+                       #  3) any do (...) {
+                       my $continuation = 0;
+                       my $check = 0;
+                       $s =~ s/^.*\bdo\b//;
+                       $s =~ s/^\s*{//;
+                       if ($s =~ s/^\s*\\//) {
+                               $continuation = 1;
+                       }
+                       if ($s =~ s/^\s*?\n//) {
+                               $check = 1;
+                               $cond_lines++;
+                       }
+
+                       # Also ignore a loop construct at the end of a
+                       # preprocessor statement.
+                       if (($prevline =~ /^.\s*#\s*define\s/ ||
+                           $prevline =~ /\\\s*$/) && $continuation == 0) {
+                               $check = 0;
+                       }
+
+                       my $cond_ptr = -1;
+                       $continuation = 0;
+                       while ($cond_ptr != $cond_lines) {
+                               $cond_ptr = $cond_lines;
+
+                               # If we see an #else/#elif then the code
+                               # is not linear.
+                               if ($s =~ /^\s*\#\s*(?:else|elif)/) {
+                                       $check = 0;
+                               }
+
+                               # Ignore:
+                               #  1) blank lines, they should be at 0,
+                               #  2) preprocessor lines, and
+                               #  3) labels.
+                               if ($continuation ||
+                                   $s =~ /^\s*?\n/ ||
+                                   $s =~ /^\s*#\s*?/ ||
+                                   $s =~ /^\s*$Ident\s*:/) {
+                                       $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0;
+                                       if ($s =~ s/^.*?\n//) {
+                                               $cond_lines++;
+                                       }
+                               }
+                       }
+
+                       my (undef, $sindent) = line_stats("+" . $s);
+                       my $stat_real = raw_line($linenr, $cond_lines);
+
+                       # Check if either of these lines are modified, else
+                       # this is not this patch's fault.
+                       if (!defined($stat_real) ||
+                           $stat !~ /^\+/ && $stat_real !~ /^\+/) {
+                               $check = 0;
+                       }
+                       if (defined($stat_real) && $cond_lines > 1) {
+                               $stat_real = "[...]\n$stat_real";
+                       }
+
+                       #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";
+
+                       if ($check && (($sindent % 8) != 0 ||
+                           ($sindent <= $indent && $s ne ''))) {
+                               WARN("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");
+                       }
+               }
+
+               # Track the 'values' across context and added lines.
+               my $opline = $line; $opline =~ s/^./ /;
+               my ($curr_values, $curr_vars) =
+                               annotate_values($opline . "\n", $prev_values);
+               $curr_values = $prev_values . $curr_values;
+               if ($dbg_values) {
+                       my $outline = $opline; $outline =~ s/\t/ /g;
+                       print "$linenr > .$outline\n";
+                       print "$linenr > $curr_values\n";
+                       print "$linenr >  $curr_vars\n";
+               }
+               $prev_values = substr($curr_values, -1);
+
+#ignore lines not being added
+               if ($line=~/^[^\+]/) {next;}
+
+# TEST: allow direct testing of the type matcher.
+               if ($dbg_type) {
+                       if ($line =~ /^.\s*$Declare\s*$/) {
+                               ERROR("TEST: is type\n" . $herecurr);
+                       } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) {
+                               ERROR("TEST: is not type ($1 is)\n". $herecurr);
+                       }
+                       next;
+               }
+# TEST: allow direct testing of the attribute matcher.
+               if ($dbg_attr) {
+                       if ($line =~ /^.\s*$Modifier\s*$/) {
+                               ERROR("TEST: is attr\n" . $herecurr);
+                       } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) {
+                               ERROR("TEST: is not attr ($1 is)\n". $herecurr);
+                       }
+                       next;
+               }
+
+# check for initialisation to aggregates open brace on the next line
+               if ($line =~ /^.\s*{/ &&
+                   $prevline =~ /(?:^|[^=])=\s*$/) {
+                       ERROR("that open brace { should be on the previous line\n" . $hereprev);
+               }
+
+#
+# Checks which are anchored on the added line.
+#
+
+# check for malformed paths in #include statements (uses RAW line)
+               if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) {
+                       my $path = $1;
+                       if ($path =~ m{//}) {
+                               ERROR("malformed #include filename\n" .
+                                       $herecurr);
+                       }
+               }
+
+# no C99 // comments
+               if ($line =~ m{//}) {
+                       ERROR("do not use C99 // comments\n" . $herecurr);
+               }
+               # Remove C99 comments.
+               $line =~ s@//.*@@;
+               $opline =~ s@//.*@@;
+
+# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider
+# the whole statement.
+#print "APW <$lines[$realline_next - 1]>\n";
+               if (defined $realline_next &&
+                   exists $lines[$realline_next - 1] &&
+                   !defined $suppress_export{$realline_next} &&
+                   ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
+                    $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
+                       my $name = $1;
+                       if ($stat !~ /(?:
+                               \n.}\s*$|
+                               ^.DEFINE_$Ident\(\Q$name\E\)|
+                               ^.DECLARE_$Ident\(\Q$name\E\)|
+                               ^.LIST_HEAD\(\Q$name\E\)|
+                               ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
+                               \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\()
+                           )/x) {
+#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n";
+                               $suppress_export{$realline_next} = 2;
+                       } else {
+                               $suppress_export{$realline_next} = 1;
+                       }
+               }
+               if (!defined $suppress_export{$linenr} &&
+                   $prevline =~ /^.\s*$/ &&
+                   ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
+                    $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
+#print "FOO B <$lines[$linenr - 1]>\n";
+                       $suppress_export{$linenr} = 2;
+               }
+               if (defined $suppress_export{$linenr} &&
+                   $suppress_export{$linenr} == 2) {
+                       WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr);
+               }
+
+# check for external initialisers.
+               if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) {
+                       ERROR("do not initialise externals to 0 or NULL\n" .
+                               $herecurr);
+               }
+# check for static initialisers.
+               if ($line =~ /\bstatic\s.*=\s*(0|NULL|false)\s*;/) {
+                       ERROR("do not initialise statics to 0 or NULL\n" .
+                               $herecurr);
+               }
+
+# check for new typedefs, only function parameters and sparse annotations
+# make sense.
+               if ($line =~ /\btypedef\s/ &&
+                   $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ &&
+                   $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
+                   $line !~ /\b$typeTypedefs\b/ &&
+                   $line !~ /\b__bitwise(?:__|)\b/) {
+                       WARN("do not add new typedefs\n" . $herecurr);
+               }
+
+# * goes on variable not on type
+               # (char*[ const])
+               if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) {
+                       my ($from, $to) = ($1, $1);
+
+                       # Should start with a space.
+                       $to =~ s/^(\S)/ $1/;
+                       # Should not end with a space.
+                       $to =~ s/\s+$//;
+                       # '*'s should not have spaces between.
+                       while ($to =~ s/\*\s+\*/\*\*/) {
+                       }
+
+                       #print "from<$from> to<$to>\n";
+                       if ($from ne $to) {
+                               ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" .  $herecurr);
+                       }
+               } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) {
+                       my ($from, $to, $ident) = ($1, $1, $2);
+
+                       # Should start with a space.
+                       $to =~ s/^(\S)/ $1/;
+                       # Should not end with a space.
+                       $to =~ s/\s+$//;
+                       # '*'s should not have spaces between.
+                       while ($to =~ s/\*\s+\*/\*\*/) {
+                       }
+                       # Modifiers should have spaces.
+                       $to =~ s/(\b$Modifier$)/$1 /;
+
+                       #print "from<$from> to<$to> ident<$ident>\n";
+                       if ($from ne $to && $ident !~ /^$Modifier$/) {
+                               ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" .  $herecurr);
+                       }
+               }
+
+# # no BUG() or BUG_ON()
+#              if ($line =~ /\b(BUG|BUG_ON)\b/) {
+#                      print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n";
+#                      print "$herecurr";
+#                      $clean = 0;
+#              }
+
+               if ($line =~ /\bLINUX_VERSION_CODE\b/) {
+                       WARN("LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr);
+               }
+
+# printk should use KERN_* levels.  Note that follow on printk's on the
+# same line do not need a level, so we use the current block context
+# to try and find and validate the current printk.  In summary the current
+# printk includes all preceeding printk's which have no newline on the end.
+# we assume the first bad printk is the one to report.
+               if ($line =~ /\bprintk\((?!KERN_)\s*"/) {
+                       my $ok = 0;
+                       for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) {
+                               #print "CHECK<$lines[$ln - 1]\n";
+                               # we have a preceeding printk if it ends
+                               # with "\n" ignore it, else it is to blame
+                               if ($lines[$ln - 1] =~ m{\bprintk\(}) {
+                                       if ($rawlines[$ln - 1] !~ m{\\n"}) {
+                                               $ok = 1;
+                                       }
+                                       last;
+                               }
+                       }
+                       if ($ok == 0) {
+                               WARN("printk() should include KERN_ facility level\n" . $herecurr);
+                       }
+               }
+
+# function brace can't be on same line, except for #defines of do while,
+# or if closed on same line
+               if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
+                   !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
+                       ERROR("open brace '{' following function declarations go on the next line\n" . $herecurr);
+               }
+
+# open braces for enum, union and struct go on the same line.
+               if ($line =~ /^.\s*{/ &&
+                   $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) {
+                       ERROR("open brace '{' following $1 go on the same line\n" . $hereprev);
+               }
+
+# check for spacing round square brackets; allowed:
+#  1. with a type on the left -- int [] a;
+#  2. at the beginning of a line for slice initialisers -- [0...10] = 5,
+#  3. inside a curly brace -- = { [0...10] = 5 }
+               while ($line =~ /(.*?\s)\[/g) {
+                       my ($where, $prefix) = ($-[1], $1);
+                       if ($prefix !~ /$Type\s+$/ &&
+                           ($where != 0 || $prefix !~ /^.\s+$/) &&
+                           $prefix !~ /{\s+$/) {
+                               ERROR("space prohibited before open square bracket '['\n" . $herecurr);
+                       }
+               }
+
+# check for spaces between functions and their parentheses.
+               while ($line =~ /($Ident)\s+\(/g) {
+                       my $name = $1;
+                       my $ctx_before = substr($line, 0, $-[1]);
+                       my $ctx = "$ctx_before$name";
+
+                       # Ignore those directives where spaces _are_ permitted.
+                       if ($name =~ /^(?:
+                               if|for|while|switch|return|case|
+                               volatile|__volatile__|
+                               __attribute__|format|__extension__|
+                               asm|__asm__)$/x)
+                       {
+
+                       # cpp #define statements have non-optional spaces, ie
+                       # if there is a space between the name and the open
+                       # parenthesis it is simply not a parameter group.
+                       } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) {
+
+                       # cpp #elif statement condition may start with a (
+                       } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) {
+
+                       # If this whole things ends with a type its most
+                       # likely a typedef for a function.
+                       } elsif ($ctx =~ /$Type$/) {
+
+                       } else {
+                               WARN("space prohibited between function name and open parenthesis '('\n" . $herecurr);
+                       }
+               }
+# Check operator spacing.
+               if (!($line=~/\#\s*include/)) {
+                       my $ops = qr{
+                               <<=|>>=|<=|>=|==|!=|
+                               \+=|-=|\*=|\/=|%=|\^=|\|=|&=|
+                               =>|->|<<|>>|<|>|=|!|~|
+                               &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%|
+                               \?|:
+                       }x;
+                       my @elements = split(/($ops|;)/, $opline);
+                       my $off = 0;
+
+                       my $blank = copy_spacing($opline);
+
+                       for (my $n = 0; $n < $#elements; $n += 2) {
+                               $off += length($elements[$n]);
+
+                               # Pick up the preceeding and succeeding characters.
+                               my $ca = substr($opline, 0, $off);
+                               my $cc = '';
+                               if (length($opline) >= ($off + length($elements[$n + 1]))) {
+                                       $cc = substr($opline, $off + length($elements[$n + 1]));
+                               }
+                               my $cb = "$ca$;$cc";
+
+                               my $a = '';
+                               $a = 'V' if ($elements[$n] ne '');
+                               $a = 'W' if ($elements[$n] =~ /\s$/);
+                               $a = 'C' if ($elements[$n] =~ /$;$/);
+                               $a = 'B' if ($elements[$n] =~ /(\[|\()$/);
+                               $a = 'O' if ($elements[$n] eq '');
+                               $a = 'E' if ($ca =~ /^\s*$/);
+
+                               my $op = $elements[$n + 1];
+
+                               my $c = '';
+                               if (defined $elements[$n + 2]) {
+                                       $c = 'V' if ($elements[$n + 2] ne '');
+                                       $c = 'W' if ($elements[$n + 2] =~ /^\s/);
+                                       $c = 'C' if ($elements[$n + 2] =~ /^$;/);
+                                       $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/);
+                                       $c = 'O' if ($elements[$n + 2] eq '');
+                                       $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/);
+                               } else {
+                                       $c = 'E';
+                               }
+
+                               my $ctx = "${a}x${c}";
+
+                               my $at = "(ctx:$ctx)";
+
+                               my $ptr = substr($blank, 0, $off) . "^";
+                               my $hereptr = "$hereline$ptr\n";
+
+                               # Pull out the value of this operator.
+                               my $op_type = substr($curr_values, $off + 1, 1);
+
+                               # Get the full operator variant.
+                               my $opv = $op . substr($curr_vars, $off, 1);
+
+                               # Ignore operators passed as parameters.
+                               if ($op_type ne 'V' &&
+                                   $ca =~ /\s$/ && $cc =~ /^\s*,/) {
+
+#                              # Ignore comments
+#                              } elsif ($op =~ /^$;+$/) {
+
+                               # ; should have either the end of line or a space or \ after it
+                               } elsif ($op eq ';') {
+                                       if ($ctx !~ /.x[WEBC]/ &&
+                                           $cc !~ /^\\/ && $cc !~ /^;/) {
+                                               ERROR("space required after that '$op' $at\n" . $hereptr);
+                                       }
+
+                               # // is a comment
+                               } elsif ($op eq '//') {
+
+                               # No spaces for:
+                               #   ->
+                               #   :   when part of a bitfield
+                               } elsif ($op eq '->' || $opv eq ':B') {
+                                       if ($ctx =~ /Wx.|.xW/) {
+                                               ERROR("spaces prohibited around that '$op' $at\n" . $hereptr);
+                                       }
+
+                               # , must have a space on the right.
+                               } elsif ($op eq ',') {
+                                       if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) {
+                                               ERROR("space required after that '$op' $at\n" . $hereptr);
+                                       }
+
+                               # '*' as part of a type definition -- reported already.
+                               } elsif ($opv eq '*_') {
+                                       #warn "'*' is part of type\n";
+
+                               # unary operators should have a space before and
+                               # none after.  May be left adjacent to another
+                               # unary operator, or a cast
+                               } elsif ($op eq '!' || $op eq '~' ||
+                                        $opv eq '*U' || $opv eq '-U' ||
+                                        $opv eq '&U' || $opv eq '&&U') {
+                                       if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
+                                               ERROR("space required before that '$op' $at\n" . $hereptr);
+                                       }
+                                       if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
+                                               # A unary '*' may be const
+
+                                       } elsif ($ctx =~ /.xW/) {
+                                               ERROR("space prohibited after that '$op' $at\n" . $hereptr);
+                                       }
+
+                               # unary ++ and unary -- are allowed no space on one side.
+                               } elsif ($op eq '++' or $op eq '--') {
+                                       if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) {
+                                               ERROR("space required one side of that '$op' $at\n" . $hereptr);
+                                       }
+                                       if ($ctx =~ /Wx[BE]/ ||
+                                           ($ctx =~ /Wx./ && $cc =~ /^;/)) {
+                                               ERROR("space prohibited before that '$op' $at\n" . $hereptr);
+                                       }
+                                       if ($ctx =~ /ExW/) {
+                                               ERROR("space prohibited after that '$op' $at\n" . $hereptr);
+                                       }
+
+
+                               # << and >> may either have or not have spaces both sides
+                               } elsif ($op eq '<<' or $op eq '>>' or
+                                        $op eq '&' or $op eq '^' or $op eq '|' or
+                                        $op eq '+' or $op eq '-' or
+                                        $op eq '*' or $op eq '/' or
+                                        $op eq '%')
+                               {
+                                       if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) {
+                                               ERROR("need consistent spacing around '$op' $at\n" .
+                                                       $hereptr);
+                                       }
+
+                               # A colon needs no spaces before when it is
+                               # terminating a case value or a label.
+                               } elsif ($opv eq ':C' || $opv eq ':L') {
+                                       if ($ctx =~ /Wx./) {
+                                               ERROR("space prohibited before that '$op' $at\n" . $hereptr);
+                                       }
+
+                               # All the others need spaces both sides.
+                               } elsif ($ctx !~ /[EWC]x[CWE]/) {
+                                       my $ok = 0;
+
+                                       # Ignore email addresses <foo@bar>
+                                       if (($op eq '<' &&
+                                            $cc =~ /^\S+\@\S+>/) ||
+                                           ($op eq '>' &&
+                                            $ca =~ /<\S+\@\S+$/))
+                                       {
+                                               $ok = 1;
+                                       }
+
+                                       # Ignore ?:
+                                       if (($opv eq ':O' && $ca =~ /\?$/) ||
+                                           ($op eq '?' && $cc =~ /^:/)) {
+                                               $ok = 1;
+                                       }
+
+                                       if ($ok == 0) {
+                                               ERROR("spaces required around that '$op' $at\n" . $hereptr);
+                                       }
+                               }
+                               $off += length($elements[$n + 1]);
+                       }
+               }
+
+# check for multiple assignments
+               if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) {
+                       CHK("multiple assignments should be avoided\n" . $herecurr);
+               }
+
+## # check for multiple declarations, allowing for a function declaration
+## # continuation.
+##             if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ &&
+##                 $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) {
+##
+##                     # Remove any bracketed sections to ensure we do not
+##                     # falsly report the parameters of functions.
+##                     my $ln = $line;
+##                     while ($ln =~ s/\([^\(\)]*\)//g) {
+##                     }
+##                     if ($ln =~ /,/) {
+##                             WARN("declaring multiple variables together should be avoided\n" . $herecurr);
+##                     }
+##             }
+
+#need space before brace following if, while, etc
+               if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
+                   $line =~ /do{/) {
+                       ERROR("space required before the open brace '{'\n" . $herecurr);
+               }
+
+# closing brace should have a space following it when it has anything
+# on the line
+               if ($line =~ /}(?!(?:,|;|\)))\S/) {
+                       ERROR("space required after that close brace '}'\n" . $herecurr);
+               }
+
+# check spacing on square brackets
+               if ($line =~ /\[\s/ && $line !~ /\[\s*$/) {
+                       ERROR("space prohibited after that open square bracket '['\n" . $herecurr);
+               }
+               if ($line =~ /\s\]/) {
+                       ERROR("space prohibited before that close square bracket ']'\n" . $herecurr);
+               }
+
+# check spacing on parentheses
+               if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ &&
+                   $line !~ /for\s*\(\s+;/) {
+                       ERROR("space prohibited after that open parenthesis '('\n" . $herecurr);
+               }
+               if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ &&
+                   $line !~ /for\s*\(.*;\s+\)/ &&
+                   $line !~ /:\s+\)/) {
+                       ERROR("space prohibited before that close parenthesis ')'\n" . $herecurr);
+               }
+
+#goto labels aren't indented, allow a single space however
+               if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and
+                  !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) {
+                       WARN("labels should not be indented\n" . $herecurr);
+               }
+
+# Return is not a function.
+               if (defined($stat) && $stat =~ /^.\s*return(\s*)(\(.*);/s) {
+                       my $spacing = $1;
+                       my $value = $2;
+
+                       # Flatten any parentheses
+                       $value =~ s/\)\(/\) \(/g;
+                       while ($value =~ s/\[[^\{\}]*\]/1/ ||
+                              $value !~ /(?:$Ident|-?$Constant)\s*
+                                            $Compare\s*
+                                            (?:$Ident|-?$Constant)/x &&
+                              $value =~ s/\([^\(\)]*\)/1/) {
+                       }
+
+                       if ($value =~ /^(?:$Ident|-?$Constant)$/) {
+                               ERROR("return is not a function, parentheses are not required\n" . $herecurr);
+
+                       } elsif ($spacing !~ /\s+/) {
+                               ERROR("space required before the open parenthesis '('\n" . $herecurr);
+                       }
+               }
+
+# Need a space before open parenthesis after if, while etc
+               if ($line=~/\b(if|while|for|switch)\(/) {
+                       ERROR("space required before the open parenthesis '('\n" . $herecurr);
+               }
+
+# Check for illegal assignment in if conditional -- and check for trailing
+# statements after the conditional.
+               if ($line =~ /do\s*(?!{)/) {
+                       my ($stat_next) = ctx_statement_block($line_nr_next,
+                                               $remain_next, $off_next);
+                       $stat_next =~ s/\n./\n /g;
+                       ##print "stat<$stat> stat_next<$stat_next>\n";
+
+                       if ($stat_next =~ /^\s*while\b/) {
+                               # If the statement carries leading newlines,
+                               # then count those as offsets.
+                               my ($whitespace) =
+                                       ($stat_next =~ /^((?:\s*\n[+-])*\s*)/s);
+                               my $offset =
+                                       statement_rawlines($whitespace) - 1;
+
+                               $suppress_whiletrailers{$line_nr_next +
+                                                               $offset} = 1;
+                       }
+               }
+               if (!defined $suppress_whiletrailers{$linenr} &&
+                   $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) {
+                       my ($s, $c) = ($stat, $cond);
+
+                       if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) {
+                               ERROR("do not use assignment in if condition\n" . $herecurr);
+                       }
+
+                       # Find out what is on the end of the line after the
+                       # conditional.
+                       substr($s, 0, length($c), '');
+                       $s =~ s/\n.*//g;
+                       $s =~ s/$;//g;  # Remove any comments
+                       if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ &&
+                           $c !~ /}\s*while\s*/)
+                       {
+                               # Find out how long the conditional actually is.
+                               my @newlines = ($c =~ /\n/gs);
+                               my $cond_lines = 1 + $#newlines;
+                               my $stat_real = '';
+
+                               $stat_real = raw_line($linenr, $cond_lines)
+                                                       . "\n" if ($cond_lines);
+                               if (defined($stat_real) && $cond_lines > 1) {
+                                       $stat_real = "[...]\n$stat_real";
+                               }
+
+                               ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real);
+                       }
+               }
+
+# Check for bitwise tests written as boolean
+               if ($line =~ /
+                       (?:
+                               (?:\[|\(|\&\&|\|\|)
+                               \s*0[xX][0-9]+\s*
+                               (?:\&\&|\|\|)
+                       |
+                               (?:\&\&|\|\|)
+                               \s*0[xX][0-9]+\s*
+                               (?:\&\&|\|\||\)|\])
+                       )/x)
+               {
+                       WARN("boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr);
+               }
+
+# if and else should not have general statements after it
+               if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) {
+                       my $s = $1;
+                       $s =~ s/$;//g;  # Remove any comments
+                       if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) {
+                               ERROR("trailing statements should be on next line\n" . $herecurr);
+                       }
+               }
+# if should not continue a brace
+               if ($line =~ /}\s*if\b/) {
+                       ERROR("trailing statements should be on next line\n" .
+                               $herecurr);
+               }
+# case and default should not have general statements after them
+               if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g &&
+                   $line !~ /\G(?:
+                       (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$|
+                       \s*return\s+
+                   )/xg)
+               {
+                       ERROR("trailing statements should be on next line\n" . $herecurr);
+               }
+
+               # Check for }<nl>else {, these must be at the same
+               # indent level to be relevant to each other.
+               if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ and
+                                               $previndent == $indent) {
+                       ERROR("else should follow close brace '}'\n" . $hereprev);
+               }
+
+               if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ and
+                                               $previndent == $indent) {
+                       my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0);
+
+                       # Find out what is on the end of the line after the
+                       # conditional.
+                       substr($s, 0, length($c), '');
+                       $s =~ s/\n.*//g;
+
+                       if ($s =~ /^\s*;/) {
+                               ERROR("while should follow close brace '}'\n" . $hereprev);
+                       }
+               }
+
+#studly caps, commented out until figure out how to distinguish between use of existing and adding new
+#              if (($line=~/[\w_][a-z\d]+[A-Z]/) and !($line=~/print/)) {
+#                  print "No studly caps, use _\n";
+#                  print "$herecurr";
+#                  $clean = 0;
+#              }
+
+#no spaces allowed after \ in define
+               if ($line=~/\#\s*define.*\\\s$/) {
+                       WARN("Whitepspace after \\ makes next lines useless\n" . $herecurr);
+               }
+
+#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
+               if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) {
+                       my $file = "$1.h";
+                       my $checkfile = "include/linux/$file";
+                       if (-f "$root/$checkfile" &&
+                           $realfile ne $checkfile &&
+                           $1 ne 'irq')
+                       {
+                               if ($realfile =~ m{^arch/}) {
+                                       CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
+                               } else {
+                                       WARN("Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
+                               }
+                       }
+               }
+
+# multi-statement macros should be enclosed in a do while loop, grab the
+# first statement and ensure its the whole macro if its not enclosed
+# in a known good container
+               if ($realfile !~ m@/vmlinux.lds.h$@ &&
+                   $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
+                       my $ln = $linenr;
+                       my $cnt = $realcnt;
+                       my ($off, $dstat, $dcond, $rest);
+                       my $ctx = '';
+
+                       my $args = defined($1);
+
+                       # Find the end of the macro and limit our statement
+                       # search to that.
+                       while ($cnt > 0 && defined $lines[$ln - 1] &&
+                               $lines[$ln - 1] =~ /^(?:-|..*\\$)/)
+                       {
+                               $ctx .= $rawlines[$ln - 1] . "\n";
+                               $cnt-- if ($lines[$ln - 1] !~ /^-/);
+                               $ln++;
+                       }
+                       $ctx .= $rawlines[$ln - 1];
+
+                       ($dstat, $dcond, $ln, $cnt, $off) =
+                               ctx_statement_block($linenr, $ln - $linenr + 1, 0);
+                       #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n";
+                       #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n";
+
+                       # Extract the remainder of the define (if any) and
+                       # rip off surrounding spaces, and trailing \'s.
+                       $rest = '';
+                       while ($off != 0 || ($cnt > 0 && $rest =~ /\\\s*$/)) {
+                               #print "ADDING cnt<$cnt> $off <" . substr($lines[$ln - 1], $off) . "> rest<$rest>\n";
+                               if ($off != 0 || $lines[$ln - 1] !~ /^-/) {
+                                       $rest .= substr($lines[$ln - 1], $off) . "\n";
+                                       $cnt--;
+                               }
+                               $ln++;
+                               $off = 0;
+                       }
+                       $rest =~ s/\\\n.//g;
+                       $rest =~ s/^\s*//s;
+                       $rest =~ s/\s*$//s;
+
+                       # Clean up the original statement.
+                       if ($args) {
+                               substr($dstat, 0, length($dcond), '');
+                       } else {
+                               $dstat =~ s/^.\s*\#\s*define\s+$Ident\s*//;
+                       }
+                       $dstat =~ s/$;//g;
+                       $dstat =~ s/\\\n.//g;
+                       $dstat =~ s/^\s*//s;
+                       $dstat =~ s/\s*$//s;
+
+                       # Flatten any parentheses and braces
+                       while ($dstat =~ s/\([^\(\)]*\)/1/ ||
+                              $dstat =~ s/\{[^\{\}]*\}/1/ ||
+                              $dstat =~ s/\[[^\{\}]*\]/1/)
+                       {
+                       }
+
+                       my $exceptions = qr{
+                               $Declare|
+                               module_param_named|
+                               MODULE_PARAM_DESC|
+                               DECLARE_PER_CPU|
+                               DEFINE_PER_CPU|
+                               __typeof__\(|
+                               union|
+                               struct|
+                               \.$Ident\s*=\s*|
+                               ^\"|\"$
+                       }x;
+                       #print "REST<$rest> dstat<$dstat>\n";
+                       if ($rest ne '') {
+                               if ($rest !~ /while\s*\(/ &&
+                                   $dstat !~ /$exceptions/)
+                               {
+                                       ERROR("Macros with multiple statements should be enclosed in a do - while loop\n" . "$here\n$ctx\n");
+                               }
+
+                       } elsif ($ctx !~ /;/) {
+                               if ($dstat ne '' &&
+                                   $dstat !~ /^(?:$Ident|-?$Constant)$/ &&
+                                   $dstat !~ /$exceptions/ &&
+                                   $dstat !~ /^\.$Ident\s*=/ &&
+                                   $dstat =~ /$Operators/)
+                               {
+                                       ERROR("Macros with complex values should be enclosed in parenthesis\n" . "$here\n$ctx\n");
+                               }
+                       }
+               }
+
+# make sure symbols are always wrapped with VMLINUX_SYMBOL() ...
+# all assignments may have only one of the following with an assignment:
+#      .
+#      ALIGN(...)
+#      VMLINUX_SYMBOL(...)
+               if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) {
+                       WARN("vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr);
+               }
+
+# check for redundant bracing round if etc
+               if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) {
+                       my ($level, $endln, @chunks) =
+                               ctx_statement_full($linenr, $realcnt, 1);
+                       #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n";
+                       #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n";
+                       if ($#chunks > 0 && $level == 0) {
+                               my $allowed = 0;
+                               my $seen = 0;
+                               my $herectx = $here . "\n";
+                               my $ln = $linenr - 1;
+                               for my $chunk (@chunks) {
+                                       my ($cond, $block) = @{$chunk};
+
+                                       # If the condition carries leading newlines, then count those as offsets.
+                                       my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s);
+                                       my $offset = statement_rawlines($whitespace) - 1;
+
+                                       #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n";
+
+                                       # We have looked at and allowed this specific line.
+                                       $suppress_ifbraces{$ln + $offset} = 1;
+
+                                       $herectx .= "$rawlines[$ln + $offset]\n[...]\n";
+                                       $ln += statement_rawlines($block) - 1;
+
+                                       substr($block, 0, length($cond), '');
+
+                                       $seen++ if ($block =~ /^\s*{/);
+
+                                       #print "cond<$cond> block<$block> allowed<$allowed>\n";
+                                       if (statement_lines($cond) > 1) {
+                                               #print "APW: ALLOWED: cond<$cond>\n";
+                                               $allowed = 1;
+                                       }
+                                       if ($block =~/\b(?:if|for|while)\b/) {
+                                               #print "APW: ALLOWED: block<$block>\n";
+                                               $allowed = 1;
+                                       }
+                                       if (statement_block_size($block) > 1) {
+                                               #print "APW: ALLOWED: lines block<$block>\n";
+                                               $allowed = 1;
+                                       }
+                               }
+                               if ($seen && !$allowed) {
+                                       WARN("braces {} are not necessary for any arm of this statement\n" . $herectx);
+                               }
+                       }
+               }
+               if (!defined $suppress_ifbraces{$linenr - 1} &&
+                                       $line =~ /\b(if|while|for|else)\b/) {
+                       my $allowed = 0;
+
+                       # Check the pre-context.
+                       if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
+                               #print "APW: ALLOWED: pre<$1>\n";
+                               $allowed = 1;
+                       }
+
+                       my ($level, $endln, @chunks) =
+                               ctx_statement_full($linenr, $realcnt, $-[0]);
+
+                       # Check the condition.
+                       my ($cond, $block) = @{$chunks[0]};
+                       #print "CHECKING<$linenr> cond<$cond> block<$block>\n";
+                       if (defined $cond) {
+                               substr($block, 0, length($cond), '');
+                       }
+                       if (statement_lines($cond) > 1) {
+                               #print "APW: ALLOWED: cond<$cond>\n";
+                               $allowed = 1;
+                       }
+                       if ($block =~/\b(?:if|for|while)\b/) {
+                               #print "APW: ALLOWED: block<$block>\n";
+                               $allowed = 1;
+                       }
+                       if (statement_block_size($block) > 1) {
+                               #print "APW: ALLOWED: lines block<$block>\n";
+                               $allowed = 1;
+                       }
+                       # Check the post-context.
+                       if (defined $chunks[1]) {
+                               my ($cond, $block) = @{$chunks[1]};
+                               if (defined $cond) {
+                                       substr($block, 0, length($cond), '');
+                               }
+                               if ($block =~ /^\s*\{/) {
+                                       #print "APW: ALLOWED: chunk-1 block<$block>\n";
+                                       $allowed = 1;
+                               }
+                       }
+                       if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) {
+                               my $herectx = $here . "\n";;
+                               my $cnt = statement_rawlines($block);
+
+                               for (my $n = 0; $n < $cnt; $n++) {
+                                       $herectx .= raw_line($linenr, $n) . "\n";;
+                               }
+
+                               WARN("braces {} are not necessary for single statement blocks\n" . $herectx);
+                       }
+               }
+
+# don't include deprecated include files (uses RAW line)
+               for my $inc (@dep_includes) {
+                       if ($rawline =~ m@^.\s*\#\s*include\s*\<$inc>@) {
+                               ERROR("Don't use <$inc>: see Documentation/feature-removal-schedule.txt\n" . $herecurr);
+                       }
+               }
+
+# don't use deprecated functions
+               for my $func (@dep_functions) {
+                       if ($line =~ /\b$func\b/) {
+                               ERROR("Don't use $func(): see Documentation/feature-removal-schedule.txt\n" . $herecurr);
+                       }
+               }
+
+# no volatiles please
+               my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b};
+               if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {
+                       WARN("Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt\n" . $herecurr);
+               }
+
+# SPIN_LOCK_UNLOCKED & RW_LOCK_UNLOCKED are deprecated
+               if ($line =~ /\b(SPIN_LOCK_UNLOCKED|RW_LOCK_UNLOCKED)/) {
+                       ERROR("Use of $1 is deprecated: see Documentation/spinlocks.txt\n" . $herecurr);
+               }
+
+# warn about #if 0
+               if ($line =~ /^.\s*\#\s*if\s+0\b/) {
+                       CHK("if this code is redundant consider removing it\n" .
+                               $herecurr);
+               }
+
+# check for needless kfree() checks
+               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
+                       my $expr = $1;
+                       if ($line =~ /\bkfree\(\Q$expr\E\);/) {
+                               WARN("kfree(NULL) is safe this check is probably not required\n" . $hereprev);
+                       }
+               }
+# check for needless usb_free_urb() checks
+               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
+                       my $expr = $1;
+                       if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
+                               WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev);
+                       }
+               }
+
+# warn about #ifdefs in C files
+#              if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
+#                      print "#ifdef in C files should be avoided\n";
+#                      print "$herecurr";
+#                      $clean = 0;
+#              }
+
+# warn about spacing in #ifdefs
+               if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) {
+                       ERROR("exactly one space required after that #$1\n" . $herecurr);
+               }
+
+# check for spinlock_t definitions without a comment.
+               if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ ||
+                   $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) {
+                       my $which = $1;
+                       if (!ctx_has_comment($first_line, $linenr)) {
+                               CHK("$1 definition without comment\n" . $herecurr);
+                       }
+               }
+# check for memory barriers without a comment.
+               if ($line =~ /\b(mb|rmb|wmb|read_barrier_depends|smp_mb|smp_rmb|smp_wmb|smp_read_barrier_depends)\(/) {
+                       if (!ctx_has_comment($first_line, $linenr)) {
+                               CHK("memory barrier without comment\n" . $herecurr);
+                       }
+               }
+# check of hardware specific defines
+               if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
+                       CHK("architecture specific defines should be avoided\n" .  $herecurr);
+               }
+
+# Check that the storage class is at the beginning of a declaration
+               if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
+                       WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
+               }
+
+# check the location of the inline attribute, that it is between
+# storage class and type.
+               if ($line =~ /\b$Type\s+$Inline\b/ ||
+                   $line =~ /\b$Inline\s+$Storage\b/) {
+                       ERROR("inline keyword should sit between storage class and type\n" . $herecurr);
+               }
+
+# Check for __inline__ and __inline, prefer inline
+               if ($line =~ /\b(__inline__|__inline)\b/) {
+                       WARN("plain inline is preferred over $1\n" . $herecurr);
+               }
+
+# check for sizeof(&)
+               if ($line =~ /\bsizeof\s*\(\s*\&/) {
+                       WARN("sizeof(& should be avoided\n" . $herecurr);
+               }
+
+# check for new externs in .c files.
+               if ($realfile =~ /\.c$/ && defined $stat &&
+                   $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
+               {
+                       my $function_name = $1;
+                       my $paren_space = $2;
+
+                       my $s = $stat;
+                       if (defined $cond) {
+                               substr($s, 0, length($cond), '');
+                       }
+                       if ($s =~ /^\s*;/ &&
+                           $function_name ne 'uninitialized_var')
+                       {
+                               WARN("externs should be avoided in .c files\n" .  $herecurr);
+                       }
+
+                       if ($paren_space =~ /\n/) {
+                               WARN("arguments for function declarations should follow identifier\n" . $herecurr);
+                       }
+
+               } elsif ($realfile =~ /\.c$/ && defined $stat &&
+                   $stat =~ /^.\s*extern\s+/)
+               {
+                       WARN("externs should be avoided in .c files\n" .  $herecurr);
+               }
+
+# checks for new __setup's
+               if ($rawline =~ /\b__setup\("([^"]*)"/) {
+                       my $name = $1;
+
+                       if (!grep(/$name/, @setup_docs)) {
+                               CHK("__setup appears un-documented -- check Documentation/kernel-parameters.txt\n" . $herecurr);
+                       }
+               }
+
+# check for pointless casting of kmalloc return
+               if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) {
+                       WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
+               }
+
+# check for gcc specific __FUNCTION__
+               if ($line =~ /__FUNCTION__/) {
+                       WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
+               }
+
+# check for semaphores used as mutexes
+               if ($line =~ /^.\s*(DECLARE_MUTEX|init_MUTEX)\s*\(/) {
+                       WARN("mutexes are preferred for single holder semaphores\n" . $herecurr);
+               }
+# check for semaphores used as mutexes
+               if ($line =~ /^.\s*init_MUTEX_LOCKED\s*\(/) {
+                       WARN("consider using a completion\n" . $herecurr);
+
+               }
+# recommend strict_strto* over simple_strto*
+               if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
+                       WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr);
+               }
+# check for __initcall(), use device_initcall() explicitly please
+               if ($line =~ /^.\s*__initcall\s*\(/) {
+                       WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
+               }
+# check for various ops structs, ensure they are const.
+               my $struct_ops = qr{acpi_dock_ops|
+                               address_space_operations|
+                               backlight_ops|
+                               block_device_operations|
+                               dentry_operations|
+                               dev_pm_ops|
+                               dma_map_ops|
+                               extent_io_ops|
+                               file_lock_operations|
+                               file_operations|
+                               hv_ops|
+                               ide_dma_ops|
+                               intel_dvo_dev_ops|
+                               item_operations|
+                               iwl_ops|
+                               kgdb_arch|
+                               kgdb_io|
+                               kset_uevent_ops|
+                               lock_manager_operations|
+                               microcode_ops|
+                               mtrr_ops|
+                               neigh_ops|
+                               nlmsvc_binding|
+                               pci_raw_ops|
+                               pipe_buf_operations|
+                               platform_hibernation_ops|
+                               platform_suspend_ops|
+                               proto_ops|
+                               rpc_pipe_ops|
+                               seq_operations|
+                               snd_ac97_build_ops|
+                               soc_pcmcia_socket_ops|
+                               stacktrace_ops|
+                               sysfs_ops|
+                               tty_operations|
+                               usb_mon_operations|
+                               wd_ops}x;
+               if ($line !~ /\bconst\b/ &&
+                   $line =~ /\bstruct\s+($struct_ops)\b/) {
+                       WARN("struct $1 should normally be const\n" .
+                               $herecurr);
+               }
+
+# use of NR_CPUS is usually wrong
+# ignore definitions of NR_CPUS and usage to define arrays as likely right
+               if ($line =~ /\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ &&
+                   $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ &&
+                   $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ &&
+                   $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/)
+               {
+                       WARN("usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr);
+               }
+
+# check for %L{u,d,i} in strings
+               my $string;
+               while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) {
+                       $string = substr($rawline, $-[1], $+[1] - $-[1]);
+                       $string =~ s/%%/__/g;
+                       if ($string =~ /(?<!%)%L[udi]/) {
+                               WARN("\%Ld/%Lu are not-standard C, use %lld/%llu\n" . $herecurr);
+                               last;
+                       }
+               }
+
+# whine mightly about in_atomic
+               if ($line =~ /\bin_atomic\s*\(/) {
+                       if ($realfile =~ m@^drivers/@) {
+                               ERROR("do not use in_atomic in drivers\n" . $herecurr);
+                       } elsif ($realfile !~ m@^kernel/@) {
+                               WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
+                       }
+               }
+
+# check for lockdep_set_novalidate_class
+               if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ ||
+                   $line =~ /__lockdep_no_validate__\s*\)/ ) {
+                       if ($realfile !~ m@^kernel/lockdep@ &&
+                           $realfile !~ m@^include/linux/lockdep@ &&
+                           $realfile !~ m@^drivers/base/core@) {
+                               ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
+                       }
+               }
+       }
+
+       # If we have no input at all, then there is nothing to report on
+       # so just keep quiet.
+       if ($#rawlines == -1) {
+               exit(0);
+       }
+
+       # In mailback mode only produce a report in the negative, for
+       # things that appear to be patches.
+       if ($mailback && ($clean == 1 || !$is_patch)) {
+               exit(0);
+       }
+
+       # This is not a patch, and we are are in 'no-patch' mode so
+       # just keep quiet.
+       if (!$chk_patch && !$is_patch) {
+               exit(0);
+       }
+
+       if (!$is_patch) {
+               ERROR("Does not appear to be a unified-diff format patch\n");
+       }
+       if ($is_patch && $chk_signoff && $signoff == 0) {
+               ERROR("Missing Signed-off-by: line(s)\n");
+       }
+
+       print report_dump();
+       if ($summary && !($clean == 1 && $quiet == 1)) {
+               print "$filename " if ($summary_file);
+               print "total: $cnt_error errors, $cnt_warn warnings, " .
+                       (($check)? "$cnt_chk checks, " : "") .
+                       "$cnt_lines lines checked\n";
+               print "\n" if ($quiet == 0);
+       }
+
+       if ($clean == 1 && $quiet == 0) {
+               print "$vname has no obvious style problems and is ready for submission.\n"
+       }
+       if ($clean == 0 && $quiet == 0) {
+               print "$vname has style problems, please review.  If any of these errors\n";
+               print "are false positives report them to the maintainer, see\n";
+               print "CHECKPATCH in MAINTAINERS.\n";
+       }
+
+       return $clean;
+}
diff --git a/www/Makefile.am b/www/Makefile.am
new file mode 100644 (file)
index 0000000..5734f7b
--- /dev/null
@@ -0,0 +1,4 @@
+defaultwwwdir = $(pkgdatadir)/www
+defaultwww_DATA = js/jquery.min.js js/ppastats.js js/jqplot.dateAxisRenderer.min.js js/jquery.jqplot.min.js css/ppastats.css css/jquery.jqplot.min.css
+
+EXTRA_DIST=$(defaultwww_DATA)
diff --git a/www/Makefile.in b/www/Makefile.in
new file mode 100644 (file)
index 0000000..9b5ce9a
--- /dev/null
@@ -0,0 +1,375 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = www
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(defaultwwwdir)"
+DATA = $(defaultwww_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+HELP2MAN = @HELP2MAN@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CFLAGS = @JSON_CFLAGS@
+JSON_LIBS = @JSON_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XMKMF = @XMKMF@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+defaultwwwdir = $(pkgdatadir)/www
+defaultwww_DATA = js/jquery.min.js js/ppastats.js js/jqplot.dateAxisRenderer.min.js js/jquery.jqplot.min.js css/ppastats.css css/jquery.jqplot.min.css
+EXTRA_DIST = $(defaultwww_DATA)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu www/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu www/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-defaultwwwDATA: $(defaultwww_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(defaultwwwdir)" || $(MKDIR_P) "$(DESTDIR)$(defaultwwwdir)"
+       @list='$(defaultwww_DATA)'; test -n "$(defaultwwwdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(defaultwwwdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(defaultwwwdir)" || exit $$?; \
+       done
+
+uninstall-defaultwwwDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(defaultwww_DATA)'; test -n "$(defaultwwwdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(defaultwwwdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(defaultwwwdir)" && rm -f $$files
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+       for dir in "$(DESTDIR)$(defaultwwwdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-defaultwwwDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-defaultwwwDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+       distclean-generic distdir dvi dvi-am html html-am info info-am \
+       install install-am install-data install-data-am \
+       install-defaultwwwDATA install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+       pdf-am ps ps-am uninstall uninstall-am \
+       uninstall-defaultwwwDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/www/css/jquery.jqplot.min.css b/www/css/jquery.jqplot.min.css
new file mode 100644 (file)
index 0000000..d1b2fef
--- /dev/null
@@ -0,0 +1 @@
+.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em;}.jqplot-axis{font-size:.75em;}.jqplot-xaxis{margin-top:10px;}.jqplot-x2axis{margin-bottom:10px;}.jqplot-yaxis{margin-right:10px;}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis{margin-left:10px;margin-right:10px;}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{position:absolute;}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top;}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom;}.jqplot-yaxis-tick{right:0;top:15px;text-align:right;}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em;}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left;}.jqplot-meterGauge-tick{font-size:.75em;color:#999;}.jqplot-meterGauge-label{font-size:1em;color:#999;}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute;}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute;}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute;}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;position:absolute;}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px;}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em;}td.jqplot-table-legend{vertical-align:middle;}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer;}td.jqplot-table-legend>div{border:1px solid #ccc;padding:1px;}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid;}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em;}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px;}.jqplot-highlighter-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px;}.jqplot-point-label{font-size:.75em;z-index:2;}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center;}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em;}.jqplot-error{text-align:center;}.jqplot-error-message{position:relative;top:46%;display:inline-block;}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%);}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7);}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3);}
\ No newline at end of file
diff --git a/www/css/ppastats.css b/www/css/ppastats.css
new file mode 100644 (file)
index 0000000..1d3f636
--- /dev/null
@@ -0,0 +1,35 @@
+body {
+    padding: 1em 1em 1em 1em;
+    font-family: "Ubuntu", sans-serif;
+    color: #000;
+    background-color: #fff;
+}
+
+em {
+    font-weight: bold;
+    font-style: normal;
+}
+
+a {
+    color: #1982D1;
+    font-style: normal;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+#chart {
+    float: right;
+    width: 80%;
+    margin: 0 0 0 0;
+    padding: 0 0 0 0;
+    font-size: 0.75em;
+}
+
+#versions {
+    width: 20%;
+    float: left;
+}
+
diff --git a/www/js/jqplot.dateAxisRenderer.min.js b/www/js/jqplot.dateAxisRenderer.min.js
new file mode 100644 (file)
index 0000000..e60846a
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.0b2_r792
+ *
+ * Copyright (c) 2009-2011 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects 
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL 
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can 
+ * choose the license that best suits your project and use it accordingly. 
+ *
+ * Although not required, the author would appreciate an email letting him 
+ * know of any substantial use of jqPlot.  You can reach the author at: 
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ *     version 2007.04.27
+ *     author Ash Searle
+ *     http://hexmen.com/blog/2007/03/printf-sprintf/
+ *     http://hexmen.com/js/sprintf.js
+ *     The author (Ash Searle) has placed this code in the public domain:
+ *     "This code is unrestricted: you are free to use it however you like."
+ * 
+ */
+(function(a){a.jqplot.DateAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this);this.date=new a.jsDate()};a.jqplot.DateAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.DateAxisRenderer.prototype.constructor=a.jqplot.DateAxisRenderer;a.jqplot.DateTickFormatter=function(b,c){if(!b){b="%Y/%m/%d"}return a.jsDate.strftime(c,b)};a.jqplot.DateAxisRenderer.prototype.init=function(t){this.tickOptions.formatter=a.jqplot.DateTickFormatter;this.daTickInterval=null;this._daTickInterval=null;a.extend(true,this,t);var q=this._dataBounds,g,k,r,l,o,m,b;for(var f=0;f<this._series.length;f++){g={intervals:[],frequencies:{},sortedIntervals:[],min:null,max:null,mean:null};k=0;r=this._series[f];l=r.data;o=r._plotData;m=r._stackData;b=0;for(var e=0;e<l.length;e++){if(this.name=="xaxis"||this.name=="x2axis"){l[e][0]=new a.jsDate(l[e][0]).getTime();o[e][0]=new a.jsDate(l[e][0]).getTime();m[e][0]=new a.jsDate(l[e][0]).getTime();if((l[e][0]!=null&&l[e][0]<q.min)||q.min==null){q.min=l[e][0]}if((l[e][0]!=null&&l[e][0]>q.max)||q.max==null){q.max=l[e][0]}if(e>0){b=Math.abs(l[e][0]-l[e-1][0]);g.intervals.push(b);if(g.frequencies.hasOwnProperty(b)){g.frequencies[b]+=1}else{g.frequencies[b]=1}}k+=b}else{l[e][1]=new a.jsDate(l[e][1]).getTime();o[e][1]=new a.jsDate(l[e][1]).getTime();m[e][1]=new a.jsDate(l[e][1]).getTime();if((l[e][1]!=null&&l[e][1]<q.min)||q.min==null){q.min=l[e][1]}if((l[e][1]!=null&&l[e][1]>q.max)||q.max==null){q.max=l[e][1]}if(e>0){b=Math.abs(l[e][1]-l[e-1][1]);g.intervals.push(b);if(g.frequencies.hasOwnProperty(b)){g.frequencies[b]+=1}else{g.frequencies[b]=1}}}k+=b}var p=0,h=0;for(var c in g.frequencies){g.sortedIntervals.push({interval:c,frequency:g.frequencies[c]})}g.sortedIntervals.sort(function(i,d){return d.frequency-i.frequency});g.min=a.jqplot.arrayMin(g.intervals);g.max=a.jqplot.arrayMax(g.intervals);g.mean=k/l.length;this._intervalStats.push(g);g=k=r=l=o=m=null}q=null};a.jqplot.DateAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks;this.daTickInterval=this._daTickInterval};a.jqplot.DateAxisRenderer.prototype.createTicks=function(){var z=this._ticks;var w=this.ticks;var B=this.name;var y=this._dataBounds;var e=this._intervalStats;var q,x;var o,s;var d,c;var b,u;o=((this.min!=null)?new a.jsDate(this.min).getTime():y.min);s=((this.max!=null)?new a.jsDate(this.max).getTime():y.max);var k=s-o;if(w.length){for(u=0;u<w.length;u++){var g=w[u];var j=new this.tickRenderer(this.tickOptions);if(g.constructor==Array){j.value=new a.jsDate(g[0]).getTime();j.label=g[1];if(!this.showTicks){j.showLabel=false;j.showMark=false}else{if(!this.showTickMarks){j.showMark=false}}j.setTick(j.value,this.name);this._ticks.push(j)}else{j.value=new a.jsDate(g).getTime();if(!this.showTicks){j.showLabel=false;j.showMark=false}else{if(!this.showTickMarks){j.showMark=false}}j.setTick(j.value,this.name);this._ticks.push(j)}}this.numberTicks=w.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.daTickInterval=[(this.max-this.min)/(this.numberTicks-1)/1000,"seconds"]}else{if(this.tickInterval==null&&this.min==null&&this.max==null&&this.numberTicks==null){var A=a.jqplot.LinearTickGenerator(o,s);var n=o+k*(this.padMin-1);var r=s-k*(this.padMax-1);if(o<=n||s>=r){n=o-k*(this.padMin-1);r=s+k*(this.padMax-1);A=a.jqplot.LinearTickGenerator(n,r)}this.min=A[0];this.max=A[1];this.numberTicks=A[2];this.tickInterval=A[4];this.daTickInterval=[this.tickInterval/1000,"seconds"];for(var u=0;u<this.numberTicks;u++){var o=new a.jsDate(this.min);b=o.add(u*this.daTickInterval[0],this.daTickInterval[1]).getTime();var j=new this.tickRenderer(this.tickOptions);if(!this.showTicks){j.showLabel=false;j.showMark=false}else{if(!this.showTickMarks){j.showMark=false}}j.setTick(b,this.name);this._ticks.push(j)}}else{if(B=="xaxis"||B=="x2axis"){q=this._plotDimensions.width}else{q=this._plotDimensions.height}if(this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}if(this.tickInterval!=null){if(Number(this.tickInterval)){this.daTickInterval=[Number(this.tickInterval),"seconds"]}else{if(typeof this.tickInterval=="string"){var l=this.tickInterval.split(" ");if(l.length==1){this.daTickInterval=[1,l[0]]}else{if(l.length==2){this.daTickInterval=[l[0],l[1]]}}}}}if(o==s){var h=24*60*60*500;o-=h;s+=h}k=s-o;var v=2+parseInt(Math.max(0,q-100)/100,10);var m,p;m=(this.min!=null)?new a.jsDate(this.min).getTime():o-k/2*(this.padMin-1);p=(this.max!=null)?new a.jsDate(this.max).getTime():s+k/2*(this.padMax-1);this.min=m;this.max=p;k=this.max-this.min;if(this.numberTicks==null){if(this.daTickInterval!=null){var f=new a.jsDate(this.max).diff(this.min,this.daTickInterval[1],true);this.numberTicks=Math.ceil(f/this.daTickInterval[0])+1;this.max=new a.jsDate(this.min).add((this.numberTicks-1)*this.daTickInterval[0],this.daTickInterval[1]).getTime()}else{if(q>200){this.numberTicks=parseInt(3+(q-200)/100,10)}else{this.numberTicks=2}}}if(this.daTickInterval==null){this.daTickInterval=[k/(this.numberTicks-1)/1000,"seconds"]}for(var u=0;u<this.numberTicks;u++){var o=new a.jsDate(this.min);b=o.add(u*this.daTickInterval[0],this.daTickInterval[1]).getTime();var j=new this.tickRenderer(this.tickOptions);if(!this.showTicks){j.showLabel=false;j.showMark=false}else{if(!this.showTickMarks){j.showMark=false}}j.setTick(b,this.name);this._ticks.push(j)}}}if(this._daTickInterval==null){this._daTickInterval=this.daTickInterval}}})(jQuery);
\ No newline at end of file
diff --git a/www/js/jquery.jqplot.min.js b/www/js/jquery.jqplot.min.js
new file mode 100644 (file)
index 0000000..56dc881
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * jqPlot
+ * Pure JavaScript plotting plugin using jQuery
+ *
+ * Version: 1.0.0b2_r792
+ *
+ * Copyright (c) 2009-2011 Chris Leonello
+ * jqPlot is currently available for use in all personal or commercial projects 
+ * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL 
+ * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can 
+ * choose the license that best suits your project and use it accordingly. 
+ *
+ * Although not required, the author would appreciate an email letting him 
+ * know of any substantial use of jqPlot.  You can reach the author at: 
+ * chris at jqplot dot com or see http://www.jqplot.com/info.php .
+ *
+ * If you are feeling kind and generous, consider supporting the project by
+ * making a donation at: http://www.jqplot.com/donate.php .
+ *
+ * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
+ *
+ *     version 2007.04.27
+ *     author Ash Searle
+ *     http://hexmen.com/blog/2007/03/printf-sprintf/
+ *     http://hexmen.com/js/sprintf.js
+ *     The author (Ash Searle) has placed this code in the public domain:
+ *     "This code is unrestricted: you are free to use it however you like."
+ * 
+ */
+(function(w){var l;w.fn.emptyForce=function(){for(var O=0,P;(P=w(this)[O])!=null;O++){if(P.nodeType===1){jQuery.cleanData(P.getElementsByTagName("*"))}if(w.jqplot_use_excanvas){P.outerHTML=""}else{while(P.firstChild){P.removeChild(P.firstChild)}}P=null}return w(this)};w.fn.removeChildForce=function(O){while(O.firstChild){this.removeChildForce(O.firstChild);O.removeChild(O.firstChild)}};w.jqplot=function(U,R,P){var Q,O;if(P==null){if(jQuery.isArray(R)){Q=R;O=null}else{if(typeof(R)==="object"){Q=null;O=R}}}else{Q=R;O=P}var T=new C();w("#"+U).removeClass("jqplot-error");if(w.jqplot.config.catchErrors){try{T.init(U,Q,O);T.draw();T.themeEngine.init.call(T);return T}catch(S){var V=w.jqplot.config.errorMessage||S.message;w("#"+U).append('<div class="jqplot-error-message">'+V+"</div>");w("#"+U).addClass("jqplot-error");document.getElementById(U).style.background=w.jqplot.config.errorBackground;document.getElementById(U).style.border=w.jqplot.config.errorBorder;document.getElementById(U).style.fontFamily=w.jqplot.config.errorFontFamily;document.getElementById(U).style.fontSize=w.jqplot.config.errorFontSize;document.getElementById(U).style.fontStyle=w.jqplot.config.errorFontStyle;document.getElementById(U).style.fontWeight=w.jqplot.config.errorFontWeight}}else{T.init(U,Q,O);T.draw();T.themeEngine.init.call(T);return T}};w.jqplot.version="1.0.0b2_r792";w.jqplot.CanvasManager=function(){if(typeof w.jqplot.CanvasManager.canvases=="undefined"){w.jqplot.CanvasManager.canvases=[];w.jqplot.CanvasManager.free=[]}var O=[];this.getCanvas=function(){var R;var Q=true;if(!w.jqplot.use_excanvas){for(var S=0,P=w.jqplot.CanvasManager.canvases.length;S<P;S++){if(w.jqplot.CanvasManager.free[S]===true){Q=false;R=w.jqplot.CanvasManager.canvases[S];w.jqplot.CanvasManager.free[S]=false;O.push(S);break}}}if(Q){R=document.createElement("canvas");O.push(w.jqplot.CanvasManager.canvases.length);w.jqplot.CanvasManager.canvases.push(R);w.jqplot.CanvasManager.free.push(false)}return R};this.initCanvas=function(P){if(w.jqplot.use_excanvas){return window.G_vmlCanvasManager.initElement(P)}return P};this.freeAllCanvases=function(){for(var Q=0,P=O.length;Q<P;Q++){this.freeCanvas(O[Q])}O=[]};this.freeCanvas=function(P){if(w.jqplot.use_excanvas){window.G_vmlCanvasManager.uninitElement(w.jqplot.CanvasManager.canvases[P]);w.jqplot.CanvasManager.canvases[P]=null}else{var Q=w.jqplot.CanvasManager.canvases[P];Q.getContext("2d").clearRect(0,0,Q.width,Q.height);w(Q).unbind().removeAttr("class").removeAttr("style");w(Q).css({left:"",top:"",position:""});Q.width=0;Q.height=0;w.jqplot.CanvasManager.free[P]=true}}};w.jqplot.log=function(){if(window.console){console.log.apply(console,arguments)}};w.jqplot.config={enablePlugins:false,defaultHeight:300,defaultWidth:400,UTCAdjust:false,timezoneOffset:new Date(new Date().getTimezoneOffset()*60000),errorMessage:"",errorBackground:"",errorBorder:"",errorFontFamily:"",errorFontSize:"",errorFontStyle:"",errorFontWeight:"",catchErrors:false,defaultTickFormatString:"%.1f",defaultColors:["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"],defaultNegativeColors:["#498991","#C08840","#9F9274","#546D61","#646C4A","#6F6621","#6E3F5F","#4F64B0","#A89050","#C45923","#187399","#945381","#959E5C","#C7AF7B","#478396","#907294"]};w.jqplot.arrayMax=function(O){return Math.max.apply(Math,O)};w.jqplot.arrayMin=function(O){return Math.min.apply(Math,O)};w.jqplot.enablePlugins=w.jqplot.config.enablePlugins;w.jqplot.support_canvas=function(){if(typeof w.jqplot.support_canvas.result=="undefined"){w.jqplot.support_canvas.result=!!document.createElement("canvas").getContext}return w.jqplot.support_canvas.result};w.jqplot.support_canvas_text=function(){if(typeof w.jqplot.support_canvas_text.result=="undefined"){w.jqplot.support_canvas_text.result=!!(document.createElement("canvas").getContext&&typeof document.createElement("canvas").getContext("2d").fillText=="function")}return w.jqplot.support_canvas_text.result};w.jqplot.use_excanvas=(w.browser.msie&&!w.jqplot.support_canvas())?true:false;w.jqplot.preInitHooks=[];w.jqplot.postInitHooks=[];w.jqplot.preParseOptionsHooks=[];w.jqplot.postParseOptionsHooks=[];w.jqplot.preDrawHooks=[];w.jqplot.postDrawHooks=[];w.jqplot.preDrawSeriesHooks=[];w.jqplot.postDrawSeriesHooks=[];w.jqplot.preDrawLegendHooks=[];w.jqplot.addLegendRowHooks=[];w.jqplot.preSeriesInitHooks=[];w.jqplot.postSeriesInitHooks=[];w.jqplot.preParseSeriesOptionsHooks=[];w.jqplot.postParseSeriesOptionsHooks=[];w.jqplot.eventListenerHooks=[];w.jqplot.preDrawSeriesShadowHooks=[];w.jqplot.postDrawSeriesShadowHooks=[];w.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};w.jqplot.ElemContainer.prototype.createElement=function(R,T,P,Q,U){this._offsets=T;var O=P||"jqplot";var S=document.createElement(R);this._elem=w(S);this._elem.addClass(O);this._elem.css(Q);this._elem.attr(U);S=null;return this._elem};w.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};w.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};w.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};w.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};w.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};w.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};w.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function m(O){w.jqplot.ElemContainer.call(this);this.name=O;this._series=[];this.show=false;this.tickRenderer=w.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=w.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=w.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this._dataBounds={min:null,max:null};this._intervalStats=[];this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null;this._options={}}m.prototype=new w.jqplot.ElemContainer();m.prototype.constructor=m;m.prototype.init=function(){this.renderer=new this.renderer();this.tickOptions.axis=this.name;if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTicks}if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTickMarks}if(this.tickOptions.showLabel==null){this.tickOptions.showLabel=this.showTicks}if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};m.prototype.draw=function(O,P){if(this.__ticks){this.__ticks=null}return this.renderer.draw.call(this,O,P)};m.prototype.set=function(){this.renderer.set.call(this)};m.prototype.pack=function(P,O){if(this.show){this.renderer.pack.call(this,P,O)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};m.prototype.reset=function(){this.renderer.reset.call(this)};m.prototype.resetScale=function(O){w.extend(true,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},O);this.resetDataBounds()};m.prototype.resetDataBounds=function(){var O=this._dataBounds;O.min=null;O.max=null;var R=(this.show)?true:false;for(var Q=0;Q<this._series.length;Q++){var S=this._series[Q];var V=S._plotData;var T=1,U=1;if(S._type!=null&&S._type=="ohlc"){T=3;U=2}for(var P=0;P<V.length;P++){if(this.name=="xaxis"||this.name=="x2axis"){if((V[P][0]!=null&&V[P][0]<O.min)||O.min==null){O.min=V[P][0]}if((V[P][0]!=null&&V[P][0]>O.max)||O.max==null){O.max=V[P][0]}}else{if((V[P][T]!=null&&V[P][T]<O.min)||O.min==null){O.min=V[P][T]}if((V[P][U]!=null&&V[P][U]>O.max)||O.max==null){O.max=V[P][U]}}}if(R&&S.renderer.constructor!==w.jqplot.BarRenderer){R=false}else{if(R&&this._options.hasOwnProperty("forceTickAt0")&&this._options.forceTickAt0==false){R=false}else{if(R&&S.renderer.constructor===w.jqplot.BarRenderer){if(S.barDirection=="vertical"&&this.name!="xaxis"&&this.name!="x2axis"){if(this._options.pad!=null||this._options.padMin!=null){R=false}}else{if(S.barDirection=="horizontal"&&(this.name=="xaxis"||this.name=="x2axis")){if(this._options.pad!=null||this._options.padMin!=null){R=false}}}}}}}if(R&&this.renderer.constructor===w.jqplot.LinearAxisRenderer&&O.min>=0){this.padMin=1;this.forceTickAt0=true}};function h(O){w.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.labels=[];this.showLabels=true;this.showSwatches=true;this.placement="insideGrid";this.xoffset=0;this.yoffset=0;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=w.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.marginTop=null;this.marginRight=null;this.marginBottom=null;this.marginLeft=null;this.escapeHtml=false;this._series=[];w.extend(true,this,O)}h.prototype=new w.jqplot.ElemContainer();h.prototype.constructor=h;h.prototype.setOptions=function(O){w.extend(true,this,O);if(this.placement=="inside"){this.placement="insideGrid"}if(this.xoffset>0){if(this.placement=="insideGrid"){switch(this.location){case"nw":case"w":case"sw":if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break;case"ne":case"e":case"se":default:if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break}}else{if(this.placement=="outside"){switch(this.location){case"nw":case"w":case"sw":if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break;case"ne":case"e":case"se":default:if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break}}}this.xoffset=0}if(this.yoffset>0){if(this.placement=="outside"){switch(this.location){case"sw":case"s":case"se":if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break;case"ne":case"n":case"nw":default:if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break}}else{if(this.placement=="insideGrid"){switch(this.location){case"sw":case"s":case"se":if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break;case"ne":case"n":case"nw":default:if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break}}}this.yoffset=0}};h.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};h.prototype.draw=function(P){for(var O=0;O<w.jqplot.preDrawLegendHooks.length;O++){w.jqplot.preDrawLegendHooks[O].call(this,P)}return this.renderer.draw.call(this,P)};h.prototype.pack=function(O){this.renderer.pack.call(this,O)};function n(O){w.jqplot.ElemContainer.call(this);this.text=O;this.show=true;this.fontFamily;this.fontSize;this.textAlign;this.textColor;this.renderer=w.jqplot.DivTitleRenderer;this.rendererOptions={}}n.prototype=new w.jqplot.ElemContainer();n.prototype.constructor=n;n.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};n.prototype.draw=function(O){return this.renderer.draw.call(this,O)};n.prototype.pack=function(){this.renderer.pack.call(this)};function D(){w.jqplot.ElemContainer.call(this);this.show=true;this.xaxis="xaxis";this._xaxis;this.yaxis="yaxis";this._yaxis;this.gridBorderWidth=2;this.renderer=w.jqplot.LineRenderer;this.rendererOptions={};this.data=[];this.gridData=[];this.label="";this.showLabel=true;this.color;this.lineWidth=2.5;this.lineJoin="round";this.lineCap="round";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.25;this.shadowDepth=3;this.shadowAlpha="0.1";this.breakOnNull=false;this.markerRenderer=w.jqplot.MarkerRenderer;this.markerOptions={};this.showLine=true;this.showMarker=true;this.index;this.fill=false;this.fillColor;this.fillAlpha;this.fillAndStroke=false;this.disableStack=false;this._stack=false;this.neighborThreshold=4;this.fillToZero=false;this.fillToValue=0;this.fillAxis="y";this.useNegativeColors=true;this._stackData=[];this._plotData=[];this._plotValues={x:[],y:[]};this._intervals={x:{},y:{}};this._prevPlotData=[];this._prevGridData=[];this._stackAxis="y";this._primaryAxis="_xaxis";this.canvas=new w.jqplot.GenericCanvas();this.shadowCanvas=new w.jqplot.GenericCanvas();this.plugins={};this._sumy=0;this._sumx=0;this._type=""}D.prototype=new w.jqplot.ElemContainer();D.prototype.constructor=D;D.prototype.init=function(Q,U,S){this.index=Q;this.gridBorderWidth=U;var T=this.data;var P=[],R;for(R=0;R<T.length;R++){if(!this.breakOnNull){if(T[R]==null||T[R][0]==null||T[R][1]==null){continue}else{P.push(T[R])}}else{P.push(T[R])}}this.data=P;if(!this.fillColor){this.fillColor=this.color}if(this.fillAlpha){var O=w.jqplot.normalize2rgb(this.fillColor);var O=w.jqplot.getColorComponents(O);this.fillColor="rgba("+O[0]+","+O[1]+","+O[2]+","+this.fillAlpha+")"}this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions,S);this.markerRenderer=new this.markerRenderer();if(!this.markerOptions.color){this.markerOptions.color=this.color}if(this.markerOptions.show==null){this.markerOptions.show=this.showMarker}this.showMarker=this.markerOptions.show;this.markerRenderer.init(this.markerOptions)};D.prototype.draw=function(U,R,T){var P=(R==l)?{}:R;U=(U==l)?this.canvas._ctx:U;var O,S,Q;for(O=0;O<w.jqplot.preDrawSeriesHooks.length;O++){w.jqplot.preDrawSeriesHooks[O].call(this,U,P)}if(this.show){this.renderer.setGridData.call(this,T);if(!P.preventJqPlotSeriesDrawTrigger){w(U.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData])}S=[];if(P.data){S=P.data}else{if(!this._stack){S=this.data}else{S=this._plotData}}Q=P.gridData||this.renderer.makeGridData.call(this,S,T);this.renderer.draw.call(this,U,Q,P,T)}for(O=0;O<w.jqplot.postDrawSeriesHooks.length;O++){w.jqplot.postDrawSeriesHooks[O].call(this,U,P)}U=R=T=O=S=Q=null};D.prototype.drawShadow=function(U,R,T){var P=(R==l)?{}:R;U=(U==l)?this.shadowCanvas._ctx:U;var O,S,Q;for(O=0;O<w.jqplot.preDrawSeriesShadowHooks.length;O++){w.jqplot.preDrawSeriesShadowHooks[O].call(this,U,P)}if(this.shadow){this.renderer.setGridData.call(this,T);S=[];if(P.data){S=P.data}else{if(!this._stack){S=this.data}else{S=this._plotData}}Q=P.gridData||this.renderer.makeGridData.call(this,S,T);this.renderer.drawShadow.call(this,U,Q,P)}for(O=0;O<w.jqplot.postDrawSeriesShadowHooks.length;O++){w.jqplot.postDrawSeriesShadowHooks[O].call(this,U,P)}U=R=T=O=S=Q=null};D.prototype.toggleDisplay=function(P){var O,Q;if(P.data.series){O=P.data.series}else{O=this}if(P.data.speed){Q=P.data.speed}if(Q){if(O.canvas._elem.is(":hidden")){if(O.shadowCanvas._elem){O.shadowCanvas._elem.fadeIn(Q)}O.canvas._elem.fadeIn(Q);O.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+O.index).fadeIn(Q)}else{if(O.shadowCanvas._elem){O.shadowCanvas._elem.fadeOut(Q)}O.canvas._elem.fadeOut(Q);O.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+O.index).fadeOut(Q)}}else{if(O.canvas._elem.is(":hidden")){if(O.shadowCanvas._elem){O.shadowCanvas._elem.show()}O.canvas._elem.show();O.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+O.index).show()}else{if(O.shadowCanvas._elem){O.shadowCanvas._elem.hide()}O.canvas._elem.hide();O.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+O.index).hide()}}};function x(){w.jqplot.ElemContainer.call(this);this.drawGridlines=true;this.gridLineColor="#cccccc";this.gridLineWidth=1;this.background="#fffdf6";this.borderColor="#999999";this.borderWidth=2;this.drawBorder=true;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.5;this.shadowWidth=3;this.shadowDepth=3;this.shadowColor=null;this.shadowAlpha="0.07";this._left;this._top;this._right;this._bottom;this._width;this._height;this._axes=[];this.renderer=w.jqplot.CanvasGridRenderer;this.rendererOptions={};this._offsets={top:null,bottom:null,left:null,right:null}}x.prototype=new w.jqplot.ElemContainer();x.prototype.constructor=x;x.prototype.init=function(){this.renderer=new this.renderer();this.renderer.init.call(this,this.rendererOptions)};x.prototype.createElement=function(O,P){this._offsets=O;return this.renderer.createElement.call(this,P)};x.prototype.draw=function(){this.renderer.draw.call(this)};w.jqplot.GenericCanvas=function(){w.jqplot.ElemContainer.call(this);this._ctx};w.jqplot.GenericCanvas.prototype=new w.jqplot.ElemContainer();w.jqplot.GenericCanvas.prototype.constructor=w.jqplot.GenericCanvas;w.jqplot.GenericCanvas.prototype.createElement=function(S,Q,P,T){this._offsets=S;var O="jqplot";if(Q!=l){O=Q}var R;R=T.canvasManager.getCanvas();if(P!=null){this._plotDimensions=P}R.width=this._plotDimensions.width-this._offsets.left-this._offsets.right;R.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom;this._elem=w(R);this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top});this._elem.addClass(O);R=T.canvasManager.initCanvas(R);R=null;return this._elem};w.jqplot.GenericCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};w.jqplot.GenericCanvas.prototype.resetCanvas=function(){if(this._elem){if(w.jqplot.use_excanvas){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce()}this._ctx=null};w.jqplot.HooksManager=function(){this.hooks=[]};w.jqplot.HooksManager.prototype.addOnce=function(P){var Q=false,O;for(O=0;O<this.hooks.length;O++){if(this.hooks[O][0]==P){Q=true}}if(!Q){this.hooks.push(P)}};w.jqplot.HooksManager.prototype.add=function(O){this.hooks.push(O)};w.jqplot.EventListenerManager=function(){this.hooks=[]};w.jqplot.EventListenerManager.prototype.addOnce=function(R,Q){var S=false,P,O;for(O=0;O<this.hooks.length;O++){P=this.hooks[O];if(P[0]==R&&P[1]==Q){S=true}}if(!S){this.hooks.push([R,Q])}};w.jqplot.EventListenerManager.prototype.add=function(P,O){this.hooks.push([P,O])};function C(){this.data=[];this.dataRenderer;this.dataRendererOptions;this.noDataIndicator={show:false,indicator:"Loading Data...",axes:{xaxis:{min:0,max:10,tickInterval:2,show:true},yaxis:{min:0,max:12,tickInterval:3,show:true}}};this.targetId=null;this.target=null;this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{}},seriesDefaults:{},series:[]};this.series=[];this.axes={xaxis:new m("xaxis"),yaxis:new m("yaxis"),x2axis:new m("x2axis"),y2axis:new m("y2axis"),y3axis:new m("y3axis"),y4axis:new m("y4axis"),y5axis:new m("y5axis"),y6axis:new m("y6axis"),y7axis:new m("y7axis"),y8axis:new m("y8axis"),y9axis:new m("y9axis")};this.grid=new x();this.legend=new h();this.baseCanvas=new w.jqplot.GenericCanvas();this.seriesStack=[];this.previousSeriesStack=[];this.eventCanvas=new w.jqplot.GenericCanvas();this._width=null;this._height=null;this._plotDimensions={height:null,width:null};this._gridPadding={top:null,right:null,bottom:null,left:null};this._defaultGridPadding={top:10,right:10,bottom:23,left:10};this.syncXTicks=true;this.syncYTicks=true;this.seriesColors=w.jqplot.config.defaultColors;this.negativeSeriesColors=w.jqplot.config.defaultNegativeColors;this.sortData=true;var Q=0;this.textColor;this.fontFamily;this.fontSize;this.title=new n();this.options={};this.stackSeries=false;this.defaultAxisStart=1;this._stackData=[];this._plotData=[];this.plugins={};this._drawCount=0;this.drawIfHidden=false;this.captureRightClick=false;this.themeEngine=new w.jqplot.ThemeEngine();this._sumy=0;this._sumx=0;this.preInitHooks=new w.jqplot.HooksManager();this.postInitHooks=new w.jqplot.HooksManager();this.preParseOptionsHooks=new w.jqplot.HooksManager();this.postParseOptionsHooks=new w.jqplot.HooksManager();this.preDrawHooks=new w.jqplot.HooksManager();this.postDrawHooks=new w.jqplot.HooksManager();this.preDrawSeriesHooks=new w.jqplot.HooksManager();this.postDrawSeriesHooks=new w.jqplot.HooksManager();this.preDrawLegendHooks=new w.jqplot.HooksManager();this.addLegendRowHooks=new w.jqplot.HooksManager();this.preSeriesInitHooks=new w.jqplot.HooksManager();this.postSeriesInitHooks=new w.jqplot.HooksManager();this.preParseSeriesOptionsHooks=new w.jqplot.HooksManager();this.postParseSeriesOptionsHooks=new w.jqplot.HooksManager();this.eventListenerHooks=new w.jqplot.EventListenerManager();this.preDrawSeriesShadowHooks=new w.jqplot.HooksManager();this.postDrawSeriesShadowHooks=new w.jqplot.HooksManager();this.colorGenerator=w.jqplot.ColorGenerator;this.canvasManager=new w.jqplot.CanvasManager();this.init=function(Z,W,ab){ab=ab||{};for(var X=0;X<w.jqplot.preInitHooks.length;X++){w.jqplot.preInitHooks[X].call(this,Z,W,ab)}for(var X=0;X<this.preInitHooks.hooks.length;X++){this.preInitHooks.hooks[X].call(this,Z,W,ab)}this.targetId="#"+Z;this.target=w("#"+Z);this.target.removeClass("jqplot-error");if(!this.target.get(0)){throw"No plot target specified"}if(this.target.css("position")=="static"){this.target.css("position","relative")}if(!this.target.hasClass("jqplot-target")){this.target.addClass("jqplot-target")}if(!this.target.height()){var Y;if(ab&&ab.height){Y=parseInt(ab.height,10)}else{if(this.target.attr("data-height")){Y=parseInt(this.target.attr("data-height"),10)}else{Y=parseInt(w.jqplot.config.defaultHeight,10)}}this._height=Y;this.target.css("height",Y+"px")}else{this._height=Y=this.target.height()}if(!this.target.width()){var aa;if(ab&&ab.width){aa=parseInt(ab.width,10)}else{if(this.target.attr("data-width")){aa=parseInt(this.target.attr("data-width"),10)}else{aa=parseInt(w.jqplot.config.defaultWidth,10)}}this._width=aa;this.target.css("width",aa+"px")}else{this._width=aa=this.target.width()}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;if(this._height<=0||this._width<=0||!this._height||!this._width){throw"Canvas dimension not set"}if(ab.dataRenderer&&jQuery.isFunction(ab.dataRenderer)){if(ab.dataRendererOptions){this.dataRendererOptions=ab.dataRendererOptions}this.dataRenderer=ab.dataRenderer;W=this.dataRenderer(W,this,this.dataRendererOptions)}if(ab.noDataIndicator&&jQuery.isPlainObject(ab.noDataIndicator)){w.extend(true,this.noDataIndicator,ab.noDataIndicator)}if(W==null||jQuery.isArray(W)==false||W.length==0||jQuery.isArray(W[0])==false||W[0].length==0){if(this.noDataIndicator.show==false){throw {name:"DataError",message:"No data to plot."}}else{for(var S in this.noDataIndicator.axes){for(var U in this.noDataIndicator.axes[S]){this.axes[S][U]=this.noDataIndicator.axes[S][U]}}this.postDrawHooks.add(function(){var ah=this.eventCanvas.getHeight();var ae=this.eventCanvas.getWidth();var ad=w('<div class="jqplot-noData-container" style="position:absolute;"></div>');this.target.append(ad);ad.height(ah);ad.width(ae);ad.css("top",this.eventCanvas._offsets.top);ad.css("left",this.eventCanvas._offsets.left);var ag=w('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');ad.append(ag);ag.html(this.noDataIndicator.indicator);var af=ag.height();var ac=ag.width();ag.height(af);ag.width(ac);ag.css("top",(ah-af)/2+"px")})}}this.data=W;this.parseOptions(ab);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;for(var X=0;X<this.series.length;X++){this.seriesStack.push(X);this.previousSeriesStack.push(X);this.series[X].shadowCanvas._plotDimensions=this._plotDimensions;this.series[X].canvas._plotDimensions=this._plotDimensions;for(var V=0;V<w.jqplot.preSeriesInitHooks.length;V++){w.jqplot.preSeriesInitHooks[V].call(this.series[X],Z,W,this.options.seriesDefaults,this.options.series[X],this)}for(var V=0;V<this.preSeriesInitHooks.hooks.length;V++){this.preSeriesInitHooks.hooks[V].call(this.series[X],Z,W,this.options.seriesDefaults,this.options.series[X],this)}this.populatePlotData(this.series[X],X);this.series[X]._plotDimensions=this._plotDimensions;this.series[X].init(X,this.grid.borderWidth,this);for(var V=0;V<w.jqplot.postSeriesInitHooks.length;V++){w.jqplot.postSeriesInitHooks[V].call(this.series[X],Z,W,this.options.seriesDefaults,this.options.series[X],this)}for(var V=0;V<this.postSeriesInitHooks.hooks.length;V++){this.postSeriesInitHooks.hooks[V].call(this.series[X],Z,W,this.options.seriesDefaults,this.options.series[X],this)}this._sumy+=this.series[X]._sumy;this._sumx+=this.series[X]._sumx}for(var T in this.axes){this.axes[T]._plotDimensions=this._plotDimensions;this.axes[T].init()}if(this.sortData){O(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var X=0;X<w.jqplot.postInitHooks.length;X++){w.jqplot.postInitHooks[X].call(this,Z,W,ab)}for(var X=0;X<this.postInitHooks.hooks.length;X++){this.postInitHooks.hooks[X].call(this,Z,W,ab)}};this.resetAxesScale=function(X,T){var V=T||{};var W=X||this.axes;if(W===true){W=this.axes}if(jQuery.isArray(W)){for(var U=0;U<W.length;U++){this.axes[W[U]].resetScale(V[W[U]])}}else{if(typeof(W)==="object"){for(var S in W){this.axes[S].resetScale(V[S])}}}};this.reInitialize=function(){this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw"Target dimension not set"}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;for(var W in this.axes){this.axes[W]._plotWidth=this._width;this.axes[W]._plotHeight=this._height}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this._sumy=0;this._sumx=0;for(var U=0;U<this.series.length;U++){this.populatePlotData(this.series[U],U);this.series[U]._plotDimensions=this._plotDimensions;this.series[U].canvas._plotDimensions=this._plotDimensions;this._sumy+=this.series[U]._sumy;this._sumx+=this.series[U]._sumx}for(var S in this.axes){var T=this.axes[S]._ticks;for(var U=0;U<T.length;U++){var V=T[U]._elem;if(V){if(w.jqplot.use_excanvas){window.G_vmlCanvasManager.uninitElement(V.get(0))}V.emptyForce();V=null;T._elem=null}}T=null;this.axes[S]._plotDimensions=this._plotDimensions;this.axes[S]._ticks=[];this.axes[S].renderer.init.call(this.axes[S],{})}if(this.sortData){O(this.series)}this.grid._axes=this.axes;this.legend._series=this.series};function O(W){var aa,ab,ac,S,Z;for(var X=0;X<W.length;X++){var T;var Y=[W[X].data,W[X]._stackData,W[X]._plotData,W[X]._prevPlotData];for(var U=0;U<4;U++){T=true;aa=Y[U];if(W[X]._stackAxis=="x"){for(var V=0;V<aa.length;V++){if(typeof(aa[V][1])!="number"){T=false;break}}if(T){aa.sort(function(ae,ad){return ae[1]-ad[1]})}}else{for(var V=0;V<aa.length;V++){if(typeof(aa[V][0])!="number"){T=false;break}}if(T){aa.sort(function(ae,ad){return ae[0]-ad[0]})}}}}}this.populatePlotData=function(W,X){this._plotData=[];this._stackData=[];W._stackData=[];W._plotData=[];var aa={x:[],y:[]};if(this.stackSeries&&!W.disableStack){W._stack=true;var Y=W._stackAxis=="x"?0:1;var Z=Y?0:1;var ab=w.extend(true,[],W.data);var ac=w.extend(true,[],W.data);for(var U=0;U<X;U++){var S=this.series[U].data;for(var T=0;T<S.length;T++){ab[T][0]+=S[T][0];ab[T][1]+=S[T][1];ac[T][Y]+=S[T][Y]}}for(var V=0;V<ac.length;V++){aa.x.push(ac[V][0]);aa.y.push(ac[V][1])}this._plotData.push(ac);this._stackData.push(ab);W._stackData=ab;W._plotData=ac;W._plotValues=aa}else{for(var V=0;V<W.data.length;V++){aa.x.push(W.data[V][0]);aa.y.push(W.data[V][1])}this._stackData.push(W.data);this.series[X]._stackData=W.data;this._plotData.push(W.data);W._plotData=W.data;W._plotValues=aa}if(X>0){W._prevPlotData=this.series[X-1]._plotData}W._sumy=0;W._sumx=0;for(V=W.data.length-1;V>-1;V--){W._sumy+=W.data[V][1];W._sumx+=W.data[V][0]}};this.getNextSeriesColor=(function(T){var S=0;var U=T.seriesColors;return function(){if(S<U.length){return U[S++]}else{S=0;return U[S++]}}})(this);this.parseOptions=function(aa){for(var X=0;X<this.preParseOptionsHooks.hooks.length;X++){this.preParseOptionsHooks.hooks[X].call(this,aa)}for(var X=0;X<w.jqplot.preParseOptionsHooks.length;X++){w.jqplot.preParseOptionsHooks[X].call(this,aa)}this.options=w.extend(true,{},this.defaults,aa);this.stackSeries=this.options.stackSeries;if(this.options.seriesColors){this.seriesColors=this.options.seriesColors}if(this.options.negativeSeriesColors){this.negativeSeriesColors=this.options.negativeSeriesColors}if(this.options.captureRightClick){this.captureRightClick=this.options.captureRightClick}this.defaultAxisStart=(aa&&aa.defaultAxisStart!=null)?aa.defaultAxisStart:this.defaultAxisStart;var S=new this.colorGenerator(this.seriesColors);w.extend(true,this._gridPadding,this.options.gridPadding);this.sortData=(this.options.sortData!=null)?this.options.sortData:this.sortData;for(var T in this.axes){var V=this.axes[T];V._options=w.extend(true,{},this.options.axesDefaults,this.options.axes[T]);w.extend(true,V,this.options.axesDefaults,this.options.axes[T]);V._plotWidth=this._width;V._plotHeight=this._height}var Y=function(ae,ac,af){var ab=[];var ad;ac=ac||"vertical";if(!jQuery.isArray(ae[0])){for(ad=0;ad<ae.length;ad++){if(ac=="vertical"){ab.push([af+ad,ae[ad]])}else{ab.push([ae[ad],af+ad])}}}else{w.extend(true,ab,ae)}return ab};for(var X=0;X<this.data.length;X++){var Z=new D();for(var W=0;W<w.jqplot.preParseSeriesOptionsHooks.length;W++){w.jqplot.preParseSeriesOptionsHooks[W].call(Z,this.options.seriesDefaults,this.options.series[X])}for(var W=0;W<this.preParseSeriesOptionsHooks.hooks.length;W++){this.preParseSeriesOptionsHooks.hooks[W].call(Z,this.options.seriesDefaults,this.options.series[X])}w.extend(true,Z,{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[X]);var U="vertical";if(Z.renderer===w.jqplot.BarRenderer&&Z.rendererOptions&&Z.rendererOptions.barDirection=="horizontal"){U="horizontal"}Z.data=Y(this.data[X],U,this.defaultAxisStart);switch(Z.xaxis){case"xaxis":Z._xaxis=this.axes.xaxis;break;case"x2axis":Z._xaxis=this.axes.x2axis;break;default:break}Z._yaxis=this.axes[Z.yaxis];Z._xaxis._series.push(Z);Z._yaxis._series.push(Z);if(Z.show){Z._xaxis.show=true;Z._yaxis.show=true}if(!Z.color&&Z.show!=false){Z.color=S.next()}if(!Z.label){Z.label="Series "+(X+1).toString()}this.series.push(Z);for(var W=0;W<w.jqplot.postParseSeriesOptionsHooks.length;W++){w.jqplot.postParseSeriesOptionsHooks[W].call(this.series[X],this.options.seriesDefaults,this.options.series[X])}for(var W=0;W<this.postParseSeriesOptionsHooks.hooks.length;W++){this.postParseSeriesOptionsHooks.hooks[W].call(this.series[X],this.options.seriesDefaults,this.options.series[X])}}w.extend(true,this.grid,this.options.grid);for(var T in this.axes){var V=this.axes[T];if(V.borderWidth==null){V.borderWidth=this.grid.borderWidth}if(V.borderColor==null){if(T!="xaxis"&&T!="x2axis"&&V.useSeriesColor===true&&V.show){V.borderColor=V._series[0].color}else{V.borderColor=this.grid.borderColor}}}if(typeof this.options.title=="string"){this.title.text=this.options.title}else{if(typeof this.options.title=="object"){w.extend(true,this.title,this.options.title)}}this.title._plotWidth=this._width;this.legend.setOptions(this.options.legend);for(var X=0;X<w.jqplot.postParseOptionsHooks.length;X++){w.jqplot.postParseOptionsHooks[X].call(this,aa)}for(var X=0;X<this.postParseOptionsHooks.hooks.length;X++){this.postParseOptionsHooks.hooks[X].call(this,aa)}};this.destroy=function(){this.canvasManager.freeAllCanvases();this.target[0].innerHTML=""};this.replot=function(T){var U=T||{};var S=U.clear||true;var V=U.resetAxes||false;this.target.trigger("jqplotPreReplot");if(S){this.canvasManager.freeAllCanvases();if(this._eventCanvas){this.eventCanvas._elem.unbind()}this.target.unbind();this.target.empty()}this.reInitialize();if(V){this.resetAxesScale(V,U.axes)}this.draw();this.target.trigger("jqplotPostReplot")};this.redraw=function(S){S=(S!=null)?S:true;this.target.trigger("jqplotPreRedraw");if(S){this.canvasManager.freeAllCanvases();this.eventCanvas._elem.unbind();this.target.unbind();this.target.empty()}for(var U in this.axes){this.axes[U]._ticks=[]}for(var T=0;T<this.series.length;T++){this.populatePlotData(this.series[T],T)}this._sumy=0;this._sumx=0;for(T=0;T<this.series.length;T++){this._sumy+=this.series[T]._sumy;this._sumx+=this.series[T]._sumx}this.draw();this.target.trigger("jqplotPostRedraw")};this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var Y,X;for(Y=0;Y<w.jqplot.preDrawHooks.length;Y++){w.jqplot.preDrawHooks[Y].call(this)}for(Y=0;Y<this.preDrawHooks.hooks.length;Y++){this.preDrawHooks.hooks[Y].call(this)}this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas",null,this));this.baseCanvas.setContext();this.target.append(this.title.draw());this.title.pack({top:0,left:0});var ad=this.legend.draw();var ac={top:0,left:0,bottom:0,right:0};if(this.legend.placement=="outsideGrid"){this.target.append(ad);switch(this.legend.location){case"n":ac.top+=this.legend.getHeight();break;case"s":ac.bottom+=this.legend.getHeight();break;case"ne":case"e":case"se":ac.right+=this.legend.getWidth();break;case"nw":case"w":case"sw":ac.left+=this.legend.getWidth();break;default:ac.right+=this.legend.getWidth();break}ad=ad.detach()}var S=this.axes;for(var U in S){this.target.append(S[U].draw(this.baseCanvas._ctx,this));S[U].set()}if(S.yaxis.show){ac.left+=S.yaxis.getWidth()}var V=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var T=[0,0,0,0,0,0,0,0];var aa=0;var W;for(W=0;W<8;W++){if(S[V[W]].show){aa+=S[V[W]].getWidth();T[W]=aa}}ac.right+=aa;if(S.x2axis.show){ac.top+=S.x2axis.getHeight()}if(this.title.show){ac.top+=this.title.getHeight()}if(S.xaxis.show){ac.bottom+=S.xaxis.getHeight()}var Z=["top","bottom","left","right"];for(var W in Z){if(this._gridPadding[Z[W]]==null&&ac[Z[W]]>0){this._gridPadding[Z[W]]=ac[Z[W]]}else{if(this._gridPadding[Z[W]]==null){this._gridPadding[Z[W]]=this._defaultGridPadding[Z[W]]}}}var ab=(this.legend.placement=="outsideGrid")?{top:this.title.getHeight(),left:0,right:0,bottom:0}:this._gridPadding;S.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-S.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});S.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-S.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});S.x2axis.pack({position:"absolute",top:this._gridPadding.top-S.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(Y=8;Y>0;Y--){S[V[Y-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-T[Y-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}this.target.append(this.grid.createElement(this._gridPadding,this));this.grid.draw();for(Y=0;Y<this.series.length;Y++){X=this.seriesStack[Y];this.target.append(this.series[X].shadowCanvas.createElement(this._gridPadding,"jqplot-series-shadowCanvas",null,this));this.series[X].shadowCanvas.setContext();this.series[X].shadowCanvas._elem.data("seriesIndex",X)}for(Y=0;Y<this.series.length;Y++){X=this.seriesStack[Y];this.target.append(this.series[X].canvas.createElement(this._gridPadding,"jqplot-series-canvas",null,this));this.series[X].canvas.setContext();this.series[X].canvas._elem.data("seriesIndex",X)}this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas",null,this));this.eventCanvas.setContext();this.eventCanvas._ctx.fillStyle="rgba(0,0,0,0)";this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width,this.eventCanvas._ctx.canvas.height);this.bindCustomEvents();if(this.legend.preDraw){this.eventCanvas._elem.before(ad);this.legend.pack(ab);if(this.legend._elem){this.drawSeries({legendInfo:{location:this.legend.location,placement:this.legend.placement,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}})}else{this.drawSeries()}}else{this.drawSeries();if(this.series.length){w(this.series[this.series.length-1].canvas._elem).after(ad)}this.legend.pack(ab)}for(var Y=0;Y<w.jqplot.eventListenerHooks.length;Y++){this.eventCanvas._elem.bind(w.jqplot.eventListenerHooks[Y][0],{plot:this},w.jqplot.eventListenerHooks[Y][1])}for(var Y=0;Y<this.eventListenerHooks.hooks.length;Y++){this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[Y][0],{plot:this},this.eventListenerHooks.hooks[Y][1])}for(var Y=0;Y<w.jqplot.postDrawHooks.length;Y++){w.jqplot.postDrawHooks[Y].call(this)}for(var Y=0;Y<this.postDrawHooks.hooks.length;Y++){this.postDrawHooks.hooks[Y].call(this)}if(this.target.is(":visible")){this._drawCount+=1}this.target.trigger("jqplotPostDraw",[this])}};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave);if(this.captureRightClick){this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)}};function P(aa){var Z=aa.data.plot;var V=Z.eventCanvas._elem.offset();var Y={x:aa.pageX-V.left,y:aa.pageY-V.top};var W={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null};var X=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var S=Z.axes;var T,U;for(T=11;T>0;T--){U=X[T-1];if(S[U].show){W[U]=S[U].series_p2u(Y[U.charAt(0)])}}return{offsets:V,gridPos:Y,dataPos:W}}function R(S,T){var X=T.series;var aC,aB,aA,av,aw,ap,ao,ac,aa,af,ag,aq;var az,aD,ax,Y,an,at;var U,au;for(aA=T.seriesStack.length-1;aA>=0;aA--){aC=T.seriesStack[aA];av=X[aC];switch(av.renderer.constructor){case w.jqplot.BarRenderer:ap=S.x;ao=S.y;for(aB=0;aB<av._barPoints.length;aB++){an=av._barPoints[aB];ax=av.gridData[aB];if(ap>an[0][0]&&ap<an[2][0]&&ao>an[2][1]&&ao<an[0][1]){return{seriesIndex:av.index,pointIndex:aB,gridData:ax,data:av.data[aB],points:av._barPoints[aB]}}}break;case w.jqplot.DonutRenderer:af=av.startAngle/180*Math.PI;ap=S.x-av._center[0];ao=S.y-av._center[1];aw=Math.sqrt(Math.pow(ap,2)+Math.pow(ao,2));if(ap>0&&-ao>=0){ac=2*Math.PI-Math.atan(-ao/ap)}else{if(ap>0&&-ao<0){ac=-Math.atan(-ao/ap)}else{if(ap<0){ac=Math.PI-Math.atan(-ao/ap)}else{if(ap==0&&-ao>0){ac=3*Math.PI/2}else{if(ap==0&&-ao<0){ac=Math.PI/2}else{if(ap==0&&ao==0){ac=0}}}}}}if(af){ac-=af;if(ac<0){ac+=2*Math.PI}else{if(ac>2*Math.PI){ac-=2*Math.PI}}}aa=av.sliceMargin/180*Math.PI;if(aw<av._radius&&aw>av._innerRadius){for(aB=0;aB<av.gridData.length;aB++){ag=(aB>0)?av.gridData[aB-1][1]+aa:aa;aq=av.gridData[aB][1];if(ac>ag&&ac<aq){return{seriesIndex:av.index,pointIndex:aB,gridData:av.gridData[aB],data:av.data[aB]}}}}break;case w.jqplot.PieRenderer:af=av.startAngle/180*Math.PI;ap=S.x-av._center[0];ao=S.y-av._center[1];aw=Math.sqrt(Math.pow(ap,2)+Math.pow(ao,2));if(ap>0&&-ao>=0){ac=2*Math.PI-Math.atan(-ao/ap)}else{if(ap>0&&-ao<0){ac=-Math.atan(-ao/ap)}else{if(ap<0){ac=Math.PI-Math.atan(-ao/ap)}else{if(ap==0&&-ao>0){ac=3*Math.PI/2}else{if(ap==0&&-ao<0){ac=Math.PI/2}else{if(ap==0&&ao==0){ac=0}}}}}}if(af){ac-=af;if(ac<0){ac+=2*Math.PI}else{if(ac>2*Math.PI){ac-=2*Math.PI}}}aa=av.sliceMargin/180*Math.PI;if(aw<av._radius){for(aB=0;aB<av.gridData.length;aB++){ag=(aB>0)?av.gridData[aB-1][1]+aa:aa;aq=av.gridData[aB][1];if(ac>ag&&ac<aq){return{seriesIndex:av.index,pointIndex:aB,gridData:av.gridData[aB],data:av.data[aB]}}}}break;case w.jqplot.BubbleRenderer:ap=S.x;ao=S.y;var al=null;if(av.show){for(var aB=0;aB<av.gridData.length;aB++){ax=av.gridData[aB];aD=Math.sqrt((ap-ax[0])*(ap-ax[0])+(ao-ax[1])*(ao-ax[1]));if(aD<=ax[2]&&(aD<=az||az==null)){az=aD;al={seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}if(al!=null){return al}}break;case w.jqplot.FunnelRenderer:ap=S.x;ao=S.y;var ar=av._vertices,W=ar[0],V=ar[ar.length-1],Z,ak,ae;function ay(aG,aI,aH){var aF=(aI[1]-aH[1])/(aI[0]-aH[0]);var aE=aI[1]-aF*aI[0];var aJ=aG+aI[1];return[(aJ-aE)/aF,aJ]}Z=ay(ao,W[0],V[3]);ak=ay(ao,W[1],V[2]);for(aB=0;aB<ar.length;aB++){ae=ar[aB];if(ao>=ae[0][1]&&ao<=ae[3][1]&&ap>=Z[0]&&ap<=ak[0]){return{seriesIndex:av.index,pointIndex:aB,gridData:null,data:av.data[aB]}}}break;case w.jqplot.LineRenderer:ap=S.x;ao=S.y;aw=av.renderer;if(av.show){if(av.fill){var ad=false;if(ap>av._boundingBox[0][0]&&ap<av._boundingBox[1][0]&&ao>av._boundingBox[1][1]&&ao<av._boundingBox[0][1]){var aj=av._areaPoints.length;var am;var aB=aj-1;for(var am=0;am<aj;am++){var ai=[av._areaPoints[am][0],av._areaPoints[am][1]];var ah=[av._areaPoints[aB][0],av._areaPoints[aB][1]];if(ai[1]<ao&&ah[1]>=ao||ah[1]<ao&&ai[1]>=ao){if(ai[0]+(ao-ai[1])/(ah[1]-ai[1])*(ah[0]-ai[0])<ap){ad=!ad}}aB=am}}if(ad){return{seriesIndex:aC,pointIndex:null,gridData:av.gridData,data:av.data,points:av._areaPoints}}break}else{au=av.markerRenderer.size/2+av.neighborThreshold;U=(au>0)?au:0;for(var aB=0;aB<av.gridData.length;aB++){ax=av.gridData[aB];if(aw.constructor==w.jqplot.OHLCRenderer){if(aw.candleStick){var ab=av._yaxis.series_u2p;if(ap>=ax[0]-aw._bodyWidth/2&&ap<=ax[0]+aw._bodyWidth/2&&ao>=ab(av.data[aB][2])&&ao<=ab(av.data[aB][3])){return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}else{if(!aw.hlc){var ab=av._yaxis.series_u2p;if(ap>=ax[0]-aw._tickLength&&ap<=ax[0]+aw._tickLength&&ao>=ab(av.data[aB][2])&&ao<=ab(av.data[aB][3])){return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}else{var ab=av._yaxis.series_u2p;if(ap>=ax[0]-aw._tickLength&&ap<=ax[0]+aw._tickLength&&ao>=ab(av.data[aB][1])&&ao<=ab(av.data[aB][2])){return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}}}else{if(ax[0]!=null&&ax[1]!=null){aD=Math.sqrt((ap-ax[0])*(ap-ax[0])+(ao-ax[1])*(ao-ax[1]));if(aD<=U&&(aD<=az||az==null)){az=aD;return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}}}}}break;default:ap=S.x;ao=S.y;aw=av.renderer;if(av.show){au=av.markerRenderer.size/2+av.neighborThreshold;U=(au>0)?au:0;for(var aB=0;aB<av.gridData.length;aB++){ax=av.gridData[aB];if(aw.constructor==w.jqplot.OHLCRenderer){if(aw.candleStick){var ab=av._yaxis.series_u2p;if(ap>=ax[0]-aw._bodyWidth/2&&ap<=ax[0]+aw._bodyWidth/2&&ao>=ab(av.data[aB][2])&&ao<=ab(av.data[aB][3])){return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}else{if(!aw.hlc){var ab=av._yaxis.series_u2p;if(ap>=ax[0]-aw._tickLength&&ap<=ax[0]+aw._tickLength&&ao>=ab(av.data[aB][2])&&ao<=ab(av.data[aB][3])){return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}else{var ab=av._yaxis.series_u2p;if(ap>=ax[0]-aw._tickLength&&ap<=ax[0]+aw._tickLength&&ao>=ab(av.data[aB][1])&&ao<=ab(av.data[aB][2])){return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}}}else{aD=Math.sqrt((ap-ax[0])*(ap-ax[0])+(ao-ax[1])*(ao-ax[1]));if(aD<=U&&(aD<=az||az==null)){az=aD;return{seriesIndex:aC,pointIndex:aB,gridData:ax,data:av.data[aB]}}}}}break}}return null}this.onClick=function(U){var T=P(U);var W=U.data.plot;var V=R(T.gridPos,W);var S=jQuery.Event("jqplotClick");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,V,W])};this.onDblClick=function(U){var T=P(U);var W=U.data.plot;var V=R(T.gridPos,W);var S=jQuery.Event("jqplotDblClick");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,V,W])};this.onMouseDown=function(U){var T=P(U);var W=U.data.plot;var V=R(T.gridPos,W);var S=jQuery.Event("jqplotMouseDown");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,V,W])};this.onMouseUp=function(U){var T=P(U);var S=jQuery.Event("jqplotMouseUp");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,null,U.data.plot])};this.onRightClick=function(U){var T=P(U);var W=U.data.plot;var V=R(T.gridPos,W);if(W.captureRightClick){if(U.which==3){var S=jQuery.Event("jqplotRightClick");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,V,W])}else{var S=jQuery.Event("jqplotMouseUp");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,V,W])}}};this.onMouseMove=function(U){var T=P(U);var W=U.data.plot;var V=R(T.gridPos,W);var S=jQuery.Event("jqplotMouseMove");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,V,W])};this.onMouseEnter=function(U){var T=P(U);var V=U.data.plot;var S=jQuery.Event("jqplotMouseEnter");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,null,V])};this.onMouseLeave=function(U){var T=P(U);var V=U.data.plot;var S=jQuery.Event("jqplotMouseLeave");S.pageX=U.pageX;S.pageY=U.pageY;w(this).trigger(S,[T.gridPos,T.dataPos,null,V])};this.drawSeries=function(U,S){var W,V,T;S=(typeof(U)==="number"&&S==null)?U:S;U=(typeof(U)==="object")?U:{};if(S!=l){V=this.series[S];T=V.shadowCanvas._ctx;T.clearRect(0,0,T.canvas.width,T.canvas.height);V.drawShadow(T,U,this);T=V.canvas._ctx;T.clearRect(0,0,T.canvas.width,T.canvas.height);V.draw(T,U,this);if(V.renderer.constructor==w.jqplot.BezierCurveRenderer){if(S<this.series.length-1){this.drawSeries(S+1)}}}else{for(W=0;W<this.series.length;W++){V=this.series[W];T=V.shadowCanvas._ctx;T.clearRect(0,0,T.canvas.width,T.canvas.height);V.drawShadow(T,U,this);T=V.canvas._ctx;T.clearRect(0,0,T.canvas.width,T.canvas.height);V.draw(T,U,this)}}U=S=W=V=T=null};this.moveSeriesToFront=function(T){T=parseInt(T,10);var W=w.inArray(T,this.seriesStack);if(W==-1){return}if(W==this.seriesStack.length-1){this.previousSeriesStack=this.seriesStack.slice(0);return}var S=this.seriesStack[this.seriesStack.length-1];var V=this.series[T].canvas._elem.detach();var U=this.series[T].shadowCanvas._elem.detach();this.series[S].shadowCanvas._elem.after(U);this.series[S].canvas._elem.after(V);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(W,1);this.seriesStack.push(T)};this.moveSeriesToBack=function(T){T=parseInt(T,10);var W=w.inArray(T,this.seriesStack);if(W==0||W==-1){return}var S=this.seriesStack[0];var V=this.series[T].canvas._elem.detach();var U=this.series[T].shadowCanvas._elem.detach();this.series[S].shadowCanvas._elem.before(U);this.series[S].canvas._elem.before(V);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(W,1);this.seriesStack.unshift(T)};this.restorePreviousSeriesOrder=function(){var Y,X,W,V,U,S,T;if(this.seriesStack==this.previousSeriesStack){return}for(Y=1;Y<this.previousSeriesStack.length;Y++){S=this.previousSeriesStack[Y];T=this.previousSeriesStack[Y-1];W=this.series[S].canvas._elem.detach();V=this.series[S].shadowCanvas._elem.detach();this.series[T].shadowCanvas._elem.after(V);this.series[T].canvas._elem.after(W)}U=this.seriesStack.slice(0);this.seriesStack=this.previousSeriesStack.slice(0);this.previousSeriesStack=U};this.restoreOriginalSeriesOrder=function(){var W,V,S=[],U,T;for(W=0;W<this.series.length;W++){S.push(W)}if(this.seriesStack==S){return}this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack=S;for(W=1;W<this.seriesStack.length;W++){U=this.series[W].canvas._elem.detach();T=this.series[W].shadowCanvas._elem.detach();this.series[W-1].shadowCanvas._elem.after(T);this.series[W-1].canvas._elem.after(U)}};this.activateTheme=function(S){this.themeEngine.activate(this,S)}}w.jqplot.computeHighlightColors=function(P){var R;if(jQuery.isArray(P)){R=[];for(var T=0;T<P.length;T++){var S=w.jqplot.getColorComponents(P[T]);var O=[S[0],S[1],S[2]];var U=O[0]+O[1]+O[2];for(var Q=0;Q<3;Q++){O[Q]=(U>570)?O[Q]*0.8:O[Q]+0.3*(255-O[Q]);O[Q]=parseInt(O[Q],10)}R.push("rgb("+O[0]+","+O[1]+","+O[2]+")")}}else{var S=w.jqplot.getColorComponents(P);var O=[S[0],S[1],S[2]];var U=O[0]+O[1]+O[2];for(var Q=0;Q<3;Q++){O[Q]=(U>570)?O[Q]*0.8:O[Q]+0.3*(255-O[Q]);O[Q]=parseInt(O[Q],10)}R="rgb("+O[0]+","+O[1]+","+O[2]+")"}return R};w.jqplot.ColorGenerator=function(P){P=P||w.jqplot.config.defaultColors;var O=0;this.next=function(){if(O<P.length){return P[O++]}else{O=0;return P[O++]}};this.previous=function(){if(O>0){return P[O--]}else{O=P.length-1;return P[O]}};this.get=function(R){var Q=R-P.length*Math.floor(R/P.length);return P[Q]};this.setColors=function(Q){P=Q};this.reset=function(){O=0}};w.jqplot.hex2rgb=function(Q,O){Q=Q.replace("#","");if(Q.length==3){Q=Q.charAt(0)+Q.charAt(0)+Q.charAt(1)+Q.charAt(1)+Q.charAt(2)+Q.charAt(2)}var P;P="rgba("+parseInt(Q.slice(0,2),16)+", "+parseInt(Q.slice(2,4),16)+", "+parseInt(Q.slice(4,6),16);if(O){P+=", "+O}P+=")";return P};w.jqplot.rgb2hex=function(T){var Q=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var O=T.match(Q);var S="#";for(var R=1;R<4;R++){var P;if(O[R].search(/%/)!=-1){P=parseInt(255*O[R]/100,10).toString(16);if(P.length==1){P="0"+P}}else{P=parseInt(O[R],10).toString(16);if(P.length==1){P="0"+P}}S+=P}return S};w.jqplot.normalize2rgb=function(P,O){if(P.search(/^ *rgba?\(/)!=-1){return P}else{if(P.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return w.jqplot.hex2rgb(P,O)}else{throw"invalid color spec"}}};w.jqplot.getColorComponents=function(T){T=w.jqplot.colorKeywordMap[T]||T;var R=w.jqplot.normalize2rgb(T);var Q=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var O=R.match(Q);var P=[];for(var S=1;S<4;S++){if(O[S].search(/%/)!=-1){P[S-1]=parseInt(255*O[S]/100,10)}else{P[S-1]=parseInt(O[S],10)}}P[3]=parseFloat(O[4])?parseFloat(O[4]):1;return P};w.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"};w.jqplot.AxisLabelRenderer=function(O){w.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this.fontFamily=null;this.fontSize=null;this.textColor=null;this._elem;this.escapeHTML=false;w.extend(true,this,O)};w.jqplot.AxisLabelRenderer.prototype=new w.jqplot.ElemContainer();w.jqplot.AxisLabelRenderer.prototype.constructor=w.jqplot.AxisLabelRenderer;w.jqplot.AxisLabelRenderer.prototype.init=function(O){w.extend(true,this,O)};w.jqplot.AxisLabelRenderer.prototype.draw=function(O,P){if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=w('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};w.jqplot.AxisLabelRenderer.prototype.pack=function(){};w.jqplot.AxisTickRenderer=function(O){w.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label="";this.value=null;this._styles={};this.formatter=w.jqplot.DefaultTickFormatter;this.prefix="";this.formatString="";this.fontFamily;this.fontSize;this.textColor;this.escapeHTML=false;this._elem;this._breakTick=false;w.extend(true,this,O)};w.jqplot.AxisTickRenderer.prototype.init=function(O){w.extend(true,this,O)};w.jqplot.AxisTickRenderer.prototype=new w.jqplot.ElemContainer();w.jqplot.AxisTickRenderer.prototype.constructor=w.jqplot.AxisTickRenderer;w.jqplot.AxisTickRenderer.prototype.setTick=function(O,Q,P){this.value=O;this.axis=Q;if(P){this.isMinorTick=true}return this};w.jqplot.AxisTickRenderer.prototype.draw=function(){if(!this.label){this.label=this.prefix+this.formatter(this.formatString,this.value)}var P={position:"absolute"};if(Number(this.label)){P.whitSpace="nowrap"}if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=w(document.createElement("div"));this._elem.addClass("jqplot-"+this.axis+"-tick");if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}this._elem.css(P);for(var O in this._styles){this._elem.css(O,this._styles[O])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}if(this._breakTick){this._elem.addClass("jqplot-breakTick")}return this._elem};w.jqplot.DefaultTickFormatter=function(O,P){if(typeof P=="number"){if(!O){O=w.jqplot.config.defaultTickFormatString}return w.jqplot.sprintf(O,P)}else{return String(P)}};w.jqplot.AxisTickRenderer.prototype.pack=function(){};w.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new w.jqplot.ShadowRenderer()};w.jqplot.CanvasGridRenderer.prototype.init=function(P){this._ctx;w.extend(true,this,P);var O={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(O)};w.jqplot.CanvasGridRenderer.prototype.createElement=function(R){var Q;if(this._elem){if(w.jqplot.use_excanvas){Q=this._elem.get(0);window.G_vmlCanvasManager.uninitElement(Q);Q=null}this._elem.emptyForce();this._elem=null}Q=R.canvasManager.getCanvas();var O=this._plotDimensions.width;var P=this._plotDimensions.height;Q.width=O;Q.height=P;this._elem=w(Q);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});Q=R.canvasManager.initCanvas(Q);this._top=this._offsets.top;this._bottom=P-this._offsets.bottom;this._left=this._offsets.left;this._right=O-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;Q=null;return this._elem};w.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var Y=this._ctx;var ab=this._axes;Y.save();Y.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height);Y.fillStyle=this.backgroundColor||this.background;Y.fillRect(this._left,this._top,this._width,this._height);if(true){Y.save();Y.lineJoin="miter";Y.lineCap="butt";Y.lineWidth=this.gridLineWidth;Y.strokeStyle=this.gridLineColor;var ae,ad,W,X;var T=["xaxis","yaxis","x2axis","y2axis"];for(var ac=4;ac>0;ac--){var ag=T[ac-1];var O=ab[ag];var af=O._ticks;if(O.show){for(var Z=af.length;Z>0;Z--){var U=af[Z-1];if(U.show){var R=Math.round(O.u2p(U.value))+0.5;switch(ag){case"xaxis":if(U.showGridline&&this.drawGridlines){V(R,this._top,R,this._bottom)}if(U.showMark&&U.mark){W=U.markSize;X=U.mark;var R=Math.round(O.u2p(U.value))+0.5;switch(X){case"outside":ae=this._bottom;ad=this._bottom+W;break;case"inside":ae=this._bottom-W;ad=this._bottom;break;case"cross":ae=this._bottom-W;ad=this._bottom+W;break;default:ae=this._bottom;ad=this._bottom+W;break}if(this.shadow){this.renderer.shadowRenderer.draw(Y,[[R,ae],[R,ad]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}V(R,ae,R,ad)}break;case"yaxis":if(U.showGridline&&this.drawGridlines){V(this._right,R,this._left,R)}if(U.showMark&&U.mark){W=U.markSize;X=U.mark;var R=Math.round(O.u2p(U.value))+0.5;switch(X){case"outside":ae=this._left-W;ad=this._left;break;case"inside":ae=this._left;ad=this._left+W;break;case"cross":ae=this._left-W;ad=this._left+W;break;default:ae=this._left-W;ad=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(Y,[[ae,R],[ad,R]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}V(ae,R,ad,R,{strokeStyle:O.borderColor})}break;case"x2axis":if(U.showGridline&&this.drawGridlines){V(R,this._bottom,R,this._top)}if(U.showMark&&U.mark){W=U.markSize;X=U.mark;var R=Math.round(O.u2p(U.value))+0.5;switch(X){case"outside":ae=this._top-W;ad=this._top;break;case"inside":ae=this._top;ad=this._top+W;break;case"cross":ae=this._top-W;ad=this._top+W;break;default:ae=this._top-W;ad=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(Y,[[R,ae],[R,ad]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}V(R,ae,R,ad)}break;case"y2axis":if(U.showGridline&&this.drawGridlines){V(this._left,R,this._right,R)}if(U.showMark&&U.mark){W=U.markSize;X=U.mark;var R=Math.round(O.u2p(U.value))+0.5;switch(X){case"outside":ae=this._right;ad=this._right+W;break;case"inside":ae=this._right-W;ad=this._right;break;case"cross":ae=this._right-W;ad=this._right+W;break;default:ae=this._right;ad=this._right+W;break}if(this.shadow){this.renderer.shadowRenderer.draw(Y,[[ae,R],[ad,R]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}V(ae,R,ad,R,{strokeStyle:O.borderColor})}break;default:break}}}U=null}O=null;af=null}T=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];for(var ac=7;ac>0;ac--){var O=ab[T[ac-1]];var af=O._ticks;if(O.show){var P=af[O.numberTicks-1];var S=af[0];var Q=O.getLeft();var aa=[[Q,P.getTop()+P.getHeight()/2],[Q,S.getTop()+S.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(Y,aa,{lineCap:"butt",fill:false,closePath:false})}V(aa[0][0],aa[0][1],aa[1][0],aa[1][1],{lineCap:"butt",strokeStyle:O.borderColor,lineWidth:O.borderWidth});for(var Z=af.length;Z>0;Z--){var U=af[Z-1];W=U.markSize;X=U.mark;var R=Math.round(O.u2p(U.value))+0.5;if(U.showMark&&U.mark){switch(X){case"outside":ae=Q;ad=Q+W;break;case"inside":ae=Q-W;ad=Q;break;case"cross":ae=Q-W;ad=Q+W;break;default:ae=Q;ad=Q+W;break}aa=[[ae,R],[ad,R]];if(this.shadow){this.renderer.shadowRenderer.draw(Y,aa,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}V(ae,R,ad,R,{strokeStyle:O.borderColor})}U=null}S=null}O=null;af=null}Y.restore()}function V(al,ak,ai,ah,aj){Y.save();aj=aj||{};if(aj.lineWidth==null||aj.lineWidth!=0){w.extend(true,Y,aj);Y.beginPath();Y.moveTo(al,ak);Y.lineTo(ai,ah);Y.stroke();Y.restore()}}if(this.shadow){var aa=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(Y,aa)}if(this.borderWidth!=0&&this.drawBorder){V(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:ab.x2axis.borderColor,lineWidth:ab.x2axis.borderWidth});V(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:ab.y2axis.borderColor,lineWidth:ab.y2axis.borderWidth});V(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:ab.xaxis.borderColor,lineWidth:ab.xaxis.borderWidth});V(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:ab.yaxis.borderColor,lineWidth:ab.yaxis.borderWidth})}Y.restore();Y=null;ab=null};w.jqplot.DivTitleRenderer=function(){};w.jqplot.DivTitleRenderer.prototype.init=function(O){w.extend(true,this,O)};w.jqplot.DivTitleRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}var R=this.renderer;var Q=document.createElement("div");this._elem=w(Q);this._elem.addClass("jqplot-title");if(!this.text){this.show=false;this._elem.height(0);this._elem.width(0)}else{if(this.text){var O;if(this.color){O=this.color}else{if(this.textColor){O=this.textColor}}var P={position:"absolute",top:"0px",left:"0px"};if(this._plotWidth){P.width=this._plotWidth+"px"}if(this.fontSize){P.fontSize=this.fontSize}if(this.textAlign){P.textAlign=this.textAlign}else{P.textAlign="center"}if(O){P.color=O}if(this.paddingBottom){P.paddingBottom=this.paddingBottom}if(this.fontFamily){P.fontFamily=this.fontFamily}this._elem.css(P);this._elem.text(this.text)}}Q=null;return this._elem};w.jqplot.DivTitleRenderer.prototype.pack=function(){};w.jqplot.LineRenderer=function(){this.shapeRenderer=new w.jqplot.ShapeRenderer();this.shadowRenderer=new w.jqplot.ShadowRenderer()};w.jqplot.LineRenderer.prototype.init=function(P,T){P=P||{};this._type="line";var R={highlightMouseOver:P.highlightMouseOver,highlightMouseDown:P.highlightMouseDown,highlightColor:P.highlightColor};delete (P.highlightMouseOver);delete (P.highlightMouseDown);delete (P.highlightColor);w.extend(true,this.renderer,P);var S={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shapeRenderer.init(S);if(this.lineWidth>2.5){var Q=this.shadowOffset*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{var Q=this.shadowOffset*Math.atan((this.lineWidth/2.5))/0.785398163}var O={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,angle:this.shadowAngle,offset:Q,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,closePath:this.fill};this.renderer.shadowRenderer.init(O);this._areaPoints=[];this._boundingBox=[[],[]];if(!this.isTrendline&&this.fill){this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColor=null;if(R.highlightMouseDown&&R.highlightMouseOver==null){R.highlightMouseOver=false}w.extend(true,this,{highlightMouseOver:R.highlightMouseOver,highlightMouseDown:R.highlightMouseDown,highlightColor:R.highlightColor});if(!this.highlightColor){this.highlightColor=w.jqplot.computeHighlightColors(this.fillColor)}if(this.highlighter){this.highlighter.show=false}}if(!this.isTrendline&&T){T.plugins.lineRenderer={};T.postInitHooks.addOnce(o);T.postDrawHooks.addOnce(M);T.eventListenerHooks.addOnce("jqplotMouseMove",d);T.eventListenerHooks.addOnce("jqplotMouseDown",a);T.eventListenerHooks.addOnce("jqplotMouseUp",L);T.eventListenerHooks.addOnce("jqplotClick",c);T.eventListenerHooks.addOnce("jqplotRightClick",j)}};w.jqplot.LineRenderer.prototype.setGridData=function(T){var P=this._xaxis.series_u2p;var S=this._yaxis.series_u2p;var Q=this._plotData;var R=this._prevPlotData;this.gridData=[];this._prevGridData=[];for(var O=0;O<this.data.length;O++){if(Q[O][0]!=null&&Q[O][1]!=null){this.gridData.push([P.call(this._xaxis,Q[O][0]),S.call(this._yaxis,Q[O][1])])}else{if(Q[O][0]==null){this.gridData.push([null,S.call(this._yaxis,Q[O][1])])}else{if(Q[O][1]==null){this.gridData.push([P.call(this._xaxis,Q[O][0]),null])}}}if(R[O]!=null&&R[O][0]!=null&&R[O][1]!=null){this._prevGridData.push([P.call(this._xaxis,R[O][0]),S.call(this._yaxis,R[O][1])])}else{if(R[O]!=null&&R[O][0]==null){this._prevGridData.push([null,S.call(this._yaxis,R[O][1])])}else{if(R[O]!=null&&R[O][0]!=null&&R[O][1]==null){this._prevGridData.push([P.call(this._xaxis,R[O][0]),null])}}}}};w.jqplot.LineRenderer.prototype.makeGridData=function(R,T){var Q=this._xaxis.series_u2p;var S=this._yaxis.series_u2p;var P=[];var U=[];for(var O=0;O<R.length;O++){if(R[O][0]!=null&&R[O][1]!=null){P.push([Q.call(this._xaxis,R[O][0]),S.call(this._yaxis,R[O][1])])}else{if(R[O][0]==null){P.push([null,S.call(this._yaxis,R[O][1])])}else{if(R[O][1]==null){P.push([Q.call(this._xaxis,R[O][0]),null])}}}}return P};w.jqplot.LineRenderer.prototype.draw=function(ad,an,P){var ah;var X=(P!=l)?P:{};var R=(X.shadow!=l)?X.shadow:this.shadow;var ao=(X.showLine!=l)?X.showLine:this.showLine;var ag=(X.fill!=l)?X.fill:this.fill;var O=(X.fillAndStroke!=l)?X.fillAndStroke:this.fillAndStroke;var Y,ae,ab,aj;ad.save();if(an.length){if(ao){if(ag){if(this.fillToZero){var S=new w.jqplot.ColorGenerator(this.negativeSeriesColors);var ak=S.get(this.index);if(!this.useNegativeColors){ak=X.fillStyle}var V=false;var W=X.fillStyle;if(O){var am=an.slice(0)}if(this.index==0||!this._stack){var ac=[];this._areaPoints=[];var al=this._yaxis.series_u2p(this.fillToValue);var Q=this._xaxis.series_u2p(this.fillToValue);if(this.fillAxis=="y"){ac.push([an[0][0],al]);this._areaPoints.push([an[0][0],al]);for(var ah=0;ah<an.length-1;ah++){ac.push(an[ah]);this._areaPoints.push(an[ah]);if(this._plotData[ah][1]*this._plotData[ah+1][1]<0){if(this._plotData[ah][1]<0){V=true;X.fillStyle=ak}else{V=false;X.fillStyle=W}var U=an[ah][0]+(an[ah+1][0]-an[ah][0])*(al-an[ah][1])/(an[ah+1][1]-an[ah][1]);ac.push([U,al]);this._areaPoints.push([U,al]);if(R){this.renderer.shadowRenderer.draw(ad,ac,X)}this.renderer.shapeRenderer.draw(ad,ac,X);ac=[[U,al]]}}if(this._plotData[an.length-1][1]<0){V=true;X.fillStyle=ak}else{V=false;X.fillStyle=W}ac.push(an[an.length-1]);this._areaPoints.push(an[an.length-1]);ac.push([an[an.length-1][0],al]);this._areaPoints.push([an[an.length-1][0],al])}if(R){this.renderer.shadowRenderer.draw(ad,ac,X)}this.renderer.shapeRenderer.draw(ad,ac,X)}else{var aa=this._prevGridData;for(var ah=aa.length;ah>0;ah--){an.push(aa[ah-1])}if(R){this.renderer.shadowRenderer.draw(ad,an,X)}this._areaPoints=an;this.renderer.shapeRenderer.draw(ad,an,X)}}else{if(O){var am=an.slice(0)}if(this.index==0||!this._stack){var T=ad.canvas.height;an.unshift([an[0][0],T]);var ai=an.length;an.push([an[ai-1][0],T])}else{var aa=this._prevGridData;for(var ah=aa.length;ah>0;ah--){an.push(aa[ah-1])}}this._areaPoints=an;if(R){this.renderer.shadowRenderer.draw(ad,an,X)}this.renderer.shapeRenderer.draw(ad,an,X)}if(O){var af=w.extend(true,{},X,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(ad,am,af);if(this.markerRenderer.show){for(ah=0;ah<am.length;ah++){this.markerRenderer.draw(am[ah][0],am[ah][1],ad,X.markerOptions)}}}}else{if(R){this.renderer.shadowRenderer.draw(ad,an,X)}this.renderer.shapeRenderer.draw(ad,an,X)}}var Y=ab=ae=aj=null;for(ah=0;ah<this._areaPoints.length;ah++){var Z=this._areaPoints[ah];if(Y>Z[0]||Y==null){Y=Z[0]}if(aj<Z[1]||aj==null){aj=Z[1]}if(ab<Z[0]||ab==null){ab=Z[0]}if(ae>Z[1]||ae==null){ae=Z[1]}}this._boundingBox=[[Y,aj],[ab,ae]];if(this.markerRenderer.show&&!ag){for(ah=0;ah<an.length;ah++){if(an[ah][0]!=null&&an[ah][1]!=null){this.markerRenderer.draw(an[ah][0],an[ah][1],ad,X.markerOptions)}}}}ad.restore()};w.jqplot.LineRenderer.prototype.drawShadow=function(O,Q,P){};function o(R,Q,O){for(var P=0;P<this.series.length;P++){if(this.series[P].renderer.constructor==w.jqplot.LineRenderer){if(this.series[P].highlightMouseOver){this.series[P].highlightMouseDown=false}}}this.target.bind("mouseout",{plot:this},function(S){I(S.data.plot)})}function M(){if(this.plugins.lineRenderer&&this.plugins.lineRenderer.highlightCanvas){this.plugins.lineRenderer.highlightCanvas.resetCanvas();this.plugins.lineRenderer.highlightCanvas=null}this.plugins.lineRenderer.highlightedSeriesIndex=null;this.plugins.lineRenderer.highlightCanvas=new w.jqplot.GenericCanvas();this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-lineRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.lineRenderer.highlightCanvas.setContext()}function K(U,T,R,Q){var P=U.series[T];var O=U.plugins.lineRenderer.highlightCanvas;O._ctx.clearRect(0,0,O._ctx.canvas.width,O._ctx.canvas.height);P._highlightedPoint=R;U.plugins.lineRenderer.highlightedSeriesIndex=T;var S={fillStyle:P.highlightColor};P.renderer.shapeRenderer.draw(O._ctx,Q,S);O=null}function I(Q){var O=Q.plugins.lineRenderer.highlightCanvas;O._ctx.clearRect(0,0,O._ctx.canvas.width,O._ctx.canvas.height);for(var P=0;P<Q.series.length;P++){Q.series[P]._highlightedPoint=null}Q.plugins.lineRenderer.highlightedSeriesIndex=null;Q.target.trigger("jqplotDataUnhighlight");O=null}function d(S,R,V,U,T){if(U){var Q=[U.seriesIndex,U.pointIndex,U.data];var P=jQuery.Event("jqplotDataMouseOver");P.pageX=S.pageX;P.pageY=S.pageY;T.target.trigger(P,Q);if(T.series[Q[0]].highlightMouseOver&&!(Q[0]==T.plugins.lineRenderer.highlightedSeriesIndex)){var O=jQuery.Event("jqplotDataHighlight");O.pageX=S.pageX;O.pageY=S.pageY;T.target.trigger(O,Q);K(T,U.seriesIndex,U.pointIndex,U.points)}}else{if(U==null){I(T)}}}function a(R,Q,U,T,S){if(T){var P=[T.seriesIndex,T.pointIndex,T.data];if(S.series[P[0]].highlightMouseDown&&!(P[0]==S.plugins.lineRenderer.highlightedSeriesIndex)){var O=jQuery.Event("jqplotDataHighlight");O.pageX=R.pageX;O.pageY=R.pageY;S.target.trigger(O,P);K(S,T.seriesIndex,T.pointIndex,T.points)}}else{if(T==null){I(S)}}}function L(Q,P,T,S,R){var O=R.plugins.lineRenderer.highlightedSeriesIndex;if(O!=null&&R.series[O].highlightMouseDown){I(R)}}function c(R,Q,U,T,S){if(T){var P=[T.seriesIndex,T.pointIndex,T.data];var O=jQuery.Event("jqplotDataClick");O.pageX=R.pageX;O.pageY=R.pageY;S.target.trigger(O,P)}}function j(S,R,V,U,T){if(U){var Q=[U.seriesIndex,U.pointIndex,U.data];var O=T.plugins.lineRenderer.highlightedSeriesIndex;if(O!=null&&T.series[O].highlightMouseDown){I(T)}var P=jQuery.Event("jqplotDataRightClick");P.pageX=S.pageX;P.pageY=S.pageY;T.target.trigger(P,Q)}}w.jqplot.LinearAxisRenderer=function(){};w.jqplot.LinearAxisRenderer.prototype.init=function(O){this.breakPoints=null;this.breakTickLabel="&asymp;";this.forceTickAt0=false;this.forceTickAt100=false;this._autoFormatString="";this._overrideFormatString=false;w.extend(true,this,O);if(this.breakPoints){if(!w.isArray(this.breakPoints)){this.breakPoints=null}else{if(this.breakPoints.length<2||this.breakPoints[1]<=this.breakPoints[0]){this.breakPoints=null}}}this.resetDataBounds()};w.jqplot.LinearAxisRenderer.prototype.draw=function(O,V){if(this.show){this.renderer.createTicks.call(this);var U=0;var P;if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=w(document.createElement("div"));this._elem.addClass("jqplot-axis jqplot-"+this.name);this._elem.css("posiiton","absolute");if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var T=this._label.draw(O,V);T.appendTo(this._elem);T=null}var S=this._ticks;var R;for(var Q=0;Q<S.length;Q++){R=S[Q];if(R.show&&R.showLabel&&(!R.isMinorTick||this.showMinorTicks)){this._elem.append(R.draw(O,V))}}R=null;S=null}return this._elem};w.jqplot.LinearAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks;this._autoFormatString="";if(this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString){this.tickOptions.formatString=""}};w.jqplot.LinearAxisRenderer.prototype.set=function(){var V=0;var Q;var P=0;var U=0;var O=(this._label==null)?false:this._label.show;if(this.show){var T=this._ticks;var S;for(var R=0;R<T.length;R++){S=T[R];if(!S._breakTick&&S.show&&S.showLabel&&(!S.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){Q=S._elem.outerHeight(true)}else{Q=S._elem.outerWidth(true)}if(Q>V){V=Q}}}S=null;T=null;if(O){P=this._label._elem.outerWidth(true);U=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){V=V+U;this._elem.css({height:V+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){V=V+U;this._elem.css({height:V+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){V=V+P;this._elem.css({width:V+"px",left:"0px",top:"0px"});if(O&&this._label.constructor==w.jqplot.AxisLabelRenderer){this._label._elem.css("width",P+"px")}}else{V=V+P;this._elem.css({width:V+"px",right:"0px",top:"0px"});if(O&&this._label.constructor==w.jqplot.AxisLabelRenderer){this._label._elem.css("width",P+"px")}}}}}};w.jqplot.LinearAxisRenderer.prototype.createTicks=function(){var ax=this._ticks;var an=this.ticks;var ae=this.name;var ag=this._dataBounds;var O,T;var aJ,al;var V,U;var aH,aE;var ak=this.min;var aI=this.max;var aA=this.numberTicks;var aM=this.tickInterval;if(an.length){for(aE=0;aE<an.length;aE++){var aq=an[aE];var ay=new this.tickRenderer(this.tickOptions);if(aq.constructor==Array){ay.value=aq[0];if(this.breakPoints){if(aq[0]==this.breakPoints[0]){ay.label=this.breakTickLabel;ay._breakTick=true;ay.showGridline=false;ay.showMark=false}else{if(aq[0]>this.breakPoints[0]&&aq[0]<=this.breakPoints[1]){ay.show=false;ay.showGridline=false;ay.label=aq[1]}else{ay.label=aq[1]}}}else{ay.label=aq[1]}ay.setTick(aq[0],this.name);this._ticks.push(ay)}else{ay.value=aq;if(this.breakPoints){if(aq==this.breakPoints[0]){ay.label=this.breakTickLabel;ay._breakTick=true;ay.showGridline=false;ay.showMark=false}else{if(aq>this.breakPoints[0]&&aq<=this.breakPoints[1]){ay.show=false;ay.showGridline=false}}}ay.setTick(aq,this.name);this._ticks.push(ay)}}this.numberTicks=an.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(ae=="xaxis"||ae=="x2axis"){O=this._plotDimensions.width}else{O=this._plotDimensions.height}aJ=((this.min!=null)?this.min:ag.min);al=((this.max!=null)?this.max:ag.max);var aa=al-aJ;var aw,ad;var Y;if(this.min==null&&this.max==null&&this.numberTicks==null&&this.tickInterval==null&&!this.autoscale){if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(this.forceTickAt0){if(aJ>0){aJ=0}if(al<0){al=0}}if(this.forceTickAt100){if(aJ>100){aJ=100}if(al<100){al=100}}var S=30;var at=Math.max(O,S+1);var ab=(at-S)/300;var ar=w.jqplot.LinearTickGenerator(aJ,al,ab);var ac=aJ+aa*(this.padMin-1);var au=al-aa*(this.padMax-1);if(aJ<=ac||al>=au){ac=aJ-aa*(this.padMin-1);au=al+aa*(this.padMax-1);ar=w.jqplot.LinearTickGenerator(ac,au,ab)}this.min=ar[0];this.max=ar[1];this.numberTicks=ar[2];this._autoFormatString=ar[3];this.tickInterval=ar[4]}else{if(aJ==al){var P=0.05;if(aJ>0){P=Math.max(Math.log(aJ)/Math.LN10,0.05)}aJ-=P;al+=P}if(this.autoscale&&this.min==null&&this.max==null){var Q,R,X;var ah=false;var ap=false;var af={min:null,max:null,average:null,stddev:null};for(var aE=0;aE<this._series.length;aE++){var az=this._series[aE];var ai=(az.fillAxis=="x")?az._xaxis.name:az._yaxis.name;if(this.name==ai){var av=az._plotValues[az.fillAxis];var aj=av[0];var aF=av[0];for(var aD=1;aD<av.length;aD++){if(av[aD]<aj){aj=av[aD]}else{if(av[aD]>aF){aF=av[aD]}}}var Z=(aF-aj)/aF;if(az.renderer.constructor==w.jqplot.BarRenderer){if(aj>=0&&(az.fillToZero||Z>0.1)){ah=true}else{ah=false;if(az.fill&&az.fillToZero&&aj<0&&aF>0){ap=true}else{ap=false}}}else{if(az.fill){if(aj>=0&&(az.fillToZero||Z>0.1)){ah=true}else{if(aj<0&&aF>0&&az.fillToZero){ah=false;ap=true}else{ah=false;ap=false}}}else{if(aj<0){ah=false}}}}}if(ah){this.numberTicks=2+Math.ceil((O-(this.tickSpacing-1))/this.tickSpacing);this.min=0;ak=0;R=al/(this.numberTicks-1);Y=Math.pow(10,Math.abs(Math.floor(Math.log(R)/Math.LN10)));if(R/Y==parseInt(R/Y,10)){R+=Y}this.tickInterval=Math.ceil(R/Y)*Y;this.max=this.tickInterval*(this.numberTicks-1)}else{if(ap){this.numberTicks=2+Math.ceil((O-(this.tickSpacing-1))/this.tickSpacing);var am=Math.ceil(Math.abs(aJ)/aa*(this.numberTicks-1));var aL=this.numberTicks-1-am;R=Math.max(Math.abs(aJ/am),Math.abs(al/aL));Y=Math.pow(10,Math.abs(Math.floor(Math.log(R)/Math.LN10)));this.tickInterval=Math.ceil(R/Y)*Y;this.max=this.tickInterval*aL;this.min=-this.tickInterval*am}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(aa/this.tickInterval)}else{this.numberTicks=2+Math.ceil((O-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){R=aa/(this.numberTicks-1);if(R<1){Y=Math.pow(10,Math.abs(Math.floor(Math.log(R)/Math.LN10)))}else{Y=1}this.tickInterval=Math.ceil(R*Y*this.pad)/Y}else{Y=1/this.tickInterval}Q=this.tickInterval*(this.numberTicks-1);X=(Q-aa)/2;if(this.min==null){this.min=Math.floor(Y*(aJ-X))/Y}if(this.max==null){this.max=this.min+Q}}}}else{aw=(this.min!=null)?this.min:aJ-aa*(this.padMin-1);ad=(this.max!=null)?this.max:al+aa*(this.padMax-1);this.min=aw;this.max=ad;aa=this.max-this.min;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(O>100){this.numberTicks=parseInt(3+(O-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=aa/(this.numberTicks-1)}}if(this.renderer.constructor==w.jqplot.LinearAxisRenderer&&this._autoFormatString==""){aa=this.max-this.min;var aK=new this.tickRenderer(this.tickOptions);var ao=aK.formatString||w.jqplot.config.defaultTickFormatString;var ao=ao.match(w.jqplot.sprintf.regex)[0];var aG=0;if(ao){if(ao.search(/[fFeEgGpP]/)>-1){var aC=ao.match(/\%\.(\d{0,})?[eEfFgGpP]/);if(aC){aG=parseInt(aC[1],10)}else{aG=6}}else{if(ao.search(/[di]/)>-1){aG=0}}var W=Math.pow(10,-aG);if(this.tickInterval<W){if(aA==null&&aM==null){this.tickInterval=W;if(aI==null&&ak==null){this.min=Math.floor(this._dataBounds.min/W)*W;if(this.min==this._dataBounds.min){this.min=this._dataBounds.min-this.tickInterval}this.max=Math.ceil(this._dataBounds.max/W)*W;if(this.max==this._dataBounds.max){this.max=this._dataBounds.max+this.tickInterval}var aB=(this.max-this.min)/this.tickInterval;aB=aB.toFixed(11);aB=Math.ceil(aB);this.numberTicks=aB+1}else{if(aI==null){var aB=(this._dataBounds.max-this.min)/this.tickInterval;aB=aB.toFixed(11);this.numberTicks=Math.ceil(aB)+2;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(ak==null){var aB=(this.max-this._dataBounds.min)/this.tickInterval;aB=aB.toFixed(11);this.numberTicks=Math.ceil(aB)+2;this.min=this.max-this.tickInterval*(this.numberTicks-1)}else{this.numberTicks=Math.ceil((aI-ak)/this.tickInterval)+1;this.min=Math.floor(ak*Math.pow(10,aG))/Math.pow(10,aG);this.max=Math.ceil(aI*Math.pow(10,aG))/Math.pow(10,aG);this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1}}}}}}}}if(this._overrideFormatString&&this._autoFormatString!=""){this.tickOptions=this.tickOptions||{};this.tickOptions.formatString=this._autoFormatString}for(var aE=0;aE<this.numberTicks;aE++){aH=this.min+aE*this.tickInterval;var ay=new this.tickRenderer(this.tickOptions);ay.setTick(aH,this.name);this._ticks.push(ay);ay=null}}ax=null};w.jqplot.LinearAxisRenderer.prototype.resetTickValues=function(Q){if(w.isArray(Q)&&Q.length==this._ticks.length){var P;for(var O=0;O<Q.length;O++){P=this._ticks[O];P.value=Q[O];P.label=P.formatter(P.formatString,Q[O]);P.label=P.prefix+P.label;P._elem.html(P.label)}P=null;this.min=w.jqplot.arrayMin(Q);this.max=w.jqplot.arrayMax(Q);this.pack()}};w.jqplot.LinearAxisRenderer.prototype.pack=function(Q,P){Q=Q||{};P=P||this._offsets;var ae=this._ticks;var aa=this.max;var Z=this.min;var V=P.max;var T=P.min;var X=(this._label==null)?false:this._label.show;for(var Y in Q){this._elem.css(Y,Q[Y])}this._offsets=P;var R=V-T;var S=aa-Z;if(this.breakPoints){S=S-this.breakPoints[1]+this.breakPoints[0];this.p2u=function(ag){return(ag-T)*S/R+Z};this.u2p=function(ag){if(ag>this.breakPoints[0]&&ag<this.breakPoints[1]){ag=this.breakPoints[0]}if(ag<=this.breakPoints[0]){return(ag-Z)*R/S+T}else{return(ag-this.breakPoints[1]+this.breakPoints[0]-Z)*R/S+T}};if(this.name.charAt(0)=="x"){this.series_u2p=function(ag){if(ag>this.breakPoints[0]&&ag<this.breakPoints[1]){ag=this.breakPoints[0]}if(ag<=this.breakPoints[0]){return(ag-Z)*R/S}else{return(ag-this.breakPoints[1]+this.breakPoints[0]-Z)*R/S}};this.series_p2u=function(ag){return ag*S/R+Z}}else{this.series_u2p=function(ag){if(ag>this.breakPoints[0]&&ag<this.breakPoints[1]){ag=this.breakPoints[0]}if(ag>=this.breakPoints[1]){return(ag-aa)*R/S}else{return(ag+this.breakPoints[1]-this.breakPoints[0]-aa)*R/S}};this.series_p2u=function(ag){return ag*S/R+aa}}}else{this.p2u=function(ag){return(ag-T)*S/R+Z};this.u2p=function(ag){return(ag-Z)*R/S+T};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(ag){return(ag-Z)*R/S};this.series_p2u=function(ag){return ag*S/R+Z}}else{this.series_u2p=function(ag){return(ag-aa)*R/S};this.series_p2u=function(ag){return ag*S/R+aa}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var ab=0;ab<ae.length;ab++){var W=ae[ab];if(W.show&&W.showLabel){var O;if(W.constructor==w.jqplot.CanvasAxisTickRenderer&&W.angle){var ad=(this.name=="xaxis")?1:-1;switch(W.labelPosition){case"auto":if(ad*W.angle<0){O=-W.getWidth()+W._textRenderer.height*Math.sin(-W._textRenderer.angle)/2}else{O=-W._textRenderer.height*Math.sin(W._textRenderer.angle)/2}break;case"end":O=-W.getWidth()+W._textRenderer.height*Math.sin(-W._textRenderer.angle)/2;break;case"start":O=-W._textRenderer.height*Math.sin(W._textRenderer.angle)/2;break;case"middle":O=-W.getWidth()/2+W._textRenderer.height*Math.sin(-W._textRenderer.angle)/2;break;default:O=-W.getWidth()/2+W._textRenderer.height*Math.sin(-W._textRenderer.angle)/2;break}}else{O=-W.getWidth()/2}var af=this.u2p(W.value)+O+"px";W._elem.css("left",af);W.pack()}}if(X){var U=this._label._elem.outerWidth(true);this._label._elem.css("left",T+R/2-U/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(var ab=0;ab<ae.length;ab++){var W=ae[ab];if(W.show&&W.showLabel){var O;if(W.constructor==w.jqplot.CanvasAxisTickRenderer&&W.angle){var ad=(this.name=="yaxis")?1:-1;switch(W.labelPosition){case"auto":case"end":if(ad*W.angle<0){O=-W._textRenderer.height*Math.cos(-W._textRenderer.angle)/2}else{O=-W.getHeight()+W._textRenderer.height*Math.cos(W._textRenderer.angle)/2}break;case"start":if(W.angle>0){O=-W._textRenderer.height*Math.cos(-W._textRenderer.angle)/2}else{O=-W.getHeight()+W._textRenderer.height*Math.cos(W._textRenderer.angle)/2}break;case"middle":O=-W.getHeight()/2;break;default:O=-W.getHeight()/2;break}}else{O=-W.getHeight()/2}var af=this.u2p(W.value)+O+"px";W._elem.css("top",af);W.pack()}}if(X){var ac=this._label._elem.outerHeight(true);this._label._elem.css("top",V-R/2-ac/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}ae=null};function e(O){O=Math.abs(O);if(O>1){return"%d"}var P=-Math.floor(Math.log(O)/Math.LN10);return"%."+P+"f"}function B(P,O){var Q=Math.floor(Math.log(P)/Math.LN10);var S=Math.pow(10,Q);var R=P/S;R=R/O;if(R<=0.38){return 0.1*S}if(R<=1.6){return 0.2*S}if(R<=4){return 0.5*S}if(R<=8){return S}if(R<=16){return 2*S}return 5*S}w.jqplot.LinearTickGenerator=function(Q,T,P){if(Q==T){T=(T)?0:1}P=P||1;if(T<Q){var O=T;T=Q;Q=O}var R=B(T-Q,P);var S=[];S[0]=Math.floor(Q/R)*R;S[1]=Math.ceil(T/R)*R;S[2]=Math.round((S[1]-S[0])/R+1);S[3]=e(R);S[4]=R;return S};w.jqplot.MarkerRenderer=function(O){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new w.jqplot.ShadowRenderer();this.shapeRenderer=new w.jqplot.ShapeRenderer();w.extend(true,this,O)};w.jqplot.MarkerRenderer.prototype.init=function(O){w.extend(true,this,O);var Q={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){Q.fill=true}if(this.style.indexOf("ircle")!=-1){Q.isarc=true;Q.closePath=false}this.shadowRenderer.init(Q);var P={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){P.fill=true}if(this.style.indexOf("ircle")!=-1){P.isarc=true;P.closePath=false}this.shapeRenderer.init(P)};w.jqplot.MarkerRenderer.prototype.drawDiamond=function(Q,P,T,S,V){var O=1.2;var W=this.size/2/O;var U=this.size/2*O;var R=[[Q-W,P],[Q,P+U],[Q+W,P],[Q,P-U]];if(this.shadow){this.shadowRenderer.draw(T,R)}this.shapeRenderer.draw(T,R,V)};w.jqplot.MarkerRenderer.prototype.drawPlus=function(R,Q,U,T,X){var P=1;var Y=this.size/2*P;var V=this.size/2*P;var W=[[R,Q-V],[R,Q+V]];var S=[[R+Y,Q],[R-Y,Q]];var O=w.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(U,W,{closePath:false});this.shadowRenderer.draw(U,S,{closePath:false})}this.shapeRenderer.draw(U,W,O);this.shapeRenderer.draw(U,S,O)};w.jqplot.MarkerRenderer.prototype.drawX=function(R,Q,U,T,X){var P=1;var Y=this.size/2*P;var V=this.size/2*P;var O=w.extend(true,{},this.options,{closePath:false});var W=[[R-Y,Q-V],[R+Y,Q+V]];var S=[[R-Y,Q+V],[R+Y,Q-V]];if(this.shadow){this.shadowRenderer.draw(U,W,{closePath:false});this.shadowRenderer.draw(U,S,{closePath:false})}this.shapeRenderer.draw(U,W,O);this.shapeRenderer.draw(U,S,O)};w.jqplot.MarkerRenderer.prototype.drawDash=function(Q,P,T,S,V){var O=1;var W=this.size/2*O;var U=this.size/2*O;var R=[[Q-W,P],[Q+W,P]];if(this.shadow){this.shadowRenderer.draw(T,R)}this.shapeRenderer.draw(T,R,V)};w.jqplot.MarkerRenderer.prototype.drawLine=function(T,S,O,R,P){var Q=[T,S];if(this.shadow){this.shadowRenderer.draw(O,Q)}this.shapeRenderer.draw(O,Q,P)};w.jqplot.MarkerRenderer.prototype.drawSquare=function(Q,P,T,S,V){var O=1;var W=this.size/2/O;var U=this.size/2*O;var R=[[Q-W,P-U],[Q-W,P+U],[Q+W,P+U],[Q+W,P-U]];if(this.shadow){this.shadowRenderer.draw(T,R)}this.shapeRenderer.draw(T,R,V)};w.jqplot.MarkerRenderer.prototype.drawCircle=function(P,V,R,U,S){var O=this.size/2;var Q=2*Math.PI;var T=[P,V,O,0,Q,true];if(this.shadow){this.shadowRenderer.draw(R,T)}this.shapeRenderer.draw(R,T,S)};w.jqplot.MarkerRenderer.prototype.draw=function(O,R,P,Q){Q=Q||{};if(Q.show==null||Q.show!=false){if(Q.color&&!Q.fillStyle){Q.fillStyle=Q.color}if(Q.color&&!Q.strokeStyle){Q.strokeStyle=Q.color}switch(this.style){case"diamond":this.drawDiamond(O,R,P,false,Q);break;case"filledDiamond":this.drawDiamond(O,R,P,true,Q);break;case"circle":this.drawCircle(O,R,P,false,Q);break;case"filledCircle":this.drawCircle(O,R,P,true,Q);break;case"square":this.drawSquare(O,R,P,false,Q);break;case"filledSquare":this.drawSquare(O,R,P,true,Q);break;case"x":this.drawX(O,R,P,true,Q);break;case"plus":this.drawPlus(O,R,P,true,Q);break;case"dash":this.drawDash(O,R,P,true,Q);break;case"line":this.drawLine(O,R,P,false,Q);break;default:this.drawDiamond(O,R,P,false,Q);break}}};w.jqplot.ShadowRenderer=function(O){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.strokeStyle="rgba(0,0,0,0.1)";this.isarc=false;w.extend(true,this,O)};w.jqplot.ShadowRenderer.prototype.init=function(O){w.extend(true,this,O)};w.jqplot.ShadowRenderer.prototype.draw=function(Y,W,aa){Y.save();var O=(aa!=null)?aa:{};var X=(O.fill!=null)?O.fill:this.fill;var V=(O.closePath!=null)?O.closePath:this.closePath;var S=(O.offset!=null)?O.offset:this.offset;var Q=(O.alpha!=null)?O.alpha:this.alpha;var U=(O.depth!=null)?O.depth:this.depth;var Z=(O.isarc!=null)?O.isarc:this.isarc;Y.lineWidth=(O.lineWidth!=null)?O.lineWidth:this.lineWidth;Y.lineJoin=(O.lineJoin!=null)?O.lineJoin:this.lineJoin;Y.lineCap=(O.lineCap!=null)?O.lineCap:this.lineCap;Y.strokeStyle=O.strokeStyle||this.strokeStyle||"rgba(0,0,0,"+Q+")";Y.fillStyle=O.fillStyle||this.fillStyle||"rgba(0,0,0,"+Q+")";for(var R=0;R<U;R++){Y.translate(Math.cos(this.angle*Math.PI/180)*S,Math.sin(this.angle*Math.PI/180)*S);Y.beginPath();if(Z){Y.arc(W[0],W[1],W[2],W[3],W[4],true)}else{if(W&&W.length){var P=true;for(var T=0;T<W.length;T++){if(W[T][0]!=null&&W[T][1]!=null){if(P){Y.moveTo(W[T][0],W[T][1]);P=false}else{Y.lineTo(W[T][0],W[T][1])}}else{P=true}}}}if(V){Y.closePath()}if(X){Y.fill()}else{Y.stroke()}}Y.restore()};w.jqplot.ShapeRenderer=function(O){this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.isarc=false;this.fillRect=false;this.strokeRect=false;this.clearRect=false;this.strokeStyle="#999999";this.fillStyle="#999999";w.extend(true,this,O)};w.jqplot.ShapeRenderer.prototype.init=function(O){w.extend(true,this,O)};w.jqplot.ShapeRenderer.prototype.draw=function(X,V,Z){X.save();var O=(Z!=null)?Z:{};var W=(O.fill!=null)?O.fill:this.fill;var T=(O.closePath!=null)?O.closePath:this.closePath;var U=(O.fillRect!=null)?O.fillRect:this.fillRect;var R=(O.strokeRect!=null)?O.strokeRect:this.strokeRect;var P=(O.clearRect!=null)?O.clearRect:this.clearRect;var Y=(O.isarc!=null)?O.isarc:this.isarc;X.lineWidth=O.lineWidth||this.lineWidth;X.lineJoin=O.lineJoin||this.lineJoin;X.lineCap=O.lineCap||this.lineCap;X.strokeStyle=(O.strokeStyle||O.color)||this.strokeStyle;X.fillStyle=O.fillStyle||this.fillStyle;X.beginPath();if(Y){X.arc(V[0],V[1],V[2],V[3],V[4],true);if(T){X.closePath()}if(W){X.fill()}else{X.stroke()}X.restore();return}else{if(P){X.clearRect(V[0],V[1],V[2],V[3]);X.restore();return}else{if(U||R){if(U){X.fillRect(V[0],V[1],V[2],V[3])}if(R){X.strokeRect(V[0],V[1],V[2],V[3]);X.restore();return}}else{if(V&&V.length){var Q=true;for(var S=0;S<V.length;S++){if(V[S][0]!=null&&V[S][1]!=null){if(Q){X.moveTo(V[S][0],V[S][1]);Q=false}else{X.lineTo(V[S][0],V[S][1])}}else{Q=true}}if(T){X.closePath()}if(W){X.fill()}else{X.stroke()}}}}}X.restore()};w.jqplot.TableLegendRenderer=function(){};w.jqplot.TableLegendRenderer.prototype.init=function(O){w.extend(true,this,O)};w.jqplot.TableLegendRenderer.prototype.addrow=function(X,R,O,V){var S=(O)?this.rowSpacing+"px":"0px";var W;var Q;var P;var U;var T;P=document.createElement("tr");W=w(P);W.addClass("jqplot-table-legend");P=null;if(V){W.prependTo(this._elem)}else{W.appendTo(this._elem)}if(this.showSwatches){Q=w(document.createElement("td"));Q.addClass("jqplot-table-legend");Q.css({textAlign:"center",paddingTop:S});U=w(document.createElement("div"));T=w(document.createElement("div"));T.addClass("jqplot-table-legend-swatch");T.css({backgroundColor:R,borderColor:R});W.append(Q.append(U.append(T)))}if(this.showLabels){Q=w(document.createElement("td"));Q.addClass("jqplot-table-legend");Q.css("paddingTop",S);W.append(Q);if(this.escapeHtml){Q.text(X)}else{Q.html(X)}}Q=null;U=null;T=null;W=null;P=null};w.jqplot.TableLegendRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}if(this.show){var T=this._series;var P=document.createElement("table");this._elem=w(P);this._elem.addClass("jqplot-table-legend");var Y={position:"absolute"};if(this.background){Y.background=this.background}if(this.border){Y.border=this.border}if(this.fontSize){Y.fontSize=this.fontSize}if(this.fontFamily){Y.fontFamily=this.fontFamily}if(this.textColor){Y.textColor=this.textColor}if(this.marginTop!=null){Y.marginTop=this.marginTop}if(this.marginBottom!=null){Y.marginBottom=this.marginBottom}if(this.marginLeft!=null){Y.marginLeft=this.marginLeft}if(this.marginRight!=null){Y.marginRight=this.marginRight}var O=false,V=false,X;for(var U=0;U<T.length;U++){X=T[U];if(X._stack||X.renderer.constructor==w.jqplot.BezierCurveRenderer){V=true}if(X.show&&X.showLabel){var S=this.labels[U]||X.label.toString();if(S){var Q=X.color;if(V&&U<T.length-1){O=true}else{if(V&&U==T.length-1){O=false}}this.renderer.addrow.call(this,S,Q,O,V);O=true}for(var R=0;R<w.jqplot.addLegendRowHooks.length;R++){var W=w.jqplot.addLegendRowHooks[R].call(this,X);if(W){this.renderer.addrow.call(this,W.label,W.color,O);O=true}}S=null}}}return this._elem};w.jqplot.TableLegendRenderer.prototype.pack=function(Q){if(this.show){if(this.placement=="insideGrid"){switch(this.location){case"nw":var P=Q.left;var O=Q.top;this._elem.css("left",P);this._elem.css("top",O);break;case"n":var P=(Q.left+(this._plotDimensions.width-Q.right))/2-this.getWidth()/2;var O=Q.top;this._elem.css("left",P);this._elem.css("top",O);break;case"ne":var P=Q.right;var O=Q.top;this._elem.css({right:P,top:O});break;case"e":var P=Q.right;var O=(Q.top+(this._plotDimensions.height-Q.bottom))/2-this.getHeight()/2;this._elem.css({right:P,top:O});break;case"se":var P=Q.right;var O=Q.bottom;this._elem.css({right:P,bottom:O});break;case"s":var P=(Q.left+(this._plotDimensions.width-Q.right))/2-this.getWidth()/2;var O=Q.bottom;this._elem.css({left:P,bottom:O});break;case"sw":var P=Q.left;var O=Q.bottom;this._elem.css({left:P,bottom:O});break;case"w":var P=Q.left;var O=(Q.top+(this._plotDimensions.height-Q.bottom))/2-this.getHeight()/2;this._elem.css({left:P,top:O});break;default:var P=Q.right;var O=Q.bottom;this._elem.css({right:P,bottom:O});break}}else{if(this.placement=="outside"){switch(this.location){case"nw":var P=this._plotDimensions.width-Q.left;var O=Q.top;this._elem.css("right",P);this._elem.css("top",O);break;case"n":var P=(Q.left+(this._plotDimensions.width-Q.right))/2-this.getWidth()/2;var O=this._plotDimensions.height-Q.top;this._elem.css("left",P);this._elem.css("bottom",O);break;case"ne":var P=this._plotDimensions.width-Q.right;var O=Q.top;this._elem.css({left:P,top:O});break;case"e":var P=this._plotDimensions.width-Q.right;var O=(Q.top+(this._plotDimensions.height-Q.bottom))/2-this.getHeight()/2;this._elem.css({left:P,top:O});break;case"se":var P=this._plotDimensions.width-Q.right;var O=Q.bottom;this._elem.css({left:P,bottom:O});break;case"s":var P=(Q.left+(this._plotDimensions.width-Q.right))/2-this.getWidth()/2;var O=this._plotDimensions.height-Q.bottom;this._elem.css({left:P,top:O});break;case"sw":var P=this._plotDimensions.width-Q.left;var O=Q.bottom;this._elem.css({right:P,bottom:O});break;case"w":var P=this._plotDimensions.width-Q.left;var O=(Q.top+(this._plotDimensions.height-Q.bottom))/2-this.getHeight()/2;this._elem.css({right:P,top:O});break;default:var P=Q.right;var O=Q.bottom;this._elem.css({right:P,bottom:O});break}}else{switch(this.location){case"nw":this._elem.css({left:0,top:Q.top});break;case"n":var P=(Q.left+(this._plotDimensions.width-Q.right))/2-this.getWidth()/2;this._elem.css({left:P,top:Q.top});break;case"ne":this._elem.css({right:0,top:Q.top});break;case"e":var O=(Q.top+(this._plotDimensions.height-Q.bottom))/2-this.getHeight()/2;this._elem.css({right:Q.right,top:O});break;case"se":this._elem.css({right:Q.right,bottom:Q.bottom});break;case"s":var P=(Q.left+(this._plotDimensions.width-Q.right))/2-this.getWidth()/2;this._elem.css({left:P,bottom:Q.bottom});break;case"sw":this._elem.css({left:Q.left,bottom:Q.bottom});break;case"w":var O=(Q.top+(this._plotDimensions.height-Q.bottom))/2-this.getHeight()/2;this._elem.css({left:Q.left,top:O});break;default:this._elem.css({right:Q.right,bottom:Q.bottom});break}}}}};w.jqplot.ThemeEngine=function(){this.themes={};this.activeTheme=null};w.jqplot.ThemeEngine.prototype.init=function(){var R=new w.jqplot.Theme({_name:"Default"});var U,P,T;for(U in R.target){if(U=="textColor"){R.target[U]=this.target.css("color")}else{R.target[U]=this.target.css(U)}}if(this.title.show&&this.title._elem){for(U in R.title){if(U=="textColor"){R.title[U]=this.title._elem.css("color")}else{R.title[U]=this.title._elem.css(U)}}}for(U in R.grid){R.grid[U]=this.grid[U]}if(R.grid.backgroundColor==null&&this.grid.background!=null){R.grid.backgroundColor=this.grid.background}if(this.legend.show&&this.legend._elem){for(U in R.legend){if(U=="textColor"){R.legend[U]=this.legend._elem.css("color")}else{R.legend[U]=this.legend._elem.css(U)}}}var Q;for(P=0;P<this.series.length;P++){Q=this.series[P];if(Q.renderer.constructor==w.jqplot.LineRenderer){R.series.push(new i())}else{if(Q.renderer.constructor==w.jqplot.BarRenderer){R.series.push(new E())}else{if(Q.renderer.constructor==w.jqplot.PieRenderer){R.series.push(new b())}else{if(Q.renderer.constructor==w.jqplot.DonutRenderer){R.series.push(new t())}else{if(Q.renderer.constructor==w.jqplot.FunnelRenderer){R.series.push(new H())}else{if(Q.renderer.constructor==w.jqplot.MeterGaugeRenderer){R.series.push(new r())}else{R.series.push({})}}}}}}for(U in R.series[P]){R.series[P][U]=Q[U]}}var O,S;for(U in this.axes){S=this.axes[U];O=R.axes[U]=new A();O.borderColor=S.borderColor;O.borderWidth=S.borderWidth;if(S._ticks&&S._ticks[0]){for(T in O.ticks){if(S._ticks[0].hasOwnProperty(T)){O.ticks[T]=S._ticks[0][T]}else{if(S._ticks[0]._elem){O.ticks[T]=S._ticks[0]._elem.css(T)}}}}if(S._label&&S._label.show){for(T in O.label){if(S._label[T]){O.label[T]=S._label[T]}else{if(S._label._elem){if(T=="textColor"){O.label[T]=S._label._elem.css("color")}else{O.label[T]=S._label._elem.css(T)}}}}}}this.themeEngine._add(R);this.themeEngine.activeTheme=this.themeEngine.themes[R._name]};w.jqplot.ThemeEngine.prototype.get=function(O){if(!O){return this.activeTheme}else{return this.themes[O]}};function z(P,O){return P-O}w.jqplot.ThemeEngine.prototype.getThemeNames=function(){var O=[];for(var P in this.themes){O.push(P)}return O.sort(z)};w.jqplot.ThemeEngine.prototype.getThemes=function(){var P=[];var O=[];for(var R in this.themes){P.push(R)}P.sort(z);for(var Q=0;Q<P.length;Q++){O.push(this.themes[P[Q]])}return O};w.jqplot.ThemeEngine.prototype.activate=function(ab,ag){var O=false;if(!ag&&this.activeTheme&&this.activeTheme._name){ag=this.activeTheme._name}if(!this.themes.hasOwnProperty(ag)){throw new Error("No theme of that name")}else{var T=this.themes[ag];this.activeTheme=T;var af,Z=false,Y=false;var P=["xaxis","x2axis","yaxis","y2axis"];for(ac=0;ac<P.length;ac++){var U=P[ac];if(T.axesStyles.borderColor!=null){ab.axes[U].borderColor=T.axesStyles.borderColor}if(T.axesStyles.borderWidth!=null){ab.axes[U].borderWidth=T.axesStyles.borderWidth}}for(var ae in ab.axes){var R=ab.axes[ae];if(R.show){var X=T.axes[ae]||{};var V=T.axesStyles;var S=w.jqplot.extend(true,{},X,V);af=(T.axesStyles.borderColor!=null)?T.axesStyles.borderColor:S.borderColor;if(S.borderColor!=null){R.borderColor=S.borderColor;O=true}af=(T.axesStyles.borderWidth!=null)?T.axesStyles.borderWidth:S.borderWidth;if(S.borderWidth!=null){R.borderWidth=S.borderWidth;O=true}if(R._ticks&&R._ticks[0]){for(var Q in S.ticks){af=S.ticks[Q];if(af!=null){R.tickOptions[Q]=af;R._ticks=[];O=true}}}if(R._label&&R._label.show){for(var Q in S.label){af=S.label[Q];if(af!=null){R.labelOptions[Q]=af;O=true}}}}}for(var aa in T.grid){if(T.grid[aa]!=null){ab.grid[aa]=T.grid[aa]}}if(!O){ab.grid.draw()}if(ab.legend.show){for(aa in T.legend){if(T.legend[aa]!=null){ab.legend[aa]=T.legend[aa]}}}if(ab.title.show){for(aa in T.title){if(T.title[aa]!=null){ab.title[aa]=T.title[aa]}}}var ac;for(ac=0;ac<T.series.length;ac++){var W={};var ad=false;for(aa in T.series[ac]){af=(T.seriesStyles[aa]!=null)?T.seriesStyles[aa]:T.series[ac][aa];if(af!=null){W[aa]=af;if(aa=="color"){ab.series[ac].renderer.shapeRenderer.fillStyle=af;ab.series[ac].renderer.shapeRenderer.strokeStyle=af;ab.series[ac][aa]=af}else{if(aa=="lineWidth"){ab.series[ac].renderer.shapeRenderer.lineWidth=af;ab.series[ac][aa]=af}else{if(aa=="markerOptions"){F(ab.series[ac].markerOptions,af);F(ab.series[ac].markerRenderer,af)}else{ab.series[ac][aa]=af}}}O=true}}}if(O){ab.target.empty();ab.draw()}for(aa in T.target){if(T.target[aa]!=null){ab.target.css(aa,T.target[aa])}}}};w.jqplot.ThemeEngine.prototype._add=function(P,O){if(O){P._name=O}if(!P._name){P._name=Date.parse(new Date())}if(!this.themes.hasOwnProperty(P._name)){this.themes[P._name]=P}else{throw new Error("jqplot.ThemeEngine Error: Theme already in use")}};w.jqplot.ThemeEngine.prototype.remove=function(O){if(O=="Default"){return false}return delete this.themes[O]};w.jqplot.ThemeEngine.prototype.newTheme=function(O,Q){if(typeof(O)=="object"){Q=Q||O;O=null}if(Q&&Q._name){O=Q._name}else{O=O||Date.parse(new Date())}var P=this.copy(this.themes.Default._name,O);w.jqplot.extend(P,Q);return P};function p(Q){if(Q==null||typeof(Q)!="object"){return Q}var O=new Q.constructor();for(var P in Q){O[P]=p(Q[P])}return O}w.jqplot.clone=p;function F(Q,P){if(P==null||typeof(P)!="object"){return}for(var O in P){if(O=="highlightColors"){Q[O]=p(P[O])}if(P[O]!=null&&typeof(P[O])=="object"){if(!Q.hasOwnProperty(O)){Q[O]={}}F(Q[O],P[O])}else{Q[O]=P[O]}}}w.jqplot.merge=F;w.jqplot.extend=function(){var T=arguments[0]||{},R=1,S=arguments.length,O=false,Q;if(typeof T==="boolean"){O=T;T=arguments[1]||{};R=2}if(typeof T!=="object"&&!toString.call(T)==="[object Function]"){T={}}for(;R<S;R++){if((Q=arguments[R])!=null){for(var P in Q){var U=T[P],V=Q[P];if(T===V){continue}if(O&&V&&typeof V==="object"&&!V.nodeType){T[P]=w.jqplot.extend(O,U||(V.length!=null?[]:{}),V)}else{if(V!==l){T[P]=V}}}}}return T};w.jqplot.ThemeEngine.prototype.rename=function(P,O){if(P=="Default"||O=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot rename from/to Default")}if(this.themes.hasOwnProperty(O)){throw new Error("jqplot.ThemeEngine Error: New name already in use.")}else{if(this.themes.hasOwnProperty(P)){var Q=this.copy(P,O);this.remove(P);return Q}}throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid")};w.jqplot.ThemeEngine.prototype.copy=function(O,Q,S){if(Q=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot copy over Default theme")}if(!this.themes.hasOwnProperty(O)){var P="jqplot.ThemeEngine Error: Source name invalid";throw new Error(P)}if(this.themes.hasOwnProperty(Q)){var P="jqplot.ThemeEngine Error: Target name invalid";throw new Error(P)}else{var R=p(this.themes[O]);R._name=Q;w.jqplot.extend(true,R,S);this._add(R);return R}};w.jqplot.Theme=function(O,P){if(typeof(O)=="object"){P=P||O;O=null}O=O||Date.parse(new Date());this._name=O;this.target={backgroundColor:null};this.legend={textColor:null,fontFamily:null,fontSize:null,border:null,background:null};this.title={textColor:null,fontFamily:null,fontSize:null,textAlign:null};this.seriesStyles={};this.series=[];this.grid={drawGridlines:null,gridLineColor:null,gridLineWidth:null,backgroundColor:null,borderColor:null,borderWidth:null,shadow:null};this.axesStyles={label:{},ticks:{}};this.axes={};if(typeof(P)=="string"){this._name=P}else{if(typeof(P)=="object"){w.jqplot.extend(true,this,P)}}};var A=function(){this.borderColor=null;this.borderWidth=null;this.ticks=new g();this.label=new k()};var g=function(){this.show=null;this.showGridline=null;this.showLabel=null;this.showMark=null;this.size=null;this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null};var k=function(){this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null;this.fontWeight=null};var i=function(){this.color=null;this.lineWidth=null;this.shadow=null;this.fillColor=null;this.showMarker=null;this.markerOptions=new v()};var v=function(){this.show=null;this.style=null;this.lineWidth=null;this.size=null;this.color=null;this.shadow=null};var E=function(){this.color=null;this.seriesColors=null;this.lineWidth=null;this.shadow=null;this.barPadding=null;this.barMargin=null;this.barWidth=null;this.highlightColors=null};var b=function(){this.seriesColors=null;this.padding=null;this.sliceMargin=null;this.fill=null;this.shadow=null;this.startAngle=null;this.lineWidth=null;this.highlightColors=null};var t=function(){this.seriesColors=null;this.padding=null;this.sliceMargin=null;this.fill=null;this.shadow=null;this.startAngle=null;this.lineWidth=null;this.innerDiameter=null;this.thickness=null;this.ringMargin=null;this.highlightColors=null};var H=function(){this.color=null;this.lineWidth=null;this.shadow=null;this.padding=null;this.sectionMargin=null;this.seriesColors=null;this.highlightColors=null};var r=function(){this.padding=null;this.backgroundColor=null;this.ringColor=null;this.tickColor=null;this.ringWidth=null;this.intervalColors=null;this.intervalInnerRadius=null;this.intervalOuterRadius=null;this.hubRadius=null;this.needleThickness=null;this.needlePad=null};var N=function(){this.syntax=N.config.syntax;this._type="jsDate";this.utcOffset=new Date().getTimezoneOffset*60000;this.proxy=new Date();this.options={};this.locale=N.regional.getLocale();this.formatString="";this.defaultCentury=N.config.defaultCentury;switch(arguments.length){case 0:break;case 1:if(f(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var Q=this.options=arguments[0];this.syntax=Q.syntax||this.syntax;this.defaultCentury=Q.defaultCentury||this.defaultCentury;this.proxy=N.createDate(Q.date)}else{this.proxy=N.createDate(arguments[0])}break;default:var O=[];for(var P=0;P<arguments.length;P++){O.push(arguments[P])}this.proxy=new Date(this.utcOffset);this.proxy.setFullYear.apply(this.proxy,O.slice(0,3));if(O.slice(3).length){this.proxy.setHours.apply(this.proxy,O.slice(3))}break}};N.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900};N.prototype.add=function(Q,P){var O=s[P]||s.day;if(typeof O=="number"){this.proxy.setTime(this.proxy.getTime()+(O*Q))}else{O.add(this,Q)}return this};N.prototype.clone=function(){return new N(this.proxy.getTime())};N.prototype.diff=function(P,S,O){P=new N(P);if(P===null){return null}var Q=s[S]||s.day;if(typeof Q=="number"){var R=(this.proxy.getTime()-P.proxy.getTime())/Q}else{var R=Q.diff(this.proxy,P.proxy)}return(O?R:Math[R>0?"floor":"ceil"](R))};N.prototype.getAbbrDayName=function(){return N.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]};N.prototype.getAbbrMonthName=function(){return N.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]};N.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"};N.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"};N.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)};N.prototype.getDate=function(){return this.proxy.getDate()};N.prototype.getDay=function(){return this.proxy.getDay()};N.prototype.getDayOfWeek=function(){var O=this.proxy.getDay();return O===0?7:O};N.prototype.getDayOfYear=function(){var P=this.proxy;var O=P-new Date(""+P.getFullYear()+"/1/1 GMT");O+=P.getTimezoneOffset()*60000;P=null;return parseInt(O/60000/60/24,10)+1};N.prototype.getDayName=function(){return N.regional[this.locale]["dayNames"][this.proxy.getDay()]};N.prototype.getFullWeekOfYear=function(){var R=this.proxy;var O=this.getDayOfYear();var Q=6-R.getDay();var P=parseInt((O+Q)/7,10);return P};N.prototype.getFullYear=function(){return this.proxy.getFullYear()};N.prototype.getGmtOffset=function(){var O=this.proxy.getTimezoneOffset()/60;var P=O<0?"+":"-";O=Math.abs(O);return P+y(Math.floor(O),2)+":"+y((O%1)*60,2)};N.prototype.getHours=function(){return this.proxy.getHours()};N.prototype.getHours12=function(){var O=this.proxy.getHours();return O>12?O-12:(O==0?12:O)};N.prototype.getIsoWeek=function(){var R=this.proxy;var Q=R.getWeekOfYear();var O=(new Date(""+R.getFullYear()+"/1/1")).getDay();var P=Q+(O>4||O<=1?0:1);if(P==53&&(new Date(""+R.getFullYear()+"/12/31")).getDay()<4){P=1}else{if(P===0){R=new N(new Date(""+(R.getFullYear()-1)+"/12/31"));P=R.getIsoWeek()}}R=null;return P};N.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()};N.prototype.getMinutes=function(){return this.proxy.getMinutes()};N.prototype.getMonth=function(){return this.proxy.getMonth()};N.prototype.getMonthName=function(){return N.regional[this.locale]["monthNames"][this.proxy.getMonth()]};N.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1};N.prototype.getSeconds=function(){return this.proxy.getSeconds()};N.prototype.getShortYear=function(){return this.proxy.getYear()%100};N.prototype.getTime=function(){return this.proxy.getTime()};N.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")};N.prototype.getTimezoneName=function(){var O=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return O[1]||O[2]||"GMT"+this.getGmtOffset()};N.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()};N.prototype.getWeekOfYear=function(){var O=this.getDayOfYear();var Q=7-this.getDayOfWeek();var P=parseInt((O+Q)/7,10);return P};N.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1000,0)};N.prototype.getYear=function(){return this.proxy.getYear()};N.prototype.next=function(O){O=O||"day";return this.clone().add(1,O)};N.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date();break;case 1:if(f(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var Q=this.options=arguments[0];this.syntax=Q.syntax||this.syntax;this.defaultCentury=Q.defaultCentury||this.defaultCentury;this.proxy=N.createDate(Q.date)}else{this.proxy=N.createDate(arguments[0])}break;default:var O=[];for(var P=0;P<arguments.length;P++){O.push(arguments[P])}this.proxy=new Date(this.utcOffset);this.proxy.setFullYear.apply(this.proxy,O.slice(0,3));if(O.slice(3).length){this.proxy.setHours.apply(this.proxy,O.slice(3))}break}};N.prototype.setDate=function(O){return this.proxy.setDate(O)};N.prototype.setFullYear=function(){return this.proxy.setFullYear.apply(this.proxy,arguments)};N.prototype.setHours=function(){return this.proxy.setHours.apply(this.proxy,arguments)};N.prototype.setMilliseconds=function(O){return this.proxy.setMilliseconds(O)};N.prototype.setMinutes=function(){return this.proxy.setMinutes.apply(this.proxy,arguments)};N.prototype.setMonth=function(){return this.proxy.setMonth.apply(this.proxy,arguments)};N.prototype.setSeconds=function(){return this.proxy.setSeconds.apply(this.proxy,arguments)};N.prototype.setTime=function(O){return this.proxy.setTime(O)};N.prototype.setYear=function(){return this.proxy.setYear.apply(this.proxy,arguments)};N.prototype.strftime=function(O){O=O||this.formatString||N.regional[this.locale]["formatString"];return N.strftime(this,O,this.syntax)};N.prototype.toString=function(){return this.proxy.toString()};N.prototype.toYmdInt=function(){return(this.proxy.getFullYear()*10000)+(this.getMonthNumber()*100)+this.proxy.getDate()};N.regional={en:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],formatString:"%Y-%m-%d %H:%M:%S"},fr:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthNamesShort:["Jan","Fév","Mar","Avr","Mai","Jun","Jul","Aoû","Sep","Oct","Nov","Déc"],dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],formatString:"%Y-%m-%d %H:%M:%S"},de:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],formatString:"%Y-%m-%d %H:%M:%S"},es:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado"],dayNamesShort:["Dom","Lun","Mar","Mi&eacute;","Juv","Vie","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},ru:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],formatString:"%Y-%m-%d %H:%M:%S"},ar:{monthNames:["كانون الثاني","شباط","آذار","نيسان","آذار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["السبت","الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة"],dayNamesShort:["سبت","أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة"],formatString:"%Y-%m-%d %H:%M:%S"},pt:{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},"pt-BR":{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"}};N.regional["en-US"]=N.regional["en-GB"]=N.regional.en;N.regional.getLocale=function(){var O=N.config.defaultLocale;if(document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){O=document.getElementsByTagName("html")[0].lang;if(!N.regional.hasOwnProperty(O)){O=N.config.defaultLocale}}return O};var q=24*60*60*1000;var y=function(O,R){O=String(O);var P=R-O.length;var Q=String(Math.pow(10,P)).slice(1);return Q.concat(O)};var s={millisecond:1,second:1000,minute:60*1000,hour:60*60*1000,day:q,week:7*q,month:{add:function(Q,O){s.year.add(Q,Math[O>0?"floor":"ceil"](O/12));var P=Q.getMonth()+(O%12);if(P==12){P=0;Q.setYear(Q.getFullYear()+1)}else{if(P==-1){P=11;Q.setYear(Q.getFullYear()-1)}}Q.setMonth(P)},diff:function(S,Q){var O=S.getFullYear()-Q.getFullYear();var P=S.getMonth()-Q.getMonth()+(O*12);var R=S.getDate()-Q.getDate();return P+(R/30)}},year:{add:function(P,O){P.setYear(P.getFullYear()+Math[O>0?"floor":"ceil"](O))},diff:function(P,O){return s.month.diff(P,O)/12}}};for(var G in s){if(G.substring(G.length-1)!="s"){s[G+"s"]=s[G]}}var u=function(S,R,P){if(N.formats[P]["shortcuts"][R]){return N.strftime(S,N.formats[P]["shortcuts"][R],P)}else{var O=(N.formats[P]["codes"][R]||"").split(".");var Q=S["get"+O[0]]?S["get"+O[0]]():"";if(O[1]){Q=y(Q,O[1])}return Q}};N.strftime=function(U,R,Q,V){var P="perl";var T=N.regional.getLocale();if(Q&&N.formats.hasOwnProperty(Q)){P=Q}else{if(Q&&N.regional.hasOwnProperty(Q)){T=Q}}if(V&&N.formats.hasOwnProperty(V)){P=V}else{if(V&&N.regional.hasOwnProperty(V)){T=V}}if(f(U)!="[object Object]"||U._type!="jsDate"){U=new N(U);U.locale=T}if(!R){R=U.formatString||N.regional[T]["formatString"]}var O=R||"%Y-%m-%d",W="",S;while(O.length>0){if(S=O.match(N.formats[P].codes.matcher)){W+=O.slice(0,S.index);W+=(S[1]||"")+u(U,S[2],P);O=O.slice(S.index+S[0].length)}else{W+=O;O=""}}return W};N.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"};N.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};N.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};N.createDate=function(Q){if(Q==null){return new Date()}if(Q instanceof Date){return Q}if(typeof Q=="number"){return new Date(Q)}var V=String(Q).replace(/^\s*(.+)\s*$/g,"$1");V=V.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");V=V.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var U=V.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(U&&U.length>3){var Z=parseFloat(U[3]);var T=N.config.defaultCentury+Z;T=String(T);V=V.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,U[1]+" "+U[2]+" "+T)}U=V.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);function Y(ad,ac){var ai=parseFloat(ac[1]);var ah=parseFloat(ac[2]);var ag=parseFloat(ac[3]);var af=N.config.defaultCentury;var ab,aa,aj,ae;if(ai>31){aa=ag;aj=ah;ab=af+ai}else{aa=ah;aj=ai;ab=af+ag}ae=aj+"/"+aa+"/"+ab;return ad.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,ae)}if(U&&U.length>3){V=Y(V,U)}var U=V.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);if(U&&U.length>3){V=Y(V,U)}var S=0;var P=N.matchers.length;var X,O,W=V;while(S<P){O=Date.parse(W);if(!isNaN(O)){return new Date(O)}X=N.matchers[S];if(typeof X=="function"){var R=X.call(N,W);if(R instanceof Date){return R}}else{W=V.replace(X[0],X[1])}S++}return NaN};N.daysInMonth=function(O,P){if(P==2){return new Date(O,1,29).getDate()==29?29:28}return[l,31,l,31,30,31,30,31,31,30,31,30,31][P]};N.matchers=[[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,"$2/$1/$3"],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,"$2/$3/$1"],function(R){var P=R.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(P){if(P[1]){var Q=this.createDate(P[1]);if(isNaN(Q)){return}}else{var Q=new Date();Q.setMilliseconds(0)}var O=parseFloat(P[2]);if(P[6]){O=P[6].toLowerCase()=="am"?(O==12?0:O):(O==12?12:O+12)}Q.setHours(O,parseInt(P[3]||0,10),parseInt(P[4]||0,10),((parseFloat(P[5]||0))||0)*1000);return Q}else{return R}},function(R){var P=R.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(P){if(P[1]){var Q=this.createDate(P[1]);if(isNaN(Q)){return}}else{var Q=new Date();Q.setMilliseconds(0)}var O=parseFloat(P[2]);Q.setHours(O,parseInt(P[3],10),parseInt(P[4],10),parseFloat(P[5])*1000);return Q}else{return R}},function(S){var Q=S.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(Q){var R=new Date();var T=N.config.defaultCentury;var V=parseFloat(Q[1]);var U=parseFloat(Q[3]);var P,O,W;if(V>31){O=U;P=T+V}else{O=V;P=T+U}var W=J(Q[2],N.regional[this.locale]["monthNamesShort"]);if(W==-1){W=J(Q[2],N.regional[this.locale]["monthNames"])}R.setFullYear(P,W,O);R.setHours(0,0,0,0);return R}else{return S}}];function J(Q,R){if(R.indexOf){return R.indexOf(Q)}for(var O=0,P=R.length;O<P;O++){if(R[O]===Q){return O}}return -1}function f(O){if(O===null){return"[object Null]"}return Object.prototype.toString.call(O)}w.jsDate=N;w.jqplot.sprintf=function(){function U(aa,W,X,Z){var Y=(aa.length>=W)?"":Array(1+W-aa.length>>>0).join(X);return Z?aa+Y:Y+aa}function R(Y){var X=new String(Y);for(var W=10;W>0;W--){if(X==(X=X.replace(/^(\d+)(\d{3})/,"$1"+w.jqplot.sprintf.thousandsSeparator+"$2"))){break}}return X}function Q(ab,aa,ad,Y,Z,X){var ac=Y-ab.length;if(ac>0){var W=" ";if(X){W="&nbsp;"}if(ad||!Z){ab=U(ab,Y,W,ad)}else{ab=ab.slice(0,aa.length)+U("",ac,"0",true)+ab.slice(aa.length)}}return ab}function V(ae,X,ac,Y,W,ab,ad,aa){var Z=ae>>>0;ac=ac&&Z&&{"2":"0b","8":"0","16":"0x"}[X]||"";ae=ac+U(Z.toString(X),ab||0,"0",false);return Q(ae,ac,Y,W,ad,aa)}function O(aa,ab,Y,W,Z,X){if(W!=null){aa=aa.slice(0,W)}return Q(aa,"",ab,Y,Z,X)}var P=arguments,S=0,T=P[S++];return T.replace(w.jqplot.sprintf.regex,function(ar,ad,ae,ah,au,ao,ab){if(ar=="%%"){return"%"}var ai=false,af="",ag=false,aq=false,ac=false,aa=false;for(var an=0;ae&&an<ae.length;an++){switch(ae.charAt(an)){case" ":af=" ";break;case"+":af="+";break;case"-":ai=true;break;case"0":ag=true;break;case"#":aq=true;break;case"&":ac=true;break;case"'":aa=true;break}}if(!ah){ah=0}else{if(ah=="*"){ah=+P[S++]}else{if(ah.charAt(0)=="*"){ah=+P[ah.slice(1,-1)]}else{ah=+ah}}}if(ah<0){ah=-ah;ai=true}if(!isFinite(ah)){throw new Error("$.jqplot.sprintf: (minimum-)width must be finite")}if(!ao){ao="fFeE".indexOf(ab)>-1?6:(ab=="d")?0:void (0)}else{if(ao=="*"){ao=+P[S++]}else{if(ao.charAt(0)=="*"){ao=+P[ao.slice(1,-1)]}else{ao=+ao}}}var ak=ad?P[ad.slice(0,-1)]:P[S++];switch(ab){case"s":if(ak==null){return""}return O(String(ak),ai,ah,ao,ag,ac);case"c":return O(String.fromCharCode(+ak),ai,ah,ao,ag,ac);case"b":return V(ak,2,aq,ai,ah,ao,ag,ac);case"o":return V(ak,8,aq,ai,ah,ao,ag,ac);case"x":return V(ak,16,aq,ai,ah,ao,ag,ac);case"X":return V(ak,16,aq,ai,ah,ao,ag,ac).toUpperCase();case"u":return V(ak,10,aq,ai,ah,ao,ag,ac);case"i":var Y=parseInt(+ak,10);if(isNaN(Y)){return""}var am=Y<0?"-":af;var ap=aa?R(String(Math.abs(Y))):String(Math.abs(Y));ak=am+U(ap,ao,"0",false);return Q(ak,am,ai,ah,ag,ac);case"d":var Y=Math.round(+ak);if(isNaN(Y)){return""}var am=Y<0?"-":af;var ap=aa?R(String(Math.abs(Y))):String(Math.abs(Y));ak=am+U(ap,ao,"0",false);return Q(ak,am,ai,ah,ag,ac);case"e":case"E":case"f":case"F":case"g":case"G":var Y=+ak;if(isNaN(Y)){return""}var am=Y<0?"-":af;var Z=["toExponential","toFixed","toPrecision"]["efg".indexOf(ab.toLowerCase())];var at=["toString","toUpperCase"]["eEfFgG".indexOf(ab)%2];var ap=Math.abs(Y)[Z](ao);ap=aa?R(ap):ap;ak=am+ap;return Q(ak,am,ai,ah,ag,ac)[at]();case"p":case"P":var Y=+ak;if(isNaN(Y)){return""}var am=Y<0?"-":af;var aj=String(Number(Math.abs(Y)).toExponential()).split(/e|E/);var X=(aj[0].indexOf(".")!=-1)?aj[0].length-1:aj[0].length;var al=(aj[1]<0)?-aj[1]-1:0;if(Math.abs(Y)<1){if(X+al<=ao){ak=am+Math.abs(Y).toPrecision(X)}else{if(X<=ao-1){ak=am+Math.abs(Y).toExponential(X-1)}else{ak=am+Math.abs(Y).toExponential(ao-1)}}}else{var W=(X<=ao)?X:ao;ak=am+Math.abs(Y).toPrecision(W)}var at=["toString","toUpperCase"]["pP".indexOf(ab)%2];return Q(ak,am,ai,ah,ag,ac)[at]();case"n":return"";default:return ar}})};w.jqplot.sprintf.thousandsSeparator=",";w.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g})(jQuery);
\ No newline at end of file
diff --git a/www/js/jquery.min.js b/www/js/jquery.min.js
new file mode 100644 (file)
index 0000000..8f3ca2e
--- /dev/null
@@ -0,0 +1,167 @@
+/*!
+ * jQuery JavaScript Library v1.4.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Nov 11 19:04:53 2010 -0500
+ */
+(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
+h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
+h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
+"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
+e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
+"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
+s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
+j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
+toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
+-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
+if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
+if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
+b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
+!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
+l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
+z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
+s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
+s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
+[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
+false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
+k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
+scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
+1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
+"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
+c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
+else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
+a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
+c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,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 sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
+colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(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(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
+1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
+l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
+"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
+if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
+a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
+attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
+b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
+c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
+arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
+d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
+c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
+w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
+8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
+"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;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=t.documentElement;d=t.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==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)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){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
+Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};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=
+c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
+var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
+"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
+xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
+B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.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 Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
+"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
+0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
+a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
+1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
+"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
+c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
+(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
+[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
+break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
+q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
+l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
+return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
+B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
+POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
+i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
+i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
+"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
+m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.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,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},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)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
+0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
+"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
+i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
+if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
+g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
+for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
+i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
+n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
+function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
+p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
+t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
+function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
+c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
+not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
+h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="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){var d=typeof a==="string"?c(a,b||this.context):
+c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},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",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")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
+b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
+e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===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 za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
+"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(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},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});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&&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,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
+else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
+c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
+b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
+this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
+prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
+b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
+1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
+d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
+jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
+zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
+h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
+if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
+d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
+e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
+"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
+!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
+getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
+script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
+!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
+false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
+A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
+b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
+c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
+c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
+encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
+[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
+e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
+if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
+3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
+d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
+d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
+"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
+1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
+d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
+Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
+var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
+this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
+this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
+c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
+b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
+h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
+for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
+parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
+height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
+f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
+"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
+e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
+c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
+c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
+b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
diff --git a/www/js/ppastats.js b/www/js/ppastats.js
new file mode 100644 (file)
index 0000000..4a1e5b8
--- /dev/null
@@ -0,0 +1,93 @@
+function ppastats_pkg() {
+    $(document).ready(function() {
+       var data_chart = [];
+       var ddts = data["ddts"];
+       var max_date = null;
+       var min_date = null;
+       
+       $("#ppa_owner").html(data["ppa_owner"]);
+       $("#ppa_name").html(data["ppa_name"]);
+       $("#pkg_name").html(data["name"]);
+       
+       $.each(data["versions"], function(i, v) {
+           var v_url = data["name"]+"_"+v+".html";
+           
+           $("#versions").append("<li><a href='"+v_url+"'>"+v+"</a></li>");
+       });
+       
+       $.each(ddts, function(i, item) {
+            var tm = item["time"];
+            var d = new Date(tm[0], tm[1]-1, tm[2], 0, 0, 0, 0);
+            var entry = [d, item["value"]];
+            data_chart.push(entry);
+           
+            if (max_date == null || max_date < d) {
+               max_date = d;
+            }
+           
+            if (min_date == null || min_date > d) { 
+               min_date = d;
+            }
+       });
+       
+       var plot1 = $.jqplot ('chart', [data_chart], {
+            axes: {
+               xaxis: {
+                    renderer:$.jqplot.DateAxisRenderer,
+                    tickOptions:{formatString:'%Y/%m/%d'},
+                    min: min_date,
+                    max: max_date
+               },
+               yaxis: {
+                    min: 0
+               }
+            },
+            series: [{lineWidth:1,showMarker:false}]
+       });
+    });
+}
+
+function ppastats_ver() {
+    $(document).ready(function() {
+       var data_chart = [];
+       var ddts = data["ddts"];
+       var max_date = null;
+       var min_date = null;
+       
+       $("#ppa_owner").html(data["ppa_owner"]);
+       $("#ppa_name").html(data["ppa_name"]);
+       $("#pkg_name").html(data["name"]);
+       
+       $.each(ddts, function(i, item) {
+            var tm = item["time"];
+            var d = new Date(tm[0], tm[1]-1, tm[2], 0, 0, 0, 0);
+            var entry = [d, item["value"]];
+            data_chart.push(entry);
+           
+            if (max_date == null || max_date < d) {
+               max_date = d;
+            }
+           
+            if (min_date == null || min_date > d) { 
+               min_date = d;
+            }
+       });
+       
+       var plot1 = $.jqplot ('chart', [data_chart], {
+            axes: {
+               xaxis: {
+                    renderer:$.jqplot.DateAxisRenderer,
+                    tickOptions:{formatString:'%Y/%m/%d'},
+                    min: min_date,
+                    max: max_date
+               },
+               yaxis: {
+                    min: 0
+               }
+            },
+            series: [{lineWidth:1,showMarker:false}]
+       });
+    });
+}
+                     
+                     
\ No newline at end of file