Browse Source

Creation on git

Sorunome 11 years ago
commit
efdb7b8c33
100 changed files with 12274 additions and 0 deletions
  1. 14 0
      omnomirc_www/404.php
  2. 123 0
      omnomirc_www/500.html
  3. 4 0
      omnomirc_www/502.html
  4. 39 0
      omnomirc_www/Administrative Options.txt
  5. 674 0
      omnomirc_www/COPYING
  6. 66 0
      omnomirc_www/Channels.php
  7. 6 0
      omnomirc_www/Features to be added.txt
  8. 132 0
      omnomirc_www/Load.php
  9. 7 0
      omnomirc_www/Login system layout.txt
  10. 0 0
      omnomirc_www/Login.php
  11. 88 0
      omnomirc_www/Omnom_Misc.js
  12. 130 0
      omnomirc_www/Omnom_Options.js
  13. 1064 0
      omnomirc_www/Omnom_Parser.js
  14. 718 0
      omnomirc_www/Omnom_Parser.js.s
  15. 97 0
      omnomirc_www/Omnom_Tab.js
  16. 111 0
      omnomirc_www/Options.html
  17. 7 0
      omnomirc_www/Source/cachefix.php
  18. 31 0
      omnomirc_www/Source/sign.php
  19. 31 0
      omnomirc_www/Source/sign.php~
  20. 27 0
      omnomirc_www/Source/sql.php
  21. 27 0
      omnomirc_www/Source/sql.php~
  22. 50 0
      omnomirc_www/Source/userlist.php
  23. 50 0
      omnomirc_www/Source/userlist.php~
  24. 110 0
      omnomirc_www/Update.php
  25. 1 0
      omnomirc_www/aFarkas-html5shiv-4525162/.gitattributes
  26. 1 0
      omnomirc_www/aFarkas-html5shiv-4525162/.gitignore
  27. 23 0
      omnomirc_www/aFarkas-html5shiv-4525162/build.xml
  28. BIN
      omnomirc_www/aFarkas-html5shiv-4525162/build/compiler.jar
  29. 11 0
      omnomirc_www/aFarkas-html5shiv-4525162/dist/html5shiv-printshiv.js
  30. 8 0
      omnomirc_www/aFarkas-html5shiv-4525162/dist/html5shiv.js
  31. 11 0
      omnomirc_www/aFarkas-html5shiv-4525162/readme.md
  32. 496 0
      omnomirc_www/aFarkas-html5shiv-4525162/src/html5shiv-printshiv.js
  33. 298 0
      omnomirc_www/aFarkas-html5shiv-4525162/src/html5shiv.js
  34. BIN
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/body-crash.jpg
  35. 103 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/iframed-tests.html
  36. 11 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/inline-mixed-media.css
  37. 8 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/inline-print-media.css
  38. 8 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/no-print.css
  39. BIN
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/paramtracer.swf
  40. 8 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/print-styles.css
  41. 3 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/print.css
  42. 9 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/data/screen.css
  43. 85 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/highcharts/area-basic.html
  44. 176 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/highcharts/highcharts.js
  45. 71 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/html5shiv.html
  46. 14 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/iframe.1-1.html
  47. 13 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/iframe.1-2.html
  48. 27 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/iframe.1.html
  49. 45 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/index.html
  50. 11 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/dashboard.xml
  51. 8 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/iframe.html
  52. 3 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/test.js
  53. 121 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/testinit.js
  54. 27 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/testrunner.js
  55. 128 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/testsuite.css
  56. 8 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/versioncheck.js
  57. 249 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/index.html
  58. 1249 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/unit/core.js
  59. 1701 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/unit/manipulation.js
  60. 642 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/unit/traversing.js
  61. 99 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/mixed-test.html
  62. 78 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/object-test.html
  63. 41 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/perf.1.html
  64. 28 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/perf.2.html
  65. 226 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/qunit/qunit.css
  66. 1597 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/qunit/qunit.js
  67. 11 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/style.all.css
  68. 2 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/style.css
  69. 5 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/style.print.css
  70. 281 0
      omnomirc_www/aFarkas-html5shiv-4525162/test/unit/tests.js
  71. BIN
      omnomirc_www/beep.wav
  72. 5 0
      omnomirc_www/brokenphp.php
  73. 348 0
      omnomirc_www/btoa.js
  74. 4 0
      omnomirc_www/callback.php
  75. 12 0
      omnomirc_www/dbinfo.sql
  76. BIN
      omnomirc_www/error.png
  77. 11 0
      omnomirc_www/html5shiv-printshiv.js
  78. 8 0
      omnomirc_www/html5shiv.js
  79. 185 0
      omnomirc_www/index.php
  80. 150 0
      omnomirc_www/install.php
  81. BIN
      omnomirc_www/knobs/.DS_Store
  82. BIN
      omnomirc_www/knobs/ICNS/Knob Add.icns
  83. BIN
      omnomirc_www/knobs/ICNS/Knob Attention.icns
  84. BIN
      omnomirc_www/knobs/ICNS/Knob Blue.icns
  85. BIN
      omnomirc_www/knobs/ICNS/Knob Cancel.icns
  86. BIN
      omnomirc_www/knobs/ICNS/Knob Download.icns
  87. BIN
      omnomirc_www/knobs/ICNS/Knob Fast Forward.icns
  88. BIN
      omnomirc_www/knobs/ICNS/Knob Fast Rewind.icns
  89. BIN
      omnomirc_www/knobs/ICNS/Knob Favorite.icns
  90. BIN
      omnomirc_www/knobs/ICNS/Knob Forward.icns
  91. BIN
      omnomirc_www/knobs/ICNS/Knob Graphite.icns
  92. BIN
      omnomirc_www/knobs/ICNS/Knob Green.icns
  93. BIN
      omnomirc_www/knobs/ICNS/Knob Grey.icns
  94. BIN
      omnomirc_www/knobs/ICNS/Knob Help.icns
  95. BIN
      omnomirc_www/knobs/ICNS/Knob Info.icns
  96. BIN
      omnomirc_www/knobs/ICNS/Knob Left.icns
  97. BIN
      omnomirc_www/knobs/ICNS/Knob Loop Off.icns
  98. BIN
      omnomirc_www/knobs/ICNS/Knob Loop On.icns
  99. BIN
      omnomirc_www/knobs/ICNS/Knob Message.icns
  100. BIN
      omnomirc_www/knobs/ICNS/Knob Orange.icns

+ 14 - 0
omnomirc_www/404.php

@@ -0,0 +1,14 @@
+<?php
+/* withgusto 404 Error Page */
+function issetor(&$variable, $or = NULL) {
+	return $variable === NULL ? $or : $variable;
+}
+
+echo('<b>Oops! You got lost in the woods! :/</b><br /><br />');
+if(issetor($_GET['q'])) {
+	echo('<i>(You tried to go to <b>'.$_GET['q'].'</b> but it does not exist!)</i><br />');
+} else {
+	echo('<i>(You tried to go somewhere that does not exist!)</i><br />');
+}
+echo('Try going to the <a href="/">home page</a> instead? ;)');
+?>

+ 123 - 0
omnomirc_www/500.html

@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html lang="en">
+<!-- withgusto 500 error page -->
+<head>
+	<title>Server Error: It's a Five Double-Oh!</title>
+	<meta charset="utf-8" />
+	<!-- Enable HTML5 in IE except for IE9 -->
+	<!--[if lt IE 9]>
+		<script src="html5shiv.js"></script>
+	<![endif]-->
+	
+	<!-- Fix the PNG transparency problem for IE6 and lower -->
+	<!--[if lte IE 6]>
+		<script type="text/javascript" src="supersleight-min.js"></script>
+	<![endif]-->
+	<script type="text/javascript">
+	function getParameterByName(name)
+	{
+	  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
+	  var regexS = "[\\?&]" + name + "=([^&#]*)";
+	  var regex = new RegExp(regexS);
+	  var results = regex.exec(window.location.search);
+	  if(results == null)
+	    return "";
+	  else
+	    return decodeURIComponent(results[1].replace(/\+/g, " "));
+	}
+	function safe_tags(str) {
+	    return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') ;
+	}
+	// This checks to see if the result is blank.
+	// If it is, return something special. Otherwise, just escape and return the result.
+	function getParameterByNameBC(name)
+	{
+	  tmp = getParameterByName(name);
+	  if(tmp == "") {
+	    return "<b>None</b>";
+	  } else {
+	    return safe_tags(tmp);
+	  }
+	}
+	
+	function getParameterByNameBool(name)
+	{
+	  tmp = getParameterByName(name);
+	  if(tmp == "1") {
+	    return "Yes";
+	  } else if (tmp == "0") {
+	    return "No";
+	  } else {
+	    return "Unknown (server said "+getParameterByNameBC(name)+")";
+	  }
+	}
+	</script>
+	<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
+	<style type="text/css">
+	html {
+		font-size: 100%;
+		overflow-y: scroll;
+		-webkit-text-size-adjust: 100%;
+		-ms-text-size-adjust: 100%;
+	}
+	body {
+		font-family: "PT Sans", Times, "Times New Roman", Arial, sans-serif;
+		font-size: 16px;
+	}
+	.info, .success, .warning, .error, .validation, .criticalerror {
+		border: 1px solid;
+		margin: 10px 0px;
+		padding:10px 10px 10px 50px; /* OLD: 15, 10, 15, 50 px */
+		background-repeat: no-repeat;
+		background-position: 10px center;
+		display: inline-block;
+		font-size: 14px;
+	}
+	.error {
+		color: #D8000C;
+		background-color: #FFBABA;
+		background-image: url('error.png');
+	}
+	.criticalerror {
+		color: #FFFFFF;
+		background-color: #8C0000;
+		background-image: url('error.png');
+	}
+	</style>
+</head>
+<body>
+<b>Oops! This webpage exploded into a million glittery pieces! :( (Error code 500!)</b><br /><br />
+Something bad happened internally - either the server is upset, or PHP
+is <a href="http://stackoverflow.com/questions/5317444/when-php-fatal-error-happens-nginx-reports-http-error-500-to-browser">throwing a tantrum</a>.<br />
+Notify the maintainer of this page first about this problem.<br />
+If the maintainer can't fix it or requests admin help, contact the admin!<br />
+Be sure to include the error details below.<br /><br />
+If you want to, you can try <script type="text/javascript">document.write("<a href='"+getParameterByNameBC("q")+"'>reloading</a> this page.");</script>
+<noscript>going to the page again.</noscript><br />
+Do NOT reload the current page; the page you have tried to access redirected to this error page.<br />
+(Don't use CTRL-R, F5, etc.)<br />
+Reloading this page will reload the error page, not the page you were looking for!
+<br /><br />
+
+<noscript>
+<div class="error">We detected that Javascript is disabled (or doesn't exist) for you.<br />
+Javascript must be enabled to show the error details below.<br />
+Please enable it and refresh this page (CTRL-R or F5).<br />
+If you are unable to enable Javascript (your browser doesn't support it,<br />
+security policy, etc.), send the URL of this page to the maintainer/admin.<br />
+This error page's URL contains all of the error information needed.</div><br /><br /></noscript>
+<div class="criticalerror">
+<b><u>Error details:</u></b><br />
+<b>Attempted to access page:</b> <script type="text/javascript">document.write(getParameterByNameBC("q"));</script><br />
+<b>Document root:</b> <script type="text/javascript">document.write(getParameterByNameBC("docroot"));</script><br />
+<b>Query String:</b> <script type="text/javascript">document.write(getParameterByNameBC("args"));</script><br />
+<b>Request filename:</b> <script type="text/javascript">document.write(getParameterByNameBC("fn"));</script><br />
+<b>Request type:</b> <script type="text/javascript">document.write(getParameterByNameBC("reqtype"));</script><br />
+<b>Accessed by:</b> <script type="text/javascript">document.write(getParameterByNameBC("remoteip"));</script><br />
+<b>HTTP User:</b> <script type="text/javascript">document.write(getParameterByNameBC("user"));</script><br />
+<b>PHP related error?</b> <script type="text/javascript">document.write(getParameterByNameBool("phprelated"));</script><br />
+</div>
+<br />
+Despite this page telling you that things are collapsing, it <i>is</i> <b><a href="http://validator.w3.org/check?uri=referer">HTML5 compliant</a></b>!
+</body>
+</html>

+ 4 - 0
omnomirc_www/502.html

@@ -0,0 +1,4 @@
+<b>Oops! The server exploded into a million glittery pieces! :(</b><br /><br />
+<i>(The server can't connect to PHP or another daemon. You should probably report<br />
+this to an admin immediately to get things back up!)</i>
+

+ 39 - 0
omnomirc_www/Administrative Options.txt

@@ -0,0 +1,39 @@
+IRC
+	Servers(irc.omnimaga.org,irc.freenode.net,irc.efnet.net)
+	Channels(#omnimaga,#omnimaga-fr,#freenode)
+	Servers said channels are on (#omnimaga(-fr) on omnimaga.org,efnet,#freenode on #freenode)
+	Bot name
+	Flood Limit
+
+OmnomIRC
+	Per-channel
+		bans
+		ops(@register marks user as op if opless)
+		invite
+
+	Global
+		bans(Username,IP)
+		set channel ops
+		manipulate channel modes
+
+	Settings
+		Retentition mode
+			Total lines (5000 lines)
+			Per Channel (100 per chan)
+			Time (last 4 days)
+	
+		click on name behaviour
+			go to profile
+			open PM window
+		
+		Misc. options
+			Show online users join/parts
+			
+		Server options
+			MySQL
+				Server
+				Username
+				Password
+				Persistant connection
+			Maintenance mode
+				

+ 674 - 0
omnomirc_www/COPYING

@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 66 - 0
omnomirc_www/Channels.php

@@ -0,0 +1,66 @@
+<?PHP	
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+	include("/path/to/omnomirc_www/folder/Source/sign.php");
+	//Set the channels here.
+	//$channels[]=Array("#channel",AlwaysShow);
+	$channels=Array();
+	$channels[]=Array("#chan1",true);//Default chan, 'cause it's the first in the array.
+	$channels[]=Array("#chan2",true);
+	$exChans=Array();
+	$exChans[]=Array("#chan",false);
+?>
+<?PHP
+	
+	if (!isset($IRCBOT))
+	{
+		//Output for Javascript.
+		header('Content-type: text/javascript');
+		$chanStr = "";
+		foreach ($channels as $chan)
+			if ($chan[1])$chanStr = $chanStr . '"'.base64_url_encode($chan[0]).'",';
+		$chanStr = substr($chanStr,0,-1);
+		
+		echo "var channels=[";
+		echo $chanStr;
+		echo "];";
+		
+		$exChanStr = "";
+		foreach ($channels as $chan)
+			if (!$chan[1])$exChanStr = $exChanStr . '"'.base64_url_encode($chan[0]).'",';
+		$exChanStr = substr($exChanStr,0,-1);
+		
+		echo "var exChannels=[";
+		echo $exChanStr;
+		echo "];";
+	}
+	else
+	{
+		//Output for PHP
+		$chanStr = "";
+		foreach ($exChans as $chan)
+			$channels[] = $chan;
+		foreach ($channels as $chan)
+			$chanStr = $chanStr .$chan[0].',';
+		
+		$chanStr = substr($chanStr,0,-1);
+	}
+?>
+
+

+ 6 - 0
omnomirc_www/Features to be added.txt

@@ -0,0 +1,6 @@
+Name 			Dependencies
+Login system - 
+Channel Modes - Login System
+Administration - Login System
+Forum Plugins - Login System
+Channel List - 

+ 132 - 0
omnomirc_www/Load.php

@@ -0,0 +1,132 @@
+<?PHP
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+	#error_reporting(E_ALL);
+	#ini_set('display_errors', '1');
+	include("Source/cachefix.php"); //This must be the first line in every file.
+	header('Content-type: text/javascript');
+	include("Source/sql.php");
+	include("Source/sign.php");
+	include("Source/userlist.php");
+	ob_start();
+	
+	$count = $_GET['count'];
+	$channel = "#omnimaga";
+	if (isset($_GET['channel']))
+		$channel = base64_url_decode($_GET['channel']);
+	$nick = "0";
+	if (isset($_GET['nick']))
+	{
+		$nick = base64_url_decode($_GET['nick']);
+		$signature = base64_url_decode($_GET['signature']);
+		if ($signature != base64_url_encode(sign($nick)))
+			$nick = "0";
+	}
+	
+	if ($channel[0] == "*") //PM
+	{
+		$sender = substr($channel,1);
+		$channel = $nick;
+		$res = sql_query("SELECT x.* FROM (
+													SELECT * FROM `irc_lines` 
+													WHERE 
+													(`channel` = '%s'
+													AND `name1` = '%s')
+													OR
+													(`channel` = '%s'
+													AND `name1` = '%s')
+													ORDER BY `line_number` DESC 
+													LIMIT %s
+												) AS x
+												ORDER BY `line_number` ASC",$channel,$sender,$sender,$channel,$count + 0);
+	}
+	else
+	{
+		$res = sql_query("SELECT x.* FROM (
+													SELECT * FROM `irc_lines` 
+													WHERE `channel` = '%s' OR `channel` = '%s'
+													ORDER BY `line_number` DESC 
+													LIMIT %s
+												) AS x
+												ORDER BY `line_number` ASC",$channel,$nick,$count + 0);
+	}
+	echo "void('$nick');";
+	while ($result = mysql_fetch_array($res))
+	{
+		//Sorunome edit START
+		$userSql = mysql_fetch_array(sql_query("SELECT * FROM `irc_ignorelist` WHERE name='%s'",strtolower($nick)));
+		$ignorelist = "";
+		if ($userSql["name"]!=NULL) {
+			$ignorelist = $userSql["ignores"];
+		}
+		//Sorunome edit END
+		if (strpos($userSql["ignores"],strtolower($result["name1"])."\n")===false) { //Sorunome edit
+			echo "addLine('";
+			switch (strtolower($result['type']))
+			{
+				case "pm":
+				case "message":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result['message'])) . ':' . base64_url_encode(htmlspecialchars("0"));break;
+				case "action":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result['message'])) . ':' . base64_url_encode(htmlspecialchars("0"));break;
+				case "join":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1']));break;
+				case "part":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+				case "kick":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["name2"])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+				case "quit":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+				case "mode":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+				case "nick":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["name2"]));break;
+				case "server":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+				case "topic":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+			}
+			echo "');";
+		} //Sorunome edit
+	}
+	
+	$curMax = mysql_fetch_array(sql_query("SELECT MAX(`line_number`) FROM `irc_lines`"));
+	echo "addLine('" . $curMax[0] . ":curline');";
+	//Sorunome edit START
+	$curtopic = mysql_fetch_array(sql_query("SELECT * FROM `irc_topics` WHERE `chan`='%s'",strtolower($channel)));
+	echo "addLine('" . $curMax[0] . ":topic:0:" . time() . "::" . base64_url_encode($curtopic["topic"]) . "');";
+	//Sorunome edit END
+	$users = Array();
+	
+	$result = sql_query("SELECT * FROM `irc_users` WHERE `channel`='%s'",$channel);
+	while ($user = mysql_fetch_array($result))
+	{
+		$users[count($users)][0] = strtolower($user['username']);
+		$users[count($users) - 1][1] = $user['username'];
+		$users[count($users) - 1][2] = $user['online'];
+		$users[count($users) - 1][3] = $user['channel'];
+	}
+	
+	asort($users);
+	foreach ($users as $user)
+	{
+		echo "addUser('" . base64_url_encode(htmlspecialchars($user[1])) . ":" . $user[2] . "');";
+	}
+	ob_end_flush();
+?>

+ 7 - 0
omnomirc_www/Login system layout.txt

@@ -0,0 +1,7 @@
+Step 1: User hits index.php
+Step 2: index.php hits login.php, which will be replacable(SMF,phpBB,etc... versions)
+Step 3: login.php will encrypt user data and send it to the forums (OmnomIRC_Login.php, for example). The forums will decrypt it and check it's validity. This will require my own cookies for user info.
+ALTERNATIVE
+Step 3: login.php will load an iframe to a remote page that will redirect to a local null page. It will then rip the signature from a paramater on the page. This will use the sites' cookies.
+Step 4: OmnomIRC_Login.php will return either a signature for the user, or 'INVALID', based off of the result of its check
+Step 5: If Invalid, go to the forum to login, or own login. If valid, yay!

+ 0 - 0
omnomirc_www/Login.php


+ 88 - 0
omnomirc_www/Omnom_Misc.js

@@ -0,0 +1,88 @@
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/ 
+
+//******************************
+// Start Indicator functions   *
+//******************************
+indicatorTimer = false;
+function startIndicator() {
+	if (!indicatorTimer) {
+		indicatorTimer = setInterval(updateIndicator,50);
+		indicatorPixels = Array(true,true,true,true,true,false,false,false);
+	}
+}
+function updateIndicator() {
+	var indicator = document.getElementById('indicator');
+	indicator.innerHTML = "";
+	for (var i=0;i<8;i++) {
+		if (indicatorPixels[i])
+			indicator.innerHTML+="<div style='padding:0;margin:0;width:3px;height:3px;background-color:black;'></div>";
+		else
+			indicator.innerHTML+="<div style='padding:0;margin:0;width:3px;height:3px;'></div>";
+	}
+	var temp = indicatorPixels[7];
+	for (i=6;i>=0;i--) {
+		indicatorPixels[(i+1)] = indicatorPixels[i];
+	}
+	indicatorPixels[0] = temp;
+}
+function stopIndicator() {
+	clearInterval(indicatorTimer);
+	document.getElementById('indicator').innerHTML = '';
+	indicatorTimer = false;
+}
+//******************************
+// End Indicator functions     *
+//******************************
+
+//******************************
+// Start old messages functions*
+//******************************
+var oldMessages = new Array();
+var messageCounter = 1;
+var currentMessage;
+window.addEventListener('keydown',function(e) {
+	if (document.activeElement.id=="message") {
+		var messageBoxElement = document.getElementById("message");
+		if (messageCounter==oldMessages.length)currentMessage=messageBoxElement.value;
+		if (oldMessages.length!=0) {
+			if (e.keyCode==38) { //up
+				if (messageCounter!=0)messageCounter--;
+				messageBoxElement.value = oldMessages[messageCounter];
+			} else if (e.keyCode==40) { //down
+				if (messageCounter!=oldMessages.length)messageCounter++;
+				if (messageCounter==oldMessages.length) {
+					messageBoxElement.value = currentMessage;
+				} else {
+					messageBoxElement.value = oldMessages[messageCounter];
+				}
+			}
+		}
+	}
+}, false);
+function readOldMessagesCookies() {
+	oldMessages = Array();
+	var temp = getCookie("oldMessages-"+getChannelEn());
+	if (temp!=null)
+		oldMessages = temp.split("\n");
+	messageCounter = oldMessages.length;
+}
+//******************************
+// End old messages functions  *
+//******************************

+ 130 - 0
omnomirc_www/Omnom_Options.js

@@ -0,0 +1,130 @@
+
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC is free software: you can redistribute it and/or modifys
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+//******************************
+// Option Engine Start         *
+//******************************
+    var Options = "----------------------------------------|"; //40 for future expansion!(and 40 bytes isn't much.) Pipe is a terminator.
+    function cookieLoad() {
+        if (document.cookie.indexOf("OmnomIRC") >= 0) {
+            Options = document.cookie.replace(/^.*OmnomIRC=(.+?)|.*/, "\$1");
+        }
+        else {
+            document.cookie = "OmnomIRC=" + Options + ";expires=Sat, 20 Nov 2286 17:46:39 GMT;";
+        }
+    }
+	
+    function getOption(Option,def) { //Returns what 'Option' is. Option must be a number 1-40. def is what to return if it is not set(equal to -)
+        if (Option < 1 || Option > 40)
+            return 0;
+        result = Options.charAt(Option - 1);
+        result;
+        if (result == '-')
+            return def;
+        return result;
+            
+    }
+	
+    function setOption(Option, value,noRefresh) { //Sets 'Option' to 'value'. Value must be a single char. Option must be a number 1-40.
+        if (Option < 1 || Option > 40)
+            return;
+        Options = Options.substring(0, Option - 1) + value + Options.substring(Option);
+        document.cookie = "OmnomIRC=" + Options + ";expires=Sat, 20 Nov 2286 17:46:39 GMT;";
+        if (!noRefresh)
+			document.location.reload();
+    }
+	
+    function getHTMLToggle(State, StateOn, StateOff,StateOnFunc,StateOffFunc) {
+        result = "";
+        if (State){
+            result += "<b>";
+            result += StateOn;
+            result += "</b>";
+        }
+        else
+        {
+            result += '<a href="#" onclick="'+StateOnFunc+'">';
+            result += StateOn;
+            result += '</a>';
+        }
+        result += "</td><td>";
+        if (!State)
+        {
+            result += "<b>";
+            result += StateOff;
+            result += "</b>";
+        }
+        else
+        {
+            result += '<a href="#" onclick="'+StateOffFunc+'">';
+            result += StateOff;
+            result += '</a>';
+        }
+        return result;
+    }
+	function clearCookies()
+	{
+		document.cookie = "OmnomIRC=a;expires=Thu, 01-Jan-1970 00:00:01 GMT;";
+		document.cookie = "OmnomChannels=a;expires=Thu, 01-Jan-1970 00:00:01 GMT;";
+		document.location.reload();
+	}
+	window.onLoad=cookieLoad();
+//******************************
+// Option Engine End           *
+//******************************
+
+//******************************
+// Chrome Notification Start   *
+//******************************
+
+	function showNotification(message)
+	{
+		if (window.webkitNotifications == undefined || window.webkitNotifications == null || !window.webkitNotifications)
+			return 0;
+		if (window.webkitNotifications.checkPermission() != 0)
+			return 0;
+		var n
+		n = window.webkitNotifications.createNotification('http://www.omnimaga.org/favicon.ico', 'OmnomIRC Highlight', message);
+		n.show();
+	}
+	
+	function setAllowNotification()
+	{
+		if (window.webkitNotifications == undefined || window.webkitNotifications == null || !window.webkitNotifications)
+		{
+			alert("This feature only works in chrome.");
+			return;
+		}
+		window.webkitNotifications.requestPermission(permissionGranted);
+			
+	}
+	
+	function permissionGranted()
+	{
+		if (window.webkitNotifications.checkPermission() == 0)
+		{
+			showNotification("Notifications Enabled!");
+			setOption(7,'T');
+			window.location.refresh(true);
+		}
+	}
+//******************************
+// Chrome Notification End     *
+//******************************

+ 1064 - 0
omnomirc_www/Omnom_Parser.js

@@ -0,0 +1,1064 @@
+
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+document.domain=HOSTNAME;
+
+messageList = Array();
+UserListArr = Array();
+curLine = 0;
+//messageBox = document.getElementById("MessageBox");
+messageBox = document.createElement("table");
+messageBox.style.width="100%";
+messageBox.style.height="100%";
+messageBox.className='MessageBox';
+mBoxCont = document.getElementById("mboxCont");
+Userlist = Array();
+scrolledDown = true;
+//******************************
+// Start Request Loop functions*
+//******************************
+	function startLoop()
+	{
+		xmlhttp=getAjaxObject();
+		if (xmlhttp==null) { 
+			alert ("Your browser does not support AJAX! Please update for OmnomIRC compatibility.");
+			return;
+		}
+		xmlhttp.onreadystatechange=getIncomingLine;
+		sendRequest();
+	}
+	inRequest = false;
+	errorCount = 0;
+	function cancelRequest()
+	{
+		xmlhttp.abort();
+		inRequest = false;
+	}
+	function sendRequest()
+	{
+		if (inRequest)
+			return;
+		url = "Update.php?lineNum=" + curLine + "&channel=" + getChannelEn() + "&nick=" + base64.encode(userName) + "&signature=" + base64.encode(Signature);
+		xmlhttp.open("GET",url,true);
+		if (isBlurred()){
+			setTimeout("xmlhttp.send(null);",2500); //Only query every 2.5 seconds maximum if not foregrounded.
+		}
+		else
+		{
+			setTimeout("xmlhttp.send(null);",75); //Wait for everything to get parsed before requesting again.
+		}
+		inRequest = true;
+	}
+	
+	function getIncomingLine()
+	{
+		if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") { 
+			inRequest = false;
+			if (xmlhttp.responseText == "Could not connect to SQL DB." || xmlhttp.status != 200) 
+			{
+				errorCount++;
+				if (errorCount == 10)
+				{
+					OmnomIRC_Error("OmnomIRC has lost connection to server. Please refresh to reconnect.");
+					return;
+				}
+				else
+				{
+					sendRequest();
+					return;
+				}
+			}
+			if (xmlhttp.status == 200) addLines(xmlhttp.responseText); //Filter out 500s from timeouts
+			errorCount = 0;
+			sendRequest();
+		}
+	}
+	
+	function getAjaxObject()
+	{
+		xmlhttp=new XMLHttpRequest(); //Decent Browsers
+		if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");  //IE7+
+		if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //IE6-
+		return xmlhttp;
+	}
+	
+//******************************
+// End Request Loop functions  *
+//******************************
+
+//******************************
+// Start Parser                *
+//******************************
+	function addLines(message)
+	{
+		parts = message.split("\n");
+		for (var i=0;i<parts.length;i++)
+		{
+			if (parts[i].length > 2)
+			{
+				addLine(parts[i]);
+			}
+		}
+	}
+	function addLine(message)
+	{
+		if (!message || message == null || message == undefined)
+			return;
+		lnNum = parseInt(message.split(":")[0]);
+		curLine = parseInt(curLine);
+		if (lnNum > curLine)
+			curLine = lnNum;
+		doScroll = false;
+		if (mBoxCont.clientHeight + mBoxCont.scrollTop > mBoxCont.scrollHeight - 50) doScroll = true;
+		//messageBox = document.getElementById("MessageBox");
+		/*
+		if ("\v" != "v") //If IE, take the slow but sure route (This is enough of a performance hit in all browsers to use the optimized code if possible. Also, IE can go fuck itself.)
+			mBoxCont.innerHTML = '<table style="width:100%" class="messageBox" id="MessageBox">' + messageBox.innerHTML + parseMessage(message) + '</table>';
+		else //If not IE, yay!
+			messageBox.innerHTML = messageBox.innerHTML + parseMessage(message);*/
+		var row = parseMessage(message);
+		if (row)
+			messageBox.appendChild(row);
+		if (doScroll)mBoxCont.scrollTop = mBoxCont.scrollHeight + 50;
+	}
+	
+	function parseMessage(message) //type of message
+	{
+		a = message;
+		var parts = message.split(":");
+		lnumber = parts[0];
+		type = parts[1];
+		online = parts[2];
+		parsedMessage = "";
+		
+		for (i = 4;i < parts.length;i++)
+			parts[i] = base64.decode(parts[i]);
+		name = clickable_names(parts[4],online);
+		var undefined;
+		if (parts[5] == undefined || parts[5] == "")
+			parts[5] = " ";
+		if (parts[5] != undefined && parts[5] != null)
+		{
+			parsedMessage = parseColors(parts[5]);
+			if (parts[5].toLowerCase().indexOf(userName.toLowerCase().substr(0,4)) >= 0 && hasLoaded && notifications && parts[4].toLowerCase() != "new")
+			{
+				showNotification("<" + parts[4] + "> " + parts[5]);
+				if (highDing)
+				{
+					document.getElementById('ding').play();
+				}
+			}
+		}
+		if ((type == "message" || type == "action") && parts[4].toLowerCase() != "new")
+		{
+			parsedMessage = parseHighlight(parsedMessage);
+		}
+		retval = "";
+		displayMessage = true;
+		tdTime = document.createElement('td');
+		tdTime.className="irc-date";
+		tdName = document.createElement('td');
+		tdName.className="name";
+		tdName.innerHTML = '*';
+		tdMessage = document.createElement('td');
+		tdMessage.className=type;
+		switch (type)
+		{
+			case "reload":
+				startIndicator();
+				cancelRequest();
+				hasLoaded = false;
+				scrolledDown = true;
+				curLine = 0;
+				UserListArr = Array();
+				userListDiv.innerHTML = "";
+				drawChannels();
+				var body= document.getElementsByTagName('body')[0];
+				var script= document.createElement('script');
+				script.type= 'text/javascript';
+				script.src= 'Load.php?count=125&channel=' + getChannelEn() + "&nick=" + base64.encode(userName) + "&signature=" + base64.encode(Signature) + "&time=" + (new Date).getTime();;
+				script.onload= function(){parseUsers();startLoop();mBoxCont.scrollTop = mBoxCont.scrollHeight;hasLoaded = true;stopIndicator();};
+				body.appendChild(script);
+				displayMessage = false;
+				break;
+			case "join":
+				tdMessage.innerHTML = name + " has joined "+getChannelDe();
+				addUserJoin(parts[4],online);
+				if (online == "1")
+					return "";
+				break;
+			case "part":
+				tdMessage.innerHTML = name + " has left "+getChannelDe()+" (" + parsedMessage + ")";
+				removeUser(parts[4]);
+				if (online == "1")
+					return "";
+				break;
+			case "quit":
+				tdMessage.innerHTML = name + " has quit IRC (" + parsedMessage + ")";
+				removeUser(parts[4]);
+				break;
+			case "kick":
+				tdMessage.innerHTML = name + " has kicked " + parts[5] + " from "+getChannelDe()+" (" + parts[6] + ")";
+				removeUser(parts[4]);
+				break;
+			case "message":
+				tdName.innerHTML = name;
+				tdMessage.innerHTML = parsedMessage;break;
+			case "action":
+				tdMessage.innerHTML = name + " " + parsedMessage;break;
+			case "mode":
+				tdMessage.innerHTML = name + " set "+getChannelDe()+" mode " + parts[5];break;
+			case "nick":
+				tdMessage.innerHTML = name + " has changed his nick to " + parsedMessage;
+				removeUser(parts[4]);
+				addUserJoin(parts[5],online);
+				break;
+			case "topic":
+				if (name!="" && name!="undefined" && name!=" " && (typeof name != 'undefined')) {
+					tdMessage.innerHTML = name + " has changed the topic to " + parsedMessage;
+				} else {
+					displayMessage = false;
+				}
+				setTopic(parsedMessage);
+				break;
+			case "internal":
+				tdMessage.innerHTML = parts[4];
+			break;
+			case "server":
+				tdMessage.innerHTML = parsedMessage;
+				break;
+			case "pm":
+				if (getChannelDe().toLowerCase() != ("*" + parts[4]).toLowerCase() && parts[4] != userName)//Not in the PM window
+				{
+					if (!hasLoaded)
+						return "";
+					tdMessage.innerHTML = parsedMessage;
+					tdName.innerHTML = "(PM)" + name;
+					if (hasLoaded)
+					{
+						openPMWindow(parts[4]);
+						if (notifications)
+							showNotification("(PM) <" + parts[4] + "> " + parts[5]);
+						if (highDing)
+								document.getElementById('ding').play();
+						document.getElementById("*" + parts[4]).style.color="#C22";
+					}
+				}
+				else
+				{
+					tdMessage.className="message";
+					tdMessage.innerHTML = parsedMessage; //In the PM window
+					tdName.innerHTML = name;
+				}
+			break;
+			case "curline":
+				return "";
+			break;
+			case "highlight":
+				if (parts[6].toLowerCase() == "new") return "";
+				//document.getElementById(parts[4]).style.color="#C22"; //This call will fail if they aren't in the chan. Crude, but effective.
+				if (notifications)
+					showNotification("(" + parts[4] + ") <" + parts[6] + "> " + parts[7]);
+				if (highDing)
+					document.getElementById('ding').play();
+				
+				
+				return "";
+			break;
+			case "default":
+				return "";
+			break;
+		}
+		var row = document.createElement("tr");
+		
+		//pretag = '<tr style="width:100%;">';
+		doHigh = !doHigh;
+		if (lineHigh && doHigh && displayMessage)
+		{
+			//pretag = '<tr style="width:100%;" class="linehigh">';
+			row.className = "linehigh";
+		}
+		doLineHigh = !doLineHigh;
+		if (type != "internal") d = new Date(parts[3]*1000);
+		if (type == "internal") 
+		{
+			d = new Date();
+		}
+		tdTime.innerHTML = '[' + d.toLocaleTimeString() + ']';
+		tdTime.style.height="1px";
+		tdName.style.height="1px";
+		tdMessage.style.height="1px";
+		if (showTime) row.appendChild(tdTime);
+		row.appendChild(tdName);
+		row.appendChild(tdMessage);
+		
+		row.style.width="100%";
+		row.style.height="1px";
+		refreshThis(row);
+		if (tdName.innerHTML == "*")
+			statusTxt = tdName.innerHTML + " ";
+		else
+			statusTxt = "<" + StripHTML(tdName.innerHTML) + "> ";			
+		if (showTime)
+			statusTxt = "[" + d.toLocaleTimeString() + "] " + statusTxt;
+			
+		statusTxt = statusTxt + StripHTML(tdMessage.innerHTML);
+		changeStatusBarText(statusTxt);
+		if (displayMessage)
+			return row;
+		else
+			return;
+	}
+	function fixMBoxContHeight() {
+		mBoxCont.scrollTop = mBoxCont.scrollHeight;
+	}
+	function parseSmileys(s) { //smileys
+		if (showSmileys) {
+			var addStuff = "";
+			if (scrolledDown)
+				addStuff = "onload='fixMBoxContHeight();'";
+			s = s.replace(/(^| )(::\)|::-\))/g,"$1<img src='smileys/rolleyes.gif' alt='Roll Eyes' "+addStuff+">");
+			s = s.replace(/(^| )(:\)|:-\))/g,"$1<img src='smileys/smiley.gif' alt='smiley' "+addStuff+">");
+			s = s.replace(/(^| )(;\)|;-\))/g,"$1<img src='smileys/wink.gif' alt='Wink' "+addStuff+">");
+			s = s.replace(/(^| )(&gt;:D|&gt;:-D)/g,"$1<img src='smileys/evil.gif' alt='Evil' "+addStuff+">");
+			s = s.replace(/(^| )(:D|:-D)/g,"$1<img src='smileys/cheesy.gif' alt='Cheesy' "+addStuff+">");
+			s = s.replace(/(^| )(;D|;-D)/g,"$1<img src='smileys/grin.gif' alt='Grin' "+addStuff+">");
+			s = s.replace(/(^| )(&gt;:\(|&gt;:-\()/g,"$1<img src='smileys/angry.gif' alt='Angry' "+addStuff+">");
+			s = s.replace(/(^| )(:\(|:-\()/g,"$1<img src='smileys/sad.gif' alt='Sad' "+addStuff+">");
+			s = s.replace(/(^| )(:o|:O|:-o|:-O)/g,"$1<img src='smileys/shocked.gif' alt='Shocked' "+addStuff+">");
+			s = s.replace(/(^| )(8\))/g,"$1<img src='smileys/cool.gif' alt='Cool' "+addStuff+">");
+			s = s.replace(/(^| )\?\?\?/g,"$1<img src='smileys/huh.gif' alt='Huh' "+addStuff+">");
+			s = s.replace(/(^| )(:P|:-P|:p|:-p)/g,"$1<img src='smileys/tongue.gif' alt='Tongue' "+addStuff+">");
+			s = s.replace(/(^| )(:\[|:-\[)/g,"$1<img src='smileys/embarrassed.gif' alt='Embarrassed' "+addStuff+">");
+			s = s.replace(/(^| )(:x|:-x|:X|:-X)/g,"$1<img src='smileys/lipsrsealed.gif' alt='Lips Sealed' "+addStuff+">");
+			s = s.replace(/(^| )(:\\|:-\\)/g,"$1<img src='smileys/undecided.gif' alt='Undecided' "+addStuff+">");
+			s = s.replace(/(^| ):-\*/g,"$1<img src='smileys/kiss.gif' alt='Kiss' "+addStuff+">");
+			s = s.replace(/(^| )(:'\(|:'-\()/g,"$1<img src='smileys/cry.gif' alt='Cry' "+addStuff+">");
+			s = s.replace(/:thumbsup:/g,"<img src='smileys/thumbsupsmiley.gif' alt='Thumbs Up' "+addStuff+">");
+			s = s.replace(/(^| )O\.O/g,"$1<img src='smileys/shocked2.gif' alt='Shocked' "+addStuff+">");
+			s = s.replace(/(^| )\^-\^/g,"$1<img src='smileys/azn.gif' alt='Azn' "+addStuff+">");
+			s = s.replace(/(^| )&gt;B\)/g,"$1<img src='smileys/alien2.gif' alt='Alien' "+addStuff+">");
+			s = s.replace(/(:banghead:|:headbang:)/g,"<img src='smileys/banghead.gif' alt='Bandhead' "+addStuff+">");
+			s = s.replace(/:angel:/g,"<img src='smileys/ange.gif' alt='Angel' "+addStuff+">");
+			s = s.replace(/(^| )\._\./g,"$1<img src='smileys/blah.gif' alt='Blah' "+addStuff+">");
+			s = s.replace(/:devil:/g,"<img src='smileys/devil.gif' alt='Devil' "+addStuff+">");
+			s = s.replace(/(^| )&lt;_&lt;/g,"$1<img src='smileys/dry.gif' alt='Dry' "+addStuff+">");
+			s = s.replace(/:evillaugh:/g,"<img src='smileys/evillaugh.gif' alt='Evil Laugh' "+addStuff+">");
+			s = s.replace(/:crazy:/g,"<img src='smileys/fou.gif' alt='Crazy' "+addStuff+">");
+			s = s.replace(/:hyper:/g,"<img src='smileys/happy0075.gif' alt='Hyper' "+addStuff+">");
+			s = s.replace(/:love:/g,"<img src='smileys/love.gif' alt='Love' "+addStuff+">");
+ 			s = s.replace(/:mad:/g,"<img src='smileys/mad.gif' alt='Mad' "+addStuff+">");
+			s = s.replace(/:w00t:/g,"<img src='smileys/smiley_woot.gif' alt='w00t' "+addStuff+">");
+			s = s.replace(/(^| )\*\.\*/g,"$1<img src='smileys/psychedelicO_O.gif' alt='O.O.O' "+addStuff+">");
+			s = s.replace(/(^| )D:/g,"$1<img src='smileys/bigfrown.gif' alt='Big Frown' "+addStuff+">");
+			s = s.replace(/(^| )(XD|xD)/g,"$1<img src='smileys/XD.gif' alt='XD' "+addStuff+">");
+			s = s.replace(/(^| )x\.x/g,"$1<img src='smileys/X_X.gif' alt='x.x' "+addStuff+">");
+			s = s.replace(/:ninja:/g,"<img src='smileys/ninja.gif' alt='Ninja' "+addStuff+">");
+		}
+		return s;
+	}
+	
+	function parseColors(colorStr) //colors
+	{
+		if (!colorStr || colorStr == null || colorStr == undefined) return;
+		colorStr = clickable_links(colorStr);
+		colorStr = parseSmileys(colorStr);
+		//lcount = 0;
+		//a = colorStr;
+		var arrayResults = Array();
+		colorStr+="\x0f";
+		arrayResults = colorStr.split(RegExp("([\x02\x03\x0f\x16\x1d\x1f])"));
+		colorStr="";
+		var isBool = false;
+		var numSpan = 0;
+		var isItalic = false;
+		var isUnderline = false;
+		var s;
+		var colorStrTemp = "1,0";
+		for (var i=0;i<arrayResults.length;i++) {
+			switch (arrayResults[i]) {
+				case "\x03":
+					for (var j=0;j<numSpan;j++)
+						colorStr+="</span>";
+					numSpan=1;
+					i++;
+					colorStrTemp = arrayResults[i];
+					s=arrayResults[i].replace(/^([0-9]{1,2}),([0-9]{1,2})/g,"<span class=\"fg-$1\"><span class=\"bg-$2\">");
+					if (s==arrayResults[i]) {
+						s=arrayResults[i].replace(/^([0-9]{1,2})/g,"<span class=\"fg-$1\">");
+					} else {
+						numSpan++;
+					}
+					colorStr+=s;
+					break;
+				case "\x02":
+					isBool = !isBool;
+					if (isBool) {
+						colorStr+="<b>";
+					} else {
+						colorStr+="</b>";
+					}
+					break;
+				case "\x1d":
+					isItalic = !isItalic;
+					if (isItalic) {
+						colorStr+="<i>";
+					} else {
+						colorStr+="</i>";
+					}
+					break;
+				case "\x16":
+					for (var j=0;j<numSpan;j++)
+						colorStr+="</span>";
+					numSpan=2;
+					var stemp;
+					s=colorStrTemp.replace(/^([0-9]{1,2}),([0-9]{1,2}).+/g,"<span class=\"fg-$2\"><span class=\"bg-$1\">");
+					stemp=colorStrTemp.replace(/^([0-9]{1,2}),([0-9]{1,2}).+/g,"$2,$1");
+					if (s==colorStrTemp) {
+						s=colorStrTemp.replace(/^([0-9]{1,2}).+/g,"<span class=\"fg-0\"><span class=\"bg-$1\">");
+						stemp=colorStrTemp.replace(/^([0-9]{1,2}).+/g,"0,$1");
+					}
+					colorStrTemp = stemp;
+					colorStr+=s;
+					break;
+				case "\x1f":
+					isUnderline = !isUnderline;
+					if (isUnderline) {
+						colorStr+="<u>";
+					} else {
+						colorStr+="</u>";
+					}
+					break;
+				case "\x0f":
+					if (isUnderline) {
+						colorStr+="</u>";
+						isUnderline=false;
+					}
+					if (isItalic) {
+						colorStr+="</i>";
+						isItalic=false;
+					}
+					if (isBool) {
+						colorStr+="</b>"
+						isBool = false;
+					}
+					for (var j=0;j<numSpan;j++)
+						colorStr+="</span>";
+					numSpan=0;
+					break;
+				default:
+					colorStr+=arrayResults[i];
+			}
+		}
+		/*Strip codes*/
+		colorStr = colorStr.replace(/(\x03|\x02|\x1F|\x09|\x0F)/g,"");
+
+		return(colorStr);
+	}
+	function parseHighlight(text) //highlight
+	{
+		if (text.toLowerCase().indexOf(userName.toLowerCase().substr(0,4)) >= 0)
+		{
+			style = "";
+			if (highRed)
+				style = style + "color:#C73232;";
+			if (highBold)
+				style = style + "font-weight:bold;";
+			return '<span class="highlight" style="' + style + '">' + text + "</span>";
+		}
+		return text;
+	}
+	function clickable_links(text) //urls
+	{
+		if (!text || text == null || text == undefined) return;
+		//text = text.replace(/http:\/\/www\.omnimaga\.org\//g,"h111://www.omnimaga.org/");
+		//text = text.replace(/http:\/\/ourl\.ca\//g,"h111://ourl.ca/");
+		//text = text.replace(/((h111:\/\/(www\.omnimaga\.org\/|ourl\.ca))[-a-zA-Z0-9@:;%_+.~#?&//=]+)/, '<a target="_top" href="$1">$1</a>');
+		text = text.replace(RegExp("(^|.)(((f|ht)(tp|tps):\/\/)[^\\s\x02\x03\x0f\x16\x1d\x1f]*)","g"),'$1<a target="_blank" href="$2">$2</a>');
+		text = text.replace(RegExp("(^|\\s)(www\.[^\\s\x02\x03\x0f\x16\x1d\x1f]*)","g"),'$1<a target="_blank" href="http://$2">$2</a>');
+		//text = text.replace(/h111/g,"http");
+		return text;
+	}
+	function clickable_names(name,isOnline) //omnomirc names
+	{
+		if (isOnline == "1")
+			return '<a target="_top" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=' + name + '">' + colored_names(name) + '</a>';
+		return colored_names(name);
+	}
+	function colored_names(name) //colored neames (duh)
+	{
+		if (!coloredNames)
+			return name;
+		if (!name || name == null || name == undefined)
+			return;
+		rcolors = Array(19, 20, 22, 24, 25, 26, 27, 28, 29);
+		sum = i = 0; 
+		while (name[i])
+			sum += name.charCodeAt(i++);
+		sum %= 9;
+		return '<span class="uName-'+rcolors[sum]+'">'+name+'</span>';
+	}
+	
+	function refreshThis(elementOnShow){
+	   var msie = 'Microsoft Internet Explorer';
+	   var tmp = 0;
+	   if (navigator.appName == msie){
+		  tmp = elementOnShow.offsetTop  +  'px';
+	   }else{
+		  tmp = elementOnShow.offsetTop;
+	   }
+	}
+	
+//******************************
+// End Parser                  *
+//******************************
+
+//******************************
+// Userlist Start              *
+//******************************
+	userListContainer = document.getElementById("UserListArrContainer");
+	userListDiv = document.getElementById("UserList");
+	function addUser(user)
+	{
+		UserListArr.push(user);
+	}
+	
+	function addUserJoin(user,online)
+	{
+		if(!hasLoaded) return;
+		var userp = base64.encode(user) + ":" + online;
+		UserListArr.push(userp);
+		parseUsers();
+	}
+	
+	function parseUsers()
+	{
+		if (!userListDiv || userListDiv == null)
+		 userListDiv = document.getElementById("UserList");
+		userText = "";
+		i = 0;
+		UserListArr.sort(function(a,b)
+						{
+							var al=base64.decode(a).toLowerCase(),bl=base64.decode(b).toLowerCase();
+							return al==bl?(a==b?0:a<b?-1:1):al<bl?-1:1;
+						});
+		for (i=0;i<UserListArr.length;i++)
+		{
+			parts = UserListArr[i].split(":");
+			if (parts[1] == "0") userText = userText + "#" + base64.decode(parts[0]) + "<br/>";
+			if (parts[1] == "1") 
+				userText = userText + '<a target="_top" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=' +base64.decode(parts[0]) + 
+				'"><img src="http://omnomirc.www.omnimaga.org/omni.png" alt="Omnimaga User" title="Omnimaga User" border=0 width=8 height=8 />' + base64.decode(parts[0]) + '</a><br/>';
+			if (parts[1] == "2") userText = userText + "!" + base64.decode(parts[0]) + "<br/>";
+		}
+		userText = userText + "<br/><br/>";
+		userListDiv.innerHTML = userText;
+	}
+	
+	function removeUser(user)
+	{
+		if(!hasLoaded) return;
+		for (i in UserListArr)
+		{
+			parts = UserListArr[i].split(":");
+			if (base64.decode(parts[0]) == user)
+				UserListArr.splice(i,1);
+		}
+		parseUsers();
+	}
+	
+	
+//******************************
+// Userlist End                *
+//******************************
+//******************************
+// Load Start                  *
+//******************************
+	function load()
+	{
+		cookieLoad();
+		lineHigh = getOption(6,"T") == "T";
+		doHigh = false;
+		coloredNames = getOption(3,"F") == "T";
+		highRed = getOption(2,"T") == "T";
+		highBold = getOption(1,"T") == "T";
+		enabled = getOption(5,"T") == "T";
+		notifications = getOption(7,"F") == "T";
+		highDing = getOption(8,"F") == "T";
+		showExChans = getOption(9,"F") == "T";
+		showTime = getOption(10,"F") == "T";
+		doStatusUpdates = getOption(11,"T") == "T";
+		showSmileys = getOption(12,"T") == "T";
+		hasLoaded = false;
+		if (!showSmileys) {
+			document.getElementById('smileyMenuButton').src='smileys/smiley_grey.png';
+			document.getElementById('smileyMenuButton').style.cursor='default';
+		}
+		if (!enabled)
+		{
+			mboxCont.appendChild(messageBox);
+			messageBox.innerHTML = '<a href="#" onclick="toggleEnable();">OmnomIRC is disabled. Click here to enable.</a>';
+			return false;
+		}
+		doLineHigh=true;
+		var body= document.getElementsByTagName('body')[0];
+		var chanScr= document.createElement('script');
+		chanScr.type= 'text/javascript';
+		chanScr.src= 'Channels.php';
+		chanScr.onload= function(){channelSelectorCallback();readOldMessagesCookies();};
+		body.appendChild(chanScr);
+		chanList = document.getElementById('chanList');
+		isBlurred();
+		if (userName == "Guest"){
+			var message = document.getElementById("message");
+			message.disabled = "true";
+			message.value = "You need to login if you want to chat!";
+		}
+	}
+	//window.onLoad = load();
+//******************************
+// Load End                    *
+//******************************
+
+//******************************
+// Links Start                 *
+//******************************
+	function toggleEnable()
+	{
+		setOption(5,!(getOption(5,'T') == 'T')?'T':'F');
+		window.location.reload(true);
+	}
+//******************************
+// Links End                   *
+//******************************
+
+//******************************
+// Message Send Start          *
+//******************************
+
+	function sendAJAXMessage(name,signature,message,chan) //'chan' kept for legacy purposes.
+	{
+		if (message[0] == "/")
+		{
+			if (parseCommand(message.substr(1)))
+				return;
+		}
+		if (getChannelDe()[0] == "*")
+		{
+			d = new Date();
+			str="0:pm:0:" + d.getTime()/1000 + ":" + base64.encode(name) + ":" + base64.encode(HTMLEncode(message)); //Print PMs locally.
+			//addLine(str);
+		}
+		var theURL = "message.php?nick=" + base64.encode(name) + "&signature="+base64.encode(signature)+"&message=" + base64.encode(message) +"&channel=" + getChannelEn();
+		xmlhttp2=new XMLHttpRequest();
+		xmlhttp2.open("GET", theURL ,false);
+		xmlhttp2.send(null);
+	}
+//******************************
+// Message Send End            *
+//******************************
+
+//******************************
+// Channel Selector Start      *
+//******************************
+	function channelSelectorCallback()
+	{
+		messageBox.cellPadding = "0px";
+		messageBox.cellSpacing = "0px";
+		if (showExChans)
+			for (i in exChannels)
+				channels.push(exChannels[i]);
+		/*if (moreChans)
+			for(i in moreChans)
+				channels.push(base64.encode(moreChans[i]));*/
+		loadChannels(); //From cookies
+		drawChannels();
+		scrolledDown = true;
+		
+		var body= document.getElementsByTagName('body')[0];
+		var script= document.createElement('script');
+		script.type= 'text/javascript';
+		script.src= 'Load.php?count=125&channel=' + getChannelEn() + "&nick=" + base64.encode(userName) + "&signature=" + base64.encode(Signature) + "&time=" + (new Date).getTime();
+		script.onload= function(){mBoxCont.appendChild(messageBox);parseUsers();startLoop();mBoxCont.scrollTop = mBoxCont.scrollHeight;hasLoaded = true;stopIndicator();};
+		body.appendChild(script);
+	}
+	
+	function changeChannel()
+	{
+		//Empty out dirty holders
+		cancelRequest();
+		startIndicator();
+		mBoxCont.innerHTML = '';
+		messageBox = document.createElement("table");
+		messageBox.className='MessageBox';
+		messageBox.style.width="100%";
+		messageBox.style.height="100%";
+		messageBox.cellPadding = "0px";
+		messageBox.cellSpacing = "0px";
+		hasLoaded = false;
+		scrolledDown = true;
+		curLine = 0;
+		UserListArr = Array();
+		userListDiv.innerHTML = "";
+		
+		drawChannels();	
+		var body= document.getElementsByTagName('body')[0];
+		var script= document.createElement('script');
+		script.type= 'text/javascript';
+		script.src= 'Load.php?count=125&channel=' + getChannelEn() + "&nick=" + base64.encode(userName) + "&signature=" + base64.encode(Signature) + "&time=" + (new Date).getTime();;
+		script.onload= function(){mBoxCont.appendChild(messageBox);parseUsers();startLoop();mBoxCont.scrollTop = mBoxCont.scrollHeight;hasLoaded = true;stopIndicator();};
+		body.appendChild(script);
+	}
+	
+	function drawChannels()
+	{
+		var chanText = '';//'<table>';
+		for (i in channels)
+		{
+		var chanName = base64.decode(channels[i]);
+			//partChannel
+			style = "chan";
+			chanText += '<table class="chanList"><td id="' + chanName + '" class="';
+			if (getChannelIndex()==i)
+				style = "curchan";
+			chanText += style;
+			chanText += '">';
+			if (chanName.substr(0,1) != "#")
+				chanText += '<span onclick="partChannel(\'' + chanName + '\')" onmouseover="this.style.color=\'#C73232\';this.style.font-weight=\'bolder\'" onmouseout="this.style.color=\'' + ((getChannelIndex()==i)?'#FFF':'#22C') + '\';this.style.font-weight=\'normal\'">x</span> ';
+			chanText += '<span onclick="selectChannel(' + i + ')">';
+			chanText += chanName;
+			chanText += "</span>";
+			chanText += "</td></table>";
+		}
+		//chanText += "</table>";
+		document.getElementById("ChanList").innerHTML = chanText;
+	}
+	
+	function selectChannel(index)
+	{
+		setOption(4,String.fromCharCode(index + 32),true);
+		changeChannel();
+		readOldMessagesCookies();
+	}
+	
+	function getChannelEn()
+	{
+		return channels[getChannelIndex()];
+	}
+	
+	function getChannelDe()
+	{
+		return base64.decode(channels[getChannelIndex()]);
+	}
+	
+	function getChannelIndex()
+	{
+		var index = getOption(4,String.fromCharCode(32)).charCodeAt(0) - 32;
+		if (index > (channels.length - 1))
+			index = 0;
+		return index;
+	}
+//******************************
+// Channel Selector End        *
+//******************************
+
+//******************************
+// Tab Completion Start        *
+//******************************
+
+function searchUser(start,startAt)
+{
+	if(!startAt)
+		startAt = 0;
+	for (i=0;i<UserListArr.length;i++)
+	{
+		parts = UserListArr[i].split(":");
+		name = base64.decode(parts[0]).toLowerCase();
+		if (name.indexOf(start.toLowerCase()) == 0 && startAt-- <= 0)
+			return base64.decode(parts[0]);
+	}
+	return start;
+}
+	
+//******************************
+// Tab Completion End          *
+//******************************
+
+//******************************
+// Commands Start              *
+//******************************
+	function setTopic(message)
+	{
+		document.getElementById('topic').innerHTML = message;
+	}
+	function sendInternalMessage(message)
+	{
+		d = new Date();
+		str="0:internal:0:" + parseInt(d.getTime()*1000) + ":" + base64.encode(message);
+		addLine(str);
+	}
+	
+	function OmnomIRC_Error(message)
+	{
+		sendInternalMessage('<span style="color:#C73232;">'+message+"</span>");
+	}
+	
+	function joinChannel(paramaters)
+	{
+			if (paramaters.substr(0,1) != "@" && paramaters.substr(0,1) != "#")
+				paramaters = "@" + paramaters;
+			//Check if it already exists or not. If so, try to join it.
+			var count = 0;
+			for (i in channels)
+			{
+				if (base64.decode(channels[i]).toLowerCase() == paramaters.toLowerCase())
+				{
+					selectChannel(count);
+					return;
+				}
+				count++;
+			}
+			//Channel not in existance.
+			if (paramaters.substr(0,1) == "#")
+			{
+				sendInternalMessage('<span style="color:#C73232;"> Join Error: Cannot join new channels starting with #.</span>');
+				return;
+			}
+			//Valid chan, add to list.
+			channels.push(base64.encode(paramaters));
+			saveChannels();
+			selectChannel(channels.length-1);
+	}
+	
+	function openPMWindow(paramaters)
+	{
+		if (paramaters.substr(0,1) == "@" && paramaters.substr(0,1) == "#")
+			sendInternalMessage('<span style="color:#C73232;"> Query Error: Cannot query a channel. Use /join instead.</span>');
+		if (paramaters.substr(0,1) != "*")
+			paramaters = "*" + paramaters;
+		for (i in channels)
+			if (base64.decode(channels[i]).toLowerCase() == paramaters.toLowerCase())
+				return; //PM already opened, don't open another.
+		channels.push(base64.encode(paramaters));
+		saveChannels();
+		drawChannels();
+	}
+	
+	function partChannel(paramaters)
+	{
+		if (paramaters == "")
+		{
+			partChannel(getChannelDe());
+			return;
+		}
+		if (paramaters.substr(0,1) != "#")
+		{
+			for (i in channels)
+			{
+				if (base64.decode(channels[i]) == paramaters)
+				{
+					
+					if (getChannelDe() == paramaters)
+					{
+						channels.splice(i,1);
+						selectChannel(i-1);
+					}
+					else
+					{
+						channels.splice(i,1);
+						drawChannels();
+					}
+					saveChannels();
+					return;
+				}
+			}
+			if (paramaters.substr(0,1) != "@" && paramaters.substr(0,1) != "#")
+			{
+				paramaters = "@" + paramaters;
+				partChannel(paramaters);
+			}
+			else
+			{
+				sendInternalMessage('<span style="color:#C73232;"> Part Error: I cannot part ' + paramaters + '. (You are not in it.)</span>');
+			}
+		}	
+		else
+		sendInternalMessage('<span style="color:#C73232;"> Part Error: I cannot part ' + paramaters + '. (That is not an OmnomIRC channel.)</span>');
+	}
+	
+	function parseCommand(message)
+	{
+		var command = message.split(" ")[0];
+		var paramaters = message.substr(command.length+1).toLowerCase();
+		switch(command)
+		{
+			case "j":
+			case "join":
+				joinChannel(paramaters);
+			return true;
+			case "q":
+			case "query":
+				openPMWindow(paramaters);
+			return true;
+			case "win":
+			case "w":
+			case "window":
+				if (parseInt(paramaters) > channels.length || parseInt(paramaters) <= 0)
+					sendInternalMessage('<span style="color:#C73232;"> Invalid window selection. Valid options: 1-'+channels.length+'</span>');
+				else
+					selectChannel(parseInt(paramaters)-1);
+			return true;
+			case "p":
+			case "part":
+				partChannel(paramaters);
+			return true;
+			case "test":
+				sendInternalMessage(Signature);
+			return true;
+			default:
+			return false;
+		}
+	}
+//******************************
+// Commands End                *
+//******************************
+
+//******************************
+// Dynamic Channels Start      *
+//******************************
+
+	function loadChannels()
+	{
+		if (document.cookie.indexOf("OmnomChannels") >= 0)
+		{
+			var moreChans = document.cookie.split(";")[0].replace(/^.*OmnomChannels=(.+?)|.*/, "\$1").split("%");
+			for (i in moreChans)
+			{
+				
+				if (moreChans[i][0] != "#" && moreChans[i] != "")
+				{
+					if (moreChans[i][0] == "^") moreChans[i][0] = "#";
+					channels.push(moreChans[i]);
+				}
+			}
+		}
+	}
+
+	function saveChannels()
+	{
+		var chanList = "";
+		for (i in channels)
+		{
+			if (base64.decode(channels[i]).substr(0,1) != "#")
+			{
+				chanList = chanList + channels[i] + "%";
+			}
+		}
+		chanList = chanList.substr(0,chanList.length-1);
+		document.cookie = "OmnomChannels=" + chanList + ";expires=Sat, 20 Nov 2286 17:46:39 GMT;";
+	}
+
+//******************************
+// Dynamic Channels End        *
+//******************************
+
+//******************************
+// Focus Handler Start         *
+//******************************
+var focusHandlerRegistered = false;
+function isBlurred() {
+	if  (focusHandlerRegistered == undefined)
+		focusHandlerRegistered = false;
+	if (!focusHandlerRegistered)
+		registerFocusHandler();
+	if (parent != undefined)
+		return parent.window.bIsBlurred;
+	else
+		return bIsBlurred;
+}
+
+function registerFocusHandler() {
+	focusHandlerRegistered = true;
+	if (parent != undefined)//Child(iframe)
+	{
+		parent.window.bIsBlurred = false;
+		parent.window.onblur = function(){ parent.window.bIsBlurred=true;if(console.log)console.log("Blur");return true; }
+		parent.window.onfocus= function(){ parent.window.bIsBlurred=false;resize();if(console.log)console.log("Focus");return true;}
+	}
+	else //Not a child
+	{
+		window.onblur = function(){ bIsBlurred=true;if(console.log)console.log("Blur");return true; }
+		window.onfocus= function(){ bIsBlurred=false;resize();if(console.log)console.log("Focus");return true;}
+	}
+}
+//******************************
+// Focus Handler End           *
+//******************************
+
+//******************************
+// Status Bar Updater Start    *
+//******************************
+statusTxt = "";
+statusStarted = false;
+function startStatusBarUpdate()
+{
+	if (!doStatusUpdates) return;
+	if (!statusStarted)
+		setInterval(doStatusBarUpdate,500);
+	statusStarted = true;
+}
+
+function doStatusBarUpdate()
+{
+	window.status=statusTxt;
+	if (parent)
+		parent.window.status=statusTxt;
+}
+
+function changeStatusBarText(msg)
+{
+	statusTxt = msg;
+	if (!statusStarted)
+		startStatusBarUpdate();
+}
+//******************************
+// Status Bar Updater End      *
+//******************************
+
+//******************************
+// HTML Tools Start            *
+//******************************
+ function HTMLEncode(str)
+ {
+   var div = document.createElement('div');
+   var text = document.createTextNode(str);
+   div.appendChild(text);
+   return div.innerHTML;
+  }
+  function StripHTML(str)
+  {
+	var tmp = document.createElement("div");
+	tmp.innerHTML = str;
+	return tmp.textContent||tmp.innerText;
+  }
+  String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
+//******************************
+// HTML Tools End              *
+//******************************

+ 718 - 0
omnomirc_www/Omnom_Parser.js.s

@@ -0,0 +1,718 @@
+
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+messageList = Array();
+UserListArr = Array();
+curLine = 0;
+messageBox = document.getElementById("MessageBox");
+mBoxCont = document.getElementById("mBoxCont");
+Userlist = Array();
+//******************************
+// Start Request Loop functions*
+//******************************
+	function startLoop()
+	{
+		xmlhttp=getAjaxObject();
+		if (xmlhttp==null) { 
+			alert ("Your browser does not support AJAX! Please update for OmnomIRC compatibility."); 
+			return;
+		}
+		xmlhttp.onreadystatechange=getIncomingLine;
+		sendRequest();
+	}
+	
+	function sendRequest()
+	{
+		url = "Update.php?lineNum=" + curLine + "&channel=" + getChannelEn() + "&nick=" + base64.encode(parent.userName) + "&signature=" + base64.encode(parent.Signature);
+		xmlhttp.open("GET",url,true);
+		xmlhttp.send(null);
+	}
+	
+	function getIncomingLine()
+	{
+		if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") { 
+			if (xmlhttp.status == 200) addLine(xmlhttp.responseText); //Filter out 500s from timeouts
+			sendRequest();
+		}
+	}
+	
+	function getAjaxObject()
+	{
+		xmlhttp=new XMLHttpRequest(); //Decent Browsers
+		if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");  //IE7+
+		if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //IE6-
+		return xmlhttp;
+	}
+	
+//******************************
+// End Request Loop functions  *
+//******************************
+
+//******************************
+// Start Parser                *
+//******************************
+	function addLine(message)
+	{
+		if (!message || message == null || message == undefined)
+			return;
+		doScroll = false;
+		if (mBoxCont.clientHeight + mBoxCont.scrollTop > mBoxCont.scrollHeight - 50) doScroll = true;
+		messageBox = document.getElementById("MessageBox");
+		if ("\v" != "v") //If IE, take the slow but sure route (This is enough of a performance hit in all browsers to use the optimized code if possible. Also, IE can go fuck itself.)
+			mBoxCont.innerHTML = '<table style="width:100%" class="messageBox" id="MessageBox">' + messageBox.innerHTML + parseMessage(message) + '</table>';
+		else //If not IE, yay!
+			messageBox.innerHTML = messageBox.innerHTML + parseMessage(message);
+		if (doScroll)mBoxCont.scrollTop = mBoxCont.scrollHeight + 50;
+		lnNum = message.split(":")[0];
+		if (lnNum > curLine)
+			curLine = lnNum;
+	}
+	
+	function parseMessage(message)
+	{
+		a = message;
+		var parts = message.split(":");
+		lnumber = parts[0];
+		type = parts[1];
+		online = parts[2];
+		parsedMessage = "";
+		
+		for (i = 4;i < parts.length;i++)
+			parts[i] = base64.decode(parts[i]);
+		name = clickable_names(parts[4],online);
+		var undefined;
+		if (parts[5] == undefined || parts[5] == "")
+			parts[5] = " ";
+		if (parts[5] != undefined && parts[5] != null)
+		{
+			parsedMessage = parseColors(parts[5]);
+			if (parts[5].toLowerCase().indexOf(parent.userName.toLowerCase().substr(0,4)) >= 0 && hasLoaded && notifications && parts[4].toLowerCase() != "spybot45")
+			{
+				showNotification("<" + parts[4] + "> " + parts[5]);
+				if (highDing)
+				{
+					document.getElementById('ding').play();
+				}
+			}
+		}
+		if ((type == "message" || type == "action") && parts[4].toLowerCase() != "spybot45")
+		{
+			parsedMessage = parseHighlight(parsedMessage);
+		}
+		retval = "";
+		if (type != "message" && type != "pm")
+			retVal='<td class="name">';
+		switch (type)
+		{
+			case "join":
+				retval += '<td class="name"> </td><td class="join"> * ' + name + " has joined "+getChannelDe() + "</td>";
+				addUserJoin(parts[4],online);
+				if (online == "1")
+					return "";
+				break;
+			case "part":
+				retval += '<td class="name"> </td><td class="part"> * ' + name + " has left "+getChannelDe()+" (" + parsedMessage + ")" + "</td>";
+				removeUser(parts[4]);
+				if (online == "1")
+					return "";
+				break;
+			case "quit":
+				retval += '<td class="name"> </td><td class="quit"> * ' + name + " has quit IRC (" + parsedMessage + ")" + "</td>";
+				removeUser(parts[4]);
+				break;
+			case "kick":
+				retval += '<td class="name"> </td><td class="kick"> * ' + name + " has kicked " + parts[5] + " from "+getChannelDe()+" (" + parts[6] + ")" + "</td>";
+				removeUser(parts[4]);
+				break;
+			case "message":	
+				retval = '<span class="message"><td class="name">' + name + "</td><td>" + parsedMessage + "</td></span>";break;
+			case "action":
+				retval += '<td class="name"> </td><td class="action"> * ' + name + " " + parsedMessage + "</td>";break;
+			case "mode":
+				retval += '<td class="name"> </td><td class="mode"> * ' + name + " set "+getChannelDe()+" mode " + parts[5] + "</td>";break;
+			case "nick":
+				retval += '<td class="name"> </td><td class="nick"> * ' + name + " has changed his nick to " + parsedMessage + "</td>";
+				removeUser(parts[4]);
+				addUserJoin(parts[5],online);
+				break;
+			case "topic":
+				retval += '<td class="name"> </td><td class="topic"> * ' + name + " has changed the topic to " + parsedMessage + "</td>";break;
+			case "internal":
+				retval += parts[4];
+			break;
+			case "pm":
+				if (getChannelDe().toLowerCase() != ("*" + parts[4]).toLowerCase() && parts[4] != parent.userName)//Not in the PM window
+				{
+					retval = '<span class="pm"><td class="name">(PM)' + name + "</td><td>" + parsedMessage + "</td></span>";
+					if (hasLoaded)
+					{
+						openPMWindow(parts[4]);
+						if (notifications)
+							showNotification("(PM) <" + parts[4] + "> " + parts[5]);
+						if (highDing)
+								document.getElementById('ding').play();
+						document.getElementById("*" + parts[4]).style.color="#C22";
+					}
+				}
+				else
+				{
+					retval = '<td class="name">' + name + "</td><td>" + parsedMessage + "</td></span>"; //In the PM window
+				}
+			break;
+			case "curline":
+				return "";
+			break;
+			case "highlight":
+				if (parts[6].toLowerCase() == "spybot45") return "";
+				document.getElementById(parts[4]).style.color="#C22"; //This call will fail if they aren't in the chan. Crude, but effective.
+				if (notifications)
+					showNotification("(" + parts[4] + ") <" + parts[6] + "> " + parts[7]);
+				if (highDing)
+					document.getElementById('ding').play();
+				
+				
+				return "";
+			break;
+			case "default":
+				return "";
+			break;
+		}
+		if (type != "message" && type != "pm")
+			retVal+="</td>";
+		pretag = '<tr style="width:100%;">';
+		doHigh = !doHigh;
+		if (lineHigh && doHigh)
+		{
+			pretag = '<tr style="width:100%;" class="linehigh">';
+		}
+		doLineHigh = !doLineHigh;
+		
+		d = new Date(parts[3]*1000);
+		retval = pretag + '<td class="irc-date">[' + d.toLocaleTimeString() + ']</td>'  + retval + "</tr>";
+		
+		return retval;
+	}
+	
+	function parseColors(colorStr)
+	{
+		if (!colorStr || colorStr == null || colorStr == undefined) return;
+		colorStr = clickable_links(colorStr);
+		lcount = 0;
+		a = colorStr;
+		arrayResults = Array();
+		arrayResults2 = Array();
+		while(colorStr.indexOf("\x03") >= 0)
+		{
+			arrayResults = colorStr.match("(^.*)\x03([0-9]{1,2}),([0-9]{1,2})(.*)");
+			arrayResults2 = colorStr.match("(^.*)\x03([0-9]{1,2})(.*)");
+			arrayResults3 = colorStr.match("(^.*)\x03([0-9]{1,2})(.*)");
+			if(arrayResults != null && arrayResults.length > 4) //FG & BG
+			{
+				b = arrayResults;
+				colorStr = arrayResults[1]+'<span class="fg-'+arrayResults[2]*1 +'"><span class="bg-'+arrayResults[3]*1 +'">'+arrayResults[4]+"</span></span>";
+				lcount+=2;
+			}
+			else if(arrayResults2 != null && arrayResults2.length > 3) //FG Only
+			{
+				colorStr = arrayResults2[1]+'<span class="fg-' + arrayResults2[2]*1 + '">'+arrayResults2[3]+"</span></span>";
+				lcount++;
+			}
+			else //We have a color control character w/o a color, most clients interperet this as clear colors.
+			{
+				for(lcount;lcount;lcount--)
+					colorStr=colorStr+"</span>";
+				colorStr = colorStr.replace(/\x03/,"");
+				lcount--;
+			}
+			lcount++;
+		}
+		for(;lcount>=0;lcount--)
+			colorStr=colorStr+"</span>";
+		colorStr=colorStr+"</span>";
+		
+		/*Strip codes*/
+		colorStr = colorStr.replace(/(\x03|\x02|\x1F|\x09|\x0F)/g,"");
+
+		return(colorStr);
+	}
+	function parseHighlight(text)
+	{
+		if (text.toLowerCase().indexOf(parent.userName.toLowerCase().substr(0,4)) >= 0)
+		{
+			style = "";
+			if (highRed)
+				style = style + "color:#C73232;";
+			if (highBold)
+				style = style + "font-weight:bold;";
+			return '<span class="highlight" style="' + style + '">' + text + "</span>";
+		}
+		return text;
+	}
+	function clickable_links(text) 
+	{
+		if (!text || text == null || text == undefined) return;
+		text = text.replace(/http:\/\/www.omnimaga.org\//g,"h111://www.omnimaga.org/");
+		text = text.replace(/http:\/\/omniurl.tk\//g,"h111://omniurl.tk/");
+		text = text.replace(/((h111:\/\/(www.omnimaga.org\/|omniurl.tk))[-a-zA-Z0-9@:;%_+.~#?&//=]+)/, '<a target="_TOP" href="$1">$1</a>');
+		text = text.replace(/(((f|ht)(tp|tps):\/\/)[-a-zA-Z0-9@:;%_+.~#?&\/\/=]+)/g,'<a target="_blank" href="$1">$1</a>');
+		text = text.replace(/([[ ]|[{}])(www.[-a-zA-Z0-9@:;%_+.~#?&//=]+)/,'$1 <a target="_blank" href="http://$2">$2</a>');
+		text = text.replace(/h111/g,"http");
+		return text;
+	}
+	function clickable_names(name,isOnline)
+	{
+		if (isOnline == "1")
+			return '<a target="_TOP" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=' + name + '">' + colored_names(name) + '</a>';
+		return colored_names(name);
+	}
+	function colored_names(name)
+	{
+	if (!coloredNames)
+		return name;
+	if (!name || name == null || name == undefined)
+		return;
+	rcolors = Array(19, 20, 22, 24, 25, 26, 27, 28, 29);
+	sum = i = 0; 
+	while (name[i])
+		sum += name.charCodeAt(i++);
+	sum %= 9;
+	return '<span class="uName-'+rcolors[sum]+'">'+name+'</span>';
+	}
+	
+//******************************
+// End Parser                  *
+//******************************
+
+//******************************
+// Userlist Start              *
+//******************************
+	userListContainer = document.getElementById("UserListArrContainer");
+	userListDiv = document.getElementById("UserList");
+	function addUser(user)
+	{
+		UserListArr.push(user);
+	}
+	
+	function addUserJoin(user,online)
+	{
+		if(!hasLoaded) return;
+		var userp = base64.encode(user) + ":" + online;
+		UserListArr.push(userp);
+		parseUsers();
+	}
+	
+	function parseUsers()
+	{
+		if (!userListDiv || userListDiv == null)
+		 userListDiv = document.getElementById("UserList");
+		userText = "";
+		i = 0;
+		UserListArr.sort(function(a,b)
+						{
+							var al=base64.decode(a).toLowerCase(),bl=base64.decode(b).toLowerCase();
+							return al==bl?(a==b?0:a<b?-1:1):al<bl?-1:1;
+						});
+		for (i=0;i<UserListArr.length;i++)
+		{
+			parts = UserListArr[i].split(":");
+			if (parts[1] == "0") userText = userText + "#" + base64.decode(parts[0]) + "<br/>";
+			if (parts[1] == "1") 
+				userText = userText + '<a target="_TOP" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=' +base64.decode(parts[0]) + 
+				'"><img src="http://netham45.org/irc/efnet/ouser.png" alt="Omnimaga User" title="Omnimaga User" border=0 width=8 height=8 />' + base64.decode(parts[0]) + '</a><br/>';
+			if (parts[1] == "2") userText = userText + "!" + base64.decode(parts[0]) + "<br/>";
+		}
+		userText = userText + "<br/><br/>";
+		userListDiv.innerHTML = userText;
+	}
+	
+	function removeUser(user)
+	{
+		if(!hasLoaded) return;
+		for (i in UserListArr)
+		{
+			parts = UserListArr[i].split(":");
+			if (base64.decode(parts[0]) == user)
+				UserListArr.splice(i,1);
+		}
+		parseUsers();
+	}
+	
+	
+//******************************
+// Userlist End                *
+//******************************
+//******************************
+// Load Start                  *
+//******************************
+	function load()
+	{
+		cookieLoad();
+		lineHigh = getOption(6,"T") == "T";
+		doHigh = false;
+		coloredNames = getOption(3,"F") == "T";
+		highRed = getOption(2,"T") == "T";
+		highBold = getOption(1,"T") == "T";
+		enabled = getOption(5,"T") == "T";
+		notifications = getOption(7,"F") == "T";
+		highDing = getOption(8,"F") == "T";
+		showExChans = getOption(9,"F") == "T";
+		hasLoaded = false;
+		if (!enabled)
+		{
+			messageBox.innerHTML = '<a href="#" onclick="toggleEnable();">OmnomIRC is disabled. Click here to enable.</a>';
+			return false;
+		}
+		doLineHigh=true;
+		var body= document.getElementsByTagName('body')[0];
+		var chanScr= document.createElement('script');
+		chanScr.type= 'text/javascript';
+		chanScr.src= 'Channels.php';
+		chanScr.onload= function(){channelSelectorCallback();};
+		body.appendChild(chanScr);
+		chanList = document.getElementById('chanList');
+
+	}
+	window.onLoad = load();
+//******************************
+// Load End                    *
+//******************************
+
+//******************************
+// Links Start                 *
+//******************************
+	function toggleEnable()
+	{
+		setOption(5,!(getOption(5,'T') == 'T')?'T':'F');
+		window.location.reload(true);
+	}
+//******************************
+// Links End                   *
+//******************************
+
+//******************************
+// Message Send Start          *
+//******************************
+
+	function sendAJAXMessage(name,signature,message,chan) //'chan' kept for legacy purposes.
+	{
+		if (message[0] == "/")
+		{
+			if (parseCommand(message.substr(1)))
+				return;
+		}
+		if (getChannelDe()[0] == "*")
+		{
+			d = new Date();
+			str="0:pm:0:" + base64.encode(d.getTime()) + ":" + base64.encode(name) + ":" + base64.encode(HTMLEncode(message)); //Print PMs locally.
+			addLine(str);
+		}
+		var theURL = "message.php?nick=" + base64.encode(name) + "&signature="+base64.encode(signature)+"&message=" + base64.encode(message) +"&channel=" + getChannelEn();
+		xmlhttp2=new XMLHttpRequest();
+		xmlhttp2.open("GET", theURL ,false);
+		xmlhttp2.send(null);
+	}
+//******************************
+// Message Send End            *
+//******************************
+
+//******************************
+// Channel Selector Start      *
+//******************************
+	function channelSelectorCallback()
+	{
+		
+		if (showExChans)
+			for (i in exChannels)
+				channels.push(exChannels[i]);
+		/*if (parent.moreChans)
+			for(i in parent.moreChans)
+				channels.push(base64.encode(parent.moreChans[i]));*/
+		loadChannels(); //From cookies
+		drawChannels();
+		
+		
+		var body= document.getElementsByTagName('body')[0];
+		var script= document.createElement('script');
+		script.type= 'text/javascript';
+		script.src= 'Load.php?count=50&channel=' + getChannelEn() + "&nick=" + base64.encode(parent.userName) + "&signature=" + base64.encode(parent.Signature) + "&time=" + (new Date).getTime();;
+		script.onload= function(){parseUsers();startLoop();mBoxCont.scrollTop = mBoxCont.scrollHeight;hasLoaded = true;};
+		body.appendChild(script);
+	}
+	
+	function changeChannel()
+	{
+		//Empty out dirty holders
+		mBoxCont.innerHTML = '<table style="width:100%" class="messageBox" id="MessageBox"><tr><td>OmnomIRC</td></tr></table>';
+		hasLoaded = false;
+		curLine = 0;
+		UserListArr = Array();
+		userListDiv.innerHTML = "";
+		
+		drawChannels();	
+		var body= document.getElementsByTagName('body')[0];
+		var script= document.createElement('script');
+		script.type= 'text/javascript';
+		script.src= 'Load.php?count=50&channel=' + getChannelEn() + "&nick=" + base64.encode(parent.userName) + "&signature=" + base64.encode(parent.Signature) + "&time=" + (new Date).getTime();;
+		script.onload= function(){parseUsers();startLoop();mBoxCont.scrollTop = mBoxCont.scrollHeight;hasLoaded = true;};
+		body.appendChild(script);
+	}
+	
+	function drawChannels()
+	{
+		var chanText = '';//'<table>';
+		for (i in channels)
+		{
+		var chanName = base64.decode(channels[i]);
+			//partChannel
+			style = "chan";
+			chanText += '<table class="chanList"><td id="' + chanName + '" class="';
+			if (getChannelIndex()==i)
+				style = "curchan";
+			chanText += style;
+			chanText += '">';
+			if (chanName.substr(0,1) != "#")
+				chanText += '<span onclick="partChannel(\'' + chanName + '\')" onmouseover="this.style.color=\'#C73232\';this.style.font-weight=\'bolder\'" onmouseout="this.style.color=\'' + ((getChannelIndex()==i)?'#FFF':'#22C') + '\';this.style.font-weight=\'normal\'">x</span> ';
+			chanText += '<span onclick="selectChannel(' + i + ')">';
+			chanText += chanName;
+			chanText += "</span>";
+			chanText += "</td></table>";
+		}
+		//chanText += "</table>";
+		document.getElementById("ChanList").innerHTML = chanText;
+	}
+	
+	function selectChannel(index)
+	{
+		setOption(4,String.fromCharCode(index + 32),true);
+		changeChannel();
+	}
+	
+	function getChannelEn()
+	{
+		return channels[getChannelIndex()];
+	}
+	
+	function getChannelDe()
+	{
+		return base64.decode(channels[getChannelIndex()]);
+	}
+	
+	function getChannelIndex()
+	{
+		var index = getOption(4,String.fromCharCode(32)).charCodeAt(0) - 32;
+		if (index > (channels.length - 1))
+			index = 0;
+		return index;
+	}
+//******************************
+// Channel Selector End        *
+//******************************
+
+//******************************
+// Tab Completion Start        *
+//******************************
+
+function searchUser(start,startAt)
+{
+	if(!startAt)
+		startAt = 0;
+	for (i=0;i<UserListArr.length;i++)
+	{
+		parts = UserListArr[i].split(":");
+		name = base64.decode(parts[0]).toLowerCase();
+		if (name.indexOf(start.toLowerCase()) == 0 && startAt-- <= 0)
+			return base64.decode(parts[0]);
+	}
+	return start;
+}
+	
+//******************************
+// Tab Completion End          *
+//******************************
+
+//******************************
+// Commands Start              *
+//******************************
+	function sendInternalMessage(message)
+	{
+		d = new Date();
+		str="0:internal:0:" + base64.encode(d.getTime()) + ":" + base64.encode(message);
+		addLine(str);
+	}
+	
+	function joinChannel(paramaters)
+	{
+			if (paramaters.substr(0,1) != "@" && paramaters.substr(0,1) != "#")
+				paramaters = "@" + paramaters;
+			//Check if it already exists or not. If so, try to join it.
+			var count = 0;
+			for (i in channels)
+			{
+				if (base64.decode(channels[i]).toLowerCase() == paramaters.toLowerCase())
+				{
+					selectChannel(count);
+					return;
+				}
+				count++;
+			}
+			//Channel not in existance.
+			if (paramaters.substr(0,1) == "#")
+			{
+				sendInternalMessage('<span style="color:#C73232;"> Join Error: Cannot join new channels starting with #.</span>');
+				return;
+			}
+			//Valid chan, add to list.
+			channels.push(base64.encode(paramaters));
+			saveChannels();
+			selectChannel(channels.length-1);
+	}
+	
+	function openPMWindow(paramaters)
+	{
+		if (paramaters.substr(0,1) == "@" && paramaters.substr(0,1) == "#")
+			sendInternalMessage('<span style="color:#C73232;"> Query Error: Cannot query a channel. Use /join instead.</span>');
+		if (paramaters.substr(0,1) != "*")
+			paramaters = "*" + paramaters;
+		for (i in channels)
+			if (base64.decode(channels[i]).toLowerCase() == paramaters.toLowerCase())
+				return; //PM already opened, don't open another.
+		channels.push(base64.encode(paramaters));
+		saveChannels();
+		drawChannels();
+	}
+	
+	function partChannel(paramaters)
+	{
+		if (paramaters == "")
+		{
+			partChannel(getChannelDe());
+			return;
+		}
+		if (paramaters.substr(0,1) != "#")
+		{
+			for (i in channels)
+			{
+				if (base64.decode(channels[i]) == paramaters)
+				{
+					
+					if (getChannelDe() == paramaters)
+					{
+						channels.splice(i,1);
+						selectChannel(i-1);
+					}
+					else
+					{
+						channels.splice(i,1);
+						drawChannels();
+					}
+					saveChannels();
+					return;
+				}
+			}
+			if (paramaters.substr(0,1) != "@" && paramaters.substr(0,1) != "#")
+			{
+				paramaters = "@" + paramaters;
+				partChannel(paramaters);
+			}
+			else
+			{
+				sendInternalMessage('<span style="color:#C73232;"> Part Error: I cannot part ' + paramaters + '. (You are not in it.)</span>');
+			}
+		}	
+		else
+		sendInternalMessage('<span style="color:#C73232;"> Part Error: I cannot part ' + paramaters + '. (That is not an OmnomIRC channel.)</span>');
+	}
+	
+	function parseCommand(message)
+	{
+		var command = message.split(" ")[0];
+		var paramaters = message.substr(command.length+1).toLowerCase();
+		switch(command)
+		{
+			case "j":
+			case "join":
+				joinChannel(paramaters);
+			return true;
+			case "q":
+			case "query":
+				openPMWindow(paramaters);
+			return true;
+			case "win":
+			case "w":
+			case "window":
+				if (parseInt(paramaters) > channels.length || parseInt(paramaters) <= 0)
+					sendInternalMessage('<span style="color:#C73232;"> Invalid window selection. Valid options: 1-'+channels.length+'</span>');
+				else
+					selectChannel(parseInt(paramaters)-1);
+			return true;
+			case "p":
+			case "part":
+				partChannel(paramaters);
+			return true;
+			case "test":
+				sendInternalMessage(parent.Signature);
+			return true;
+			default:
+			return false;
+		}
+	}
+//******************************
+// Commands End                *
+//******************************
+
+//******************************
+// Dynamic Channels Start      *
+//******************************
+
+	function loadChannels()
+	{
+		if (document.cookie.indexOf("OmnomChannels") >= 0)
+		{
+			var moreChans = document.cookie.split(";")[0].replace(/^.*OmnomChannels=(.+?)|.*/, "\$1").split("%");
+			for (i in moreChans)
+				if (moreChans[i][0] != "#" && moreChans[i] != "")
+					channels.push(moreChans[i]);
+		}
+	}
+
+	function saveChannels()
+	{
+		var chanList = "";
+		for (i in channels)
+		{
+			if (base64.decode(channels[i]).substr(0,1) != "#")
+			{
+				chanList = chanList + channels[i] + "%";
+			}
+		}
+		chanList = chanList.substr(0,chanList.length-1);
+		document.cookie = "OmnomChannels=" + chanList + ";expires=Sat, 20 Nov 2286 17:46:39 GMT;";
+	}
+
+//******************************
+// Dynamic Channels End        *
+//******************************
+ function HTMLEncode(str) {
+   var div = document.createElement('div');
+   var text = document.createTextNode(str);
+   div.appendChild(text);
+   return div.innerHTML;
+  }
+  String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };

+ 97 - 0
omnomirc_www/Omnom_Tab.js

@@ -0,0 +1,97 @@
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+message = document.getElementById("message");
+if(message.addEventListener ) {
+	message.addEventListener("keydown",keyHandler,false);
+	} else if(message.attachEvent ) {
+        message.attachEvent("onkeydown",keyHandler);
+    }
+isInTab = false;
+tabWord = "";
+tabCount = 0;
+startPos = 0;
+endPos = 0;
+endPosO = 0;
+    function keyHandler(e) {
+		if (getCurrentWord() == "")
+			return true;
+        var TABKEY = 9;
+        if(e.keyCode == TABKEY) {
+            if(e.preventDefault) {
+                e.preventDefault();
+            }
+			tabWord = getCurrentWord();
+			getTabComplete();
+			tabCount++;
+			isInTab = true;
+			setTimeout(1,1); //Who woulda thought that a bogus call makes it not parse it in FF4?
+            return false;
+        }
+		else
+		{
+			tabWord = "";
+			tabCount = 0;
+			isInTab = false;
+		}
+    }
+	function getCurrentWord()
+	{
+		if (isInTab)
+			return tabWord;
+		startPos = message.selectionStart;
+		endPos = message.selectionStart;
+		
+		startChar = message.value.charAt(startPos);
+		while (startChar != " " && --startPos > 0)
+			startChar = message.value.charAt(startPos);
+		if (startChar == " ") startPos++;
+		endChar = message.value.charAt(endPos);
+		while (endChar != " " && ++endPos <= message.value.length)
+			endChar = message.value.charAt(endPos);
+		endPosO = endPos;		
+		return message.value.substr(startPos,endPos - startPos).trim();
+	}
+	function getTabComplete()
+	{		
+		if (!isInTab)
+		{
+			startPos = message.selectionStart;
+		
+			startChar = message.value.charAt(startPos);
+			while (startChar != " " && --startPos > 0)
+				startChar = message.value.charAt(startPos);
+			if (startChar == " ") startChar+=2;
+		
+			endPos = message.selectionStart;
+			endChar = message.value.charAt(endPos);
+			while (endChar != " " && ++endPos <= message.value.length)
+				endChar = message.value.charAt(endPos);
+			if (endChar == " ") endChar-=2;
+		}
+		name = searchUser(getCurrentWord(),tabCount);
+		if (name == getCurrentWord())
+		{
+			tabCount = 0;
+			name = searchUser(getCurrentWord(),tabCount);
+		}
+			
+		message.value = message.value.substr(0,startPos) + name + message.value.substr(endPos + 1);
+		endPos = endPosO + name.length;
+	}

+ 111 - 0
omnomirc_www/Options.html

@@ -0,0 +1,111 @@
+<!--
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+!-->
+<html>
+<head>
+<title>OmnomIRC Options</title>
+<link rel="stylesheet" type="text/css" href="style.css" />
+<script src="Omnom_Options.js"></script>
+<style type="text/css">
+body,td,tr,pre,table{
+	font-size: 13px;font-family:verdana,sans-serif;line-height:17px;
+}
+td
+{
+	width:auto;
+	height:20px;
+	white-space: inherit;
+	word-wrap: inherit;
+}
+table
+{
+	height:auto;
+}
+tr td:nth-child(4) {
+	padding-left:10px;
+}
+tr td:nth-child(2) {
+	border-right:1px solid;
+}
+tr td:nth-child(5) {
+	border-right:1px solid;
+}
+</style>
+<script type="text/javascript">
+function warning()
+{
+	alert("-READ THIS-\nNot all extra channels are owned and controlled by Omnimaga. We cannot be held liable for the content of them.\n\nBy using them, you agree to be governed by the rules inside them.\n\nOmnimaga rules still apply for OmnomIRC communication.");
+	setOption(9,'T');
+}
+</script>
+</head>
+<!--
+Options:
+1 - highlight bold
+2 - highlight red
+3 - color names
+4 - currentChannel
+5 - enabled
+6 - alternating line highlight
+7 - enable chrome notifications
+8 - ding on highlight
+9 - show extra channels
+10 - show timestamps
+11 - show updates in status bar
+12 - show smileys
+-->
+<body>
+<table>
+<tr><td>
+Highlight Bold:</td><td> <script type="text/javascript"> document.write(getHTMLToggle(getOption(1,"T") == "T", "Yes", "No", "setOption(1,\'T\');", "setOption(1,\'F\');"));</script>
+</td><td>
+Highlight Red:</td><td> <script type="text/javascript"> document.write(getHTMLToggle(getOption(2,"T") == "T", "Yes", "No", "setOption(2,\'T\');", "setOption(2,\'F\');"));</script>
+</td></tr><tr><td>
+Colored Names:</td><td> <script type="text/javascript"> document.write(getHTMLToggle(getOption(3,"F") == "T", "Yes", "No", "setOption(3,\'T\');", "setOption(3,\'F\');"));</script>
+</td><td>
+Show extra Channels:</td><td> <script type="text/javascript"> document.write(getHTMLToggle(getOption(9,"F") == "T", "Yes", "No", "warning();", "setOption(9,\'F\');"));</script>
+</td></tr><tr><td>
+Alternating Line Highlight:</td><td> <script type="text/javascript"> document.write(getHTMLToggle(getOption(6,"T") == "T", "Yes", "No", "setOption(6,\'T\');", "setOption(6,\'F\');"));</script>
+</td><td>
+Enabled:</td><td> <script type="text/javascript"> document.write(getHTMLToggle(getOption(5,"T") == "T", "Yes", "No", "setOption(5,\'T\');", "setOption(5,\'F\');"));</script>
+</td></tr><tr><td>
+Ding on Highlight:</td><td><script type="text/javascript"> document.write(getHTMLToggle(getOption(8,"F") == "T", "Yes", "No", "setOption(8,\'T\');", "setOption(8,\'F\');"));</script>
+</td><td>
+Show Timestamps:</td><td><script type="text/javascript"> document.write(getHTMLToggle(getOption(10,"F") == "T", "Yes", "No", "setOption(10,\'T\');", "setOption(10,\'F\');"));</script>
+</td></tr><tr><td>
+Show Updates in Browser Status Bar:</td><td><script type="text/javascript"> document.write(getHTMLToggle(getOption(11,"T") == "T", "Yes", "No", "setOption(11,\'T\');", "setOption(11,\'F\');"));</script>
+</td><td>
+Show smileys:</td><td><script type="text/javascript"> document.write(getHTMLToggle(getOption(12,"T") == "T", "Yes", "No", "setOption(12,\'T\');", "setOption(12,\'F\');"));</script>
+</td></tr>
+<script type="text/javascript">
+if (window.webkitNotifications != undefined && window.webkitNotifications != null && window.webkitNotifications)
+{
+	document.write("<tr><td>Chrome Notifications:</td><td>");
+	document.write(getHTMLToggle(getOption(7,"F") == "T","Yes","No","setAllowNotification();","setOption(7,'F')"));
+	document.write("</tr></td>");
+}
+</script>
+</table>
+<a href="#" onclick="clearCookies()">Clear Cookies</a>
+<br/><br/>
+<br/><br/>
+<div style="top:100%;margin-top:-33pt;position:absolute;"><a href="index.php"><span style="font-size:30pt;">&#8592;</span><span style="font-size:18pt;top:-3pt;position:relative;">Back<span></a></div>
+</body>
+</html>

+ 7 - 0
omnomirc_www/Source/cachefix.php

@@ -0,0 +1,7 @@
+<?PHP
+	header("Last-Modified: Thu, 01-Jan-1970 00:00:01 GMT");
+	header("Cache-Control: no-store, no-cache, must-revalidate");
+	header("Cache-Control: post-check=0, pre-check=0", false);
+	header("Pragma: no-cache");
+	date_default_timezone_set("America/Denver"); //Leave me the fuck alone.
+?>

+ 31 - 0
omnomirc_www/Source/sign.php

@@ -0,0 +1,31 @@
+<?PHP
+
+	include_once("config.php");
+	
+	function sign($name)
+	{
+		global $signature_key;
+		return mcrypt_encrypt ( MCRYPT_RIJNDAEL_256 , $signature_key , $name , MCRYPT_MODE_ECB); //Okay, okay, this isn't a signature, it's a cypher. 
+	}																				   //It still gives the same result every time, and I can use it with a key.
+	
+	function checkSignature($name,$signature,$deBase64=false)
+	{
+		if ($deBase64)
+		{
+			$name = base64_url_decode($name);
+			$signature = base64_url_decode($signature);
+		}
+		return $signature == base64_url_encode(sign($name));
+	}
+	
+	function base64_url_encode($input)
+	{
+		return strtr(base64_encode($input), '+/=', '-_,');
+	}
+
+	function base64_url_decode($input)
+	{
+		return base64_decode(strtr($input, '-_,', '+/=')); 
+	}
+	
+?>

+ 31 - 0
omnomirc_www/Source/sign.php~

@@ -0,0 +1,31 @@
+<?PHP
+
+	include_once("config.php");
+	
+	function sign($name)
+	{
+		global $signature_key;
+		return str_replace("\r","\\r",str_replace("\n","\\n",mcrypt_encrypt ( MCRYPT_RIJNDAEL_256 , $signature_key , $name , MCRYPT_MODE_ECB))); //Okay, okay, this isn't a signature, it's a cypher. 
+	}																				   //It still gives the same result every time, and I can use it with a key.
+	
+	function checkSignature($name,$signature,$deBase64=false)
+	{
+		if ($deBase64)
+		{
+			$name = base64_url_decode($name);
+			$signature = base64_url_decode($signature);
+		}
+		return $signature == base64_url_encode(sign($name));
+	}
+	
+	function base64_url_encode($input)
+	{
+		return strtr(base64_encode($input), '+/=', '-_,');
+	}
+
+	function base64_url_decode($input)
+	{
+		return base64_decode(strtr($input, '-_,', '+/=')); 
+	}
+	
+?>

+ 27 - 0
omnomirc_www/Source/sql.php

@@ -0,0 +1,27 @@
+<?PHP
+	include_once("config.php");
+	function connectSQL()
+	{
+		global $sql_user,$sql_password,$sql_server,$sql_db;
+		$sqlConnection = mysql_pconnect($sql_server,$sql_user,$sql_password); //This is a connection to a local SQL server.
+		if (!$sqlConnection) 
+			die("Could not connect to SQL DB: " . mysql_error());
+		if (!mysql_select_db($sql_db,$sqlConnection))
+			die('Could not select DB: ' . mysql_error());
+		return $sqlConnection;
+	}
+	
+	function sql_query(/*format,...*/)
+	{
+		$sqlConnection = connectSQL();
+		$params = func_get_args();
+		$query = $params[0];
+		$args = Array();
+		for ($i=1;$i<count($params);$i++)
+			$args[$i-1] = mysql_real_escape_string($params[$i],$sqlConnection);
+		$result = mysql_query(vsprintf($query,$args),$sqlConnection);
+		if (!$result) 
+			die(mysql_error() . "Query: " . vsprintf($query,$args));
+		return $result;
+	}
+?>

+ 27 - 0
omnomirc_www/Source/sql.php~

@@ -0,0 +1,27 @@
+<?PHP
+	//include_once("config.php");
+	function connectSQL()
+	{
+		global $sql_user,$sql_password,$sql_server,$sql_db;
+		$sqlConnection = mysql_pconnect($sql_server,$sql_user,$sql_password); //This is a connection to a local SQL server.
+		if (!$sqlConnection) 
+			die("Could not connect to SQL DB: " . mysql_error());
+		if (!mysql_select_db($sql_db,$sqlConnection))
+			die('Could not select DB: ' . mysql_error());
+		return $sqlConnection;
+	}
+	
+	function sql_query(/*format,...*/)
+	{
+		$sqlConnection = connectSQL();
+		$params = func_get_args();
+		$query = $params[0];
+		$args = Array();
+		for ($i=1;$i<count($params);$i++)
+			$args[$i-1] = mysql_real_escape_string($params[$i],$sqlConnection);
+		$result = mysql_query(vsprintf($query,$args),$sqlConnection);
+		if (!$result) 
+			die(mysql_error() . "Query: " . vsprintf($query,$args));
+		return $result;
+	}
+?>

+ 50 - 0
omnomirc_www/Source/userlist.php

@@ -0,0 +1,50 @@
+<?PHP
+	include_once("Source/cachefix.php");
+	include_once("Source/sql.php");
+	
+	function UpdateUser($nick,$channel)
+	{
+		if($channel[0]=="*")
+			return; //PMs have no userlist.
+		$result = sql_query("SELECT * FROM `irc_users` WHERE `username` = '%s' AND `channel` = '%s' AND `online` = 1",$nick,$channel);
+		if (mysql_num_rows($result))//Update
+		{
+			sql_query("UPDATE `irc_users` SET `time`='%s' WHERE `username` = '%s' AND `channel` = '%s' AND `online` = 1",time(),$nick,$channel);
+			$row = mysql_fetch_array($result);
+			if ($row['time'] < strtotime('-1 minute')) //First time they joined in a minute.
+				notifyJoin($nick,$channel);
+		}
+		else //Insert
+		{
+			sql_query("INSERT INTO `irc_users` (`username`,`channel`,`time`,`online`) VALUES('%s','%s','%s',1)",$nick,$channel,time());
+			notifyJoin($nick,$channel);
+		}
+	}
+	
+	function getOnlineUsers($channel)
+	{
+		$userlist = Array();
+		if ($channel[0]=="*")
+			return $userlist; //PMs have no userlist.
+		$result = sql_query("SELECT * FROM `irc_users` WHERE `channel` = '%s' AND `time` > %s AND `online` = 1",$channel,strtotime('-1 minute')); //Get all users in the last minute(update.php timeout is 30 seconds).
+		while($row = mysql_fetch_array($result))
+			$userlist[] = $row['username'];
+		return $userlist;
+	}
+	
+	function notifyJoin($nick,$channel)
+	{
+		sql_query("INSERT INTO `irc_lines` (name1,type,channel,time,online) VALUES('%s','join','%s','%s',1)",$nick,$channel,time());
+	}
+	function notifyPart($nick,$channel)
+	{
+		sql_query("INSERT INTO `irc_lines` (name1,type,channel,time,online) VALUES('%s','part','%s','%s',1)",$nick,$channel,time());
+	}
+	function CleanOfflineUsers()
+	{
+		$result = sql_query("SELECT * FROM `irc_users` WHERE `time` < %s",strtotime('-1 minute'));
+		sql_query("DELETE FROM `irc_users` WHERE `time` < %s",strtotime('-1 minute'));
+		while ($row = mysql_fetch_array($result))
+			notifyPart($row['username'],$row['channel']);
+	}
+?>

+ 50 - 0
omnomirc_www/Source/userlist.php~

@@ -0,0 +1,50 @@
+<?PHP
+	//include_once("Source/cachefix.php");
+	//include_once("Source/sql.php");
+	
+	function UpdateUser($nick,$channel)
+	{
+		if($channel[0]=="*")
+			return; //PMs have no userlist.
+		$result = sql_query("SELECT * FROM `irc_users` WHERE `username` = '%s' AND `channel` = '%s' AND `online` = 1",$nick,$channel);
+		if (mysql_num_rows($result))//Update
+		{
+			sql_query("UPDATE `irc_users` SET `time`='%s' WHERE `username` = '%s' AND `channel` = '%s' AND `online` = 1",time(),$nick,$channel);
+			$row = mysql_fetch_array($result);
+			if ($row['time'] < strtotime('-1 minute')) //First time they joined in a minute.
+				notifyJoin($nick,$channel);
+		}
+		else //Insert
+		{
+			sql_query("INSERT INTO `irc_users` (`username`,`channel`,`time`,`online`) VALUES('%s','%s','%s',1)",$nick,$channel,time());
+			notifyJoin($nick,$channel);
+		}
+	}
+	
+	function getOnlineUsers($channel)
+	{
+		$userlist = Array();
+		if ($channel[0]=="*")
+			return $userlist; //PMs have no userlist.
+		$result = sql_query("SELECT * FROM `irc_users` WHERE `channel` = '%s' AND `time` > %s AND `online` = 1",$channel,strtotime('-1 minute')); //Get all users in the last minute(update.php timeout is 30 seconds).
+		while($row = mysql_fetch_array($result))
+			$userlist[] = $row['username'];
+		return $userlist;
+	}
+	
+	function notifyJoin($nick,$channel)
+	{
+		sql_query("INSERT INTO `irc_lines` (name1,type,channel,time,online) VALUES('%s','join','%s','%s',1)",$nick,$channel,time());
+	}
+	function notifyPart($nick,$channel)
+	{
+		sql_query("INSERT INTO `irc_lines` (name1,type,channel,time,online) VALUES('%s','part','%s','%s',1)",$nick,$channel,time());
+	}
+	function CleanOfflineUsers()
+	{
+		$result = sql_query("SELECT * FROM `irc_users` WHERE `time` < %s",strtotime('-1 minute'));
+		sql_query("DELETE FROM `irc_users` WHERE `time` < %s",strtotime('-1 minute'));
+		while ($row = mysql_fetch_array($result))
+			notifyPart($row['username'],$row['channel']);
+	}
+?>

+ 110 - 0
omnomirc_www/Update.php

@@ -0,0 +1,110 @@
+<?PHP
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+	include("Source/cachefix.php"); //This must be the first line in every file.
+	include("Source/sql.php");
+	include("Source/sign.php");
+	include("Source/userlist.php");
+	
+	$curLine = $_GET['lineNum'];
+	$channel = "#omnimaga";
+	if (isset($_GET['channel']))
+		$channel = base64_url_decode($_GET['channel']);
+	$nick = "0";
+	if (isset($_GET['nick']))
+	{
+		$nick = base64_url_decode($_GET['nick']);
+		$signature = base64_url_decode($_GET['signature']);
+		if (!checkSignature($nick,$signature))
+			$nick = "0";
+	}
+	$pm = false;
+	if ($channel[0] == "*") //PM
+	{
+		$sender = substr($channel,1);
+		$channel = $nick;
+		$pm = true;
+	}
+	$countBeforeQuit = 0;
+	while (true)
+	{
+		if ($countBeforeQuit++ == 50)//Timeout after 25 seconds.
+			die();
+		if ($nick != "0")
+			UpdateUser($nick,$channel);
+		CleanOfflineUsers(); //This gets called often enough. We can't have have constant presence in the matrix without a helper app, this is the closest we'll get.
+		$query = sql_query("SELECT * FROM `irc_lines` WHERE `line_number` > %s AND (`channel` = '%s' OR `channel` = '%s' OR (`channel` = '%s' AND `name1` = '%s'))",$curLine + 0,$channel,$nick,$pm?$sender:"0", $nick);
+		$result = mysql_fetch_array($query);
+		//Sorunome edit START
+		$userSql = mysql_fetch_array(sql_query("SELECT * FROM `irc_ignorelist` WHERE name='%s'",strtolower($nick)));
+		$ignorelist = "";
+		if ($userSql["name"]!=NULL) {
+			$ignorelist = $userSql["ignores"];
+		}
+		//Sorunome edit END
+		if (!isset($result[0]))
+		{
+			$result = mysql_fetch_array(sql_query("SELECT * FROM `irc_lines` WHERE `line_number` > %s AND locate('%s',`message`) != 0 AND NOT ((`type` = 'pm' AND `name1` <> '%s') OR (`type` = 'server'))",$curLine + 0,substr($nick,0,4), $nick));
+			if (!isset($result[0])) {usleep(500000); continue;}
+			if (strpos($userSql["ignores"],strtolower($result["name1"])."\n")===false) { //Sorunome edit
+				echo $result['line_number'] . ":highlight:0:0:". base64_url_encode($result['channel']) . "::" . base64_url_encode($result['name1']) . ":" . base64_url_encode($result['message']);
+			} else { //Sorunome edit START
+				echo $result['line_number'].":curline:0:0:";
+			} //Sorunome edit END
+			die; //That's it, folks!
+		}
+		do {
+			if (!isset($result['time'])) $result['time'] = time();
+			if (strpos($userSql["ignores"],strtolower($result["name1"])."\n")===false) { //sorunome edit
+				switch (strtolower($result['type']))
+				{
+					case "pm":
+					case "message":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result['message'])) . ':' . base64_url_encode(htmlspecialchars("0"));break;
+					case "action":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result['message'])) . ':' . base64_url_encode(htmlspecialchars("0"));break;
+					case "join":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1']));break;
+					case "part":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+					case "kick":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["name2"])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+					case "quit":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+					case "mode":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+					case "nick":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["name2"]));break;
+					case "topic":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+					case "reload":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . "::";break;
+					case "server":
+						echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+					case "topic":
+					echo $result['line_number'] . ":" . $result['type'] . ":" . $result['Online'] . ":" . $result['time'] . ":" . base64_url_encode(htmlspecialchars($result['name1'])) . ":" . base64_url_encode(htmlspecialchars($result["message"]));break;
+				}
+				echo "\n";
+			} else { //Sorunome edit START
+				echo $result['line_number'].":curline:0:0:";
+			} //Sorunome edit END
+		} while ($result = mysql_fetch_array($query));
+		break;
+	}
+?>

+ 1 - 0
omnomirc_www/aFarkas-html5shiv-4525162/.gitattributes

@@ -0,0 +1 @@
+* text=auto

+ 1 - 0
omnomirc_www/aFarkas-html5shiv-4525162/.gitignore

@@ -0,0 +1 @@
+.DS_Store

+ 23 - 0
omnomirc_www/aFarkas-html5shiv-4525162/build.xml

@@ -0,0 +1,23 @@
+<project name="html5shiv" default="html5shiv" basedir=".">
+
+	<property name="dist" value="./dist/"/>
+	<property name="src" value="./src"/>
+	
+	<target name="html5shiv">
+		<mkdir dir="${dist}" />
+		<apply executable="java" parallel="false" verbose="true" dest="${dist}">
+			<fileset dir="${src}">
+				<include name="*.js" />
+			</fileset>
+			<arg line="-jar" />
+			<arg path="build/compiler.jar" />
+			<arg value="--warning_level" />
+			<arg value="QUIET" />
+			<arg value="--js_output_file" />
+			<targetfile />
+			<arg value="--js" />
+			<mapper type="glob" from="*.js" to="*.js" />
+		</apply>
+	</target>
+	
+</project>

BIN
omnomirc_www/aFarkas-html5shiv-4525162/build/compiler.jar


+ 11 - 0
omnomirc_www/aFarkas-html5shiv-4525162/dist/html5shiv-printshiv.js

@@ -0,0 +1,11 @@
+/*
+ HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+(function(j,f){function s(a,b){var c=a.createElement("p"),m=a.getElementsByTagName("head")[0]||a.documentElement;c.innerHTML="x<style>"+b+"</style>";return m.insertBefore(c.lastChild,m.firstChild)}function o(){var a=d.elements;return"string"==typeof a?a.split(" "):a}function n(a){var b=t[a[u]];b||(b={},p++,a[u]=p,t[p]=b);return b}function v(a,b,c){b||(b=f);if(e)return b.createElement(a);c||(c=n(b));b=c.cache[a]?c.cache[a].cloneNode():y.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);
+return b.canHaveChildren&&!z.test(a)?c.frag.appendChild(b):b}function A(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();a.createElement=function(c){return!d.shivMethods?b.createElem(c):v(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+o().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(d,b.frag)}
+function w(a){a||(a=f);var b=n(a);if(d.shivCSS&&!q&&!b.hasCSS)b.hasCSS=!!s(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}");e||A(a,b);return a}function B(a){for(var b,c=a.attributes,m=c.length,f=a.ownerDocument.createElement(l+":"+a.nodeName);m--;)b=c[m],b.specified&&f.setAttribute(b.nodeName,b.nodeValue);f.style.cssText=a.style.cssText;return f}function x(a){function b(){clearTimeout(d._removeSheetTimer);c&&c.removeNode(!0);c=null}
+var c,f,d=n(a),e=a.namespaces,j=a.parentWindow;if(!C||a.printShived)return a;"undefined"==typeof e[l]&&e.add(l);j.attachEvent("onbeforeprint",function(){b();var g,i,d;d=a.styleSheets;for(var e=[],h=d.length,k=Array(h);h--;)k[h]=d[h];for(;d=k.pop();)if(!d.disabled&&D.test(d.media)){try{g=d.imports,i=g.length}catch(j){i=0}for(h=0;h<i;h++)k.push(g[h]);try{e.push(d.cssText)}catch(n){}}g=e.reverse().join("").split("{");i=g.length;h=RegExp("(^|[\\s,>+~])("+o().join("|")+")(?=[[\\s,>+~#.:]|$)","gi");for(k=
+"$1"+l+"\\:$2";i--;)e=g[i]=g[i].split("}"),e[e.length-1]=e[e.length-1].replace(h,k),g[i]=e.join("}");e=g.join("{");i=a.getElementsByTagName("*");h=i.length;k=RegExp("^(?:"+o().join("|")+")$","i");for(d=[];h--;)g=i[h],k.test(g.nodeName)&&d.push(g.applyElement(B(g)));f=d;c=s(a,e)});j.attachEvent("onafterprint",function(){for(var a=f,c=a.length;c--;)a[c].removeNode();clearTimeout(d._removeSheetTimer);d._removeSheetTimer=setTimeout(b,500)});a.printShived=!0;return a}var r=j.html5||{},z=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
+y=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q,u="_html5shiv",p=0,t={},e;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";q="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}e=b}catch(d){e=q=!0}})();var d={elements:r.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
+version:"3.6.2pre",shivCSS:!1!==r.shivCSS,supportsUnknownElements:e,shivMethods:!1!==r.shivMethods,type:"default",shivDocument:w,createElement:v,createDocumentFragment:function(a,b){a||(a=f);if(e)return a.createDocumentFragment();for(var b=b||n(a),c=b.frag.cloneNode(),d=0,j=o(),l=j.length;d<l;d++)c.createElement(j[d]);return c}};j.html5=d;w(f);var D=/^$|\b(?:all|print)\b/,l="html5shiv",C=!e&&function(){var a=f.documentElement;return!("undefined"==typeof f.namespaces||"undefined"==typeof f.parentWindow||
+"undefined"==typeof a.applyElement||"undefined"==typeof a.removeNode||"undefined"==typeof j.attachEvent)}();d.type+=" print";d.shivPrint=x;x(f)})(this,document);

+ 8 - 0
omnomirc_www/aFarkas-html5shiv-4525162/dist/html5shiv.js

@@ -0,0 +1,8 @@
+/*
+ HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
+a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
+c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
+"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
+for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

+ 11 - 0
omnomirc_www/aFarkas-html5shiv-4525162/readme.md

@@ -0,0 +1,11 @@
+# The HTML5 Shiv
+
+`github.com/afarkas/html5shiv` is the home of the development of The HTML5 Shiv. This script is the defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer, as well as default HTML5 styling in Internet Explorer 6 - 9, Safari 4.x (and iPhone 3.x), and Firefox 3.x.
+
+For the full story of the Shiv and all people involved, read [The Story of the HTML5 Shiv](http://paulirish.com/2011/the-history-of-the-html5-shiv/).
+
+The shiv is now maintained by Alexander Farkas, Jonathan Neal, and Paul Irish, with many contributions from John-David Dalton.
+
+The shiv is officially distributed by Modernizr, and the two google code projects html5shiv and html5shim (maintained by Remy Sharp).
+
+If you have any issues in those implementations, you can report them here. :)

+ 496 - 0
omnomirc_www/aFarkas-html5shiv-4525162/src/html5shiv-printshiv.js

@@ -0,0 +1,496 @@
+/**
+* @preserve HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+;(function(window, document) {
+/*jshint evil:true */
+  /** version */
+  var version = '3.6.2pre';
+
+  /** Preset options */
+  var options = window.html5 || {};
+
+  /** Used to skip problem elements */
+  var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
+
+  /** Not all elements can be cloned in IE **/
+  var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
+
+  /** Detect whether the browser supports default html5 styles */
+  var supportsHtml5Styles;
+
+  /** Name of the expando, to work with multiple documents or to re-shiv one document */
+  var expando = '_html5shiv';
+
+  /** The id for the the documents expando */
+  var expanID = 0;
+
+  /** Cached data for each document */
+  var expandoData = {};
+
+  /** Detect whether the browser supports unknown elements */
+  var supportsUnknownElements;
+
+  (function() {
+    try {
+        var a = document.createElement('a');
+        a.innerHTML = '<xyz></xyz>';
+        //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
+        supportsHtml5Styles = ('hidden' in a);
+
+        supportsUnknownElements = a.childNodes.length == 1 || (function() {
+          // assign a false positive if unable to shiv
+          (document.createElement)('a');
+          var frag = document.createDocumentFragment();
+          return (
+            typeof frag.cloneNode == 'undefined' ||
+            typeof frag.createDocumentFragment == 'undefined' ||
+            typeof frag.createElement == 'undefined'
+          );
+        }());
+    } catch(e) {
+      supportsHtml5Styles = true;
+      supportsUnknownElements = true;
+    }
+
+  }());
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * Creates a style sheet with the given CSS text and adds it to the document.
+   * @private
+   * @param {Document} ownerDocument The document.
+   * @param {String} cssText The CSS text.
+   * @returns {StyleSheet} The style element.
+   */
+  function addStyleSheet(ownerDocument, cssText) {
+    var p = ownerDocument.createElement('p'),
+        parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
+
+    p.innerHTML = 'x<style>' + cssText + '</style>';
+    return parent.insertBefore(p.lastChild, parent.firstChild);
+  }
+
+  /**
+   * Returns the value of `html5.elements` as an array.
+   * @private
+   * @returns {Array} An array of shived element node names.
+   */
+  function getElements() {
+    var elements = html5.elements;
+    return typeof elements == 'string' ? elements.split(' ') : elements;
+  }
+  
+    /**
+   * Returns the data associated to the given document
+   * @private
+   * @param {Document} ownerDocument The document.
+   * @returns {Object} An object of data.
+   */
+  function getExpandoData(ownerDocument) {
+    var data = expandoData[ownerDocument[expando]];
+    if (!data) {
+        data = {};
+        expanID++;
+        ownerDocument[expando] = expanID;
+        expandoData[expanID] = data;
+    }
+    return data;
+  }
+
+  /**
+   * returns a shived element for the given nodeName and document
+   * @memberOf html5
+   * @param {String} nodeName name of the element
+   * @param {Document} ownerDocument The context document.
+   * @returns {Object} The shived element.
+   */
+  function createElement(nodeName, ownerDocument, data){
+    if (!ownerDocument) {
+        ownerDocument = document;
+    }
+    if(supportsUnknownElements){
+        return ownerDocument.createElement(nodeName);
+    }
+    if (!data) {
+        data = getExpandoData(ownerDocument);
+    }
+    var node;
+
+    if (data.cache[nodeName]) {
+        node = data.cache[nodeName].cloneNode();
+    } else if (saveClones.test(nodeName)) {
+        node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
+    } else {
+        node = data.createElem(nodeName);
+    }
+
+    // Avoid adding some elements to fragments in IE < 9 because
+    // * Attributes like `name` or `type` cannot be set/changed once an element
+    //   is inserted into a document/fragment
+    // * Link elements with `src` attributes that are inaccessible, as with
+    //   a 403 response, will cause the tab/window to crash
+    // * Script elements appended to fragments will execute when their `src`
+    //   or `text` property is set
+    return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
+  }
+
+  /**
+   * returns a shived DocumentFragment for the given document
+   * @memberOf html5
+   * @param {Document} ownerDocument The context document.
+   * @returns {Object} The shived DocumentFragment.
+   */
+  function createDocumentFragment(ownerDocument, data){
+    if (!ownerDocument) {
+        ownerDocument = document;
+    }
+    if(supportsUnknownElements){
+        return ownerDocument.createDocumentFragment();
+    }
+    data = data || getExpandoData(ownerDocument);
+    var clone = data.frag.cloneNode(),
+        i = 0,
+        elems = getElements(),
+        l = elems.length;
+    for(;i<l;i++){
+        clone.createElement(elems[i]);
+    }
+    return clone;
+  }
+
+  /**
+   * Shivs the `createElement` and `createDocumentFragment` methods of the document.
+   * @private
+   * @param {Document|DocumentFragment} ownerDocument The document.
+   * @param {Object} data of the document.
+   */
+  function shivMethods(ownerDocument, data) {
+    if (!data.cache) {
+        data.cache = {};
+        data.createElem = ownerDocument.createElement;
+        data.createFrag = ownerDocument.createDocumentFragment;
+        data.frag = data.createFrag();
+    }
+
+
+    ownerDocument.createElement = function(nodeName) {
+      //abort shiv
+      if (!html5.shivMethods) {
+          return data.createElem(nodeName);
+      }
+      return createElement(nodeName, ownerDocument, data);
+    };
+
+    ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
+      'var n=f.cloneNode(),c=n.createElement;' +
+      'h.shivMethods&&(' +
+        // unroll the `createElement` calls
+        getElements().join().replace(/\w+/g, function(nodeName) {
+          data.createElem(nodeName);
+          data.frag.createElement(nodeName);
+          return 'c("' + nodeName + '")';
+        }) +
+      ');return n}'
+    )(html5, data.frag);
+  }
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * Shivs the given document.
+   * @memberOf html5
+   * @param {Document} ownerDocument The document to shiv.
+   * @returns {Document} The shived document.
+   */
+  function shivDocument(ownerDocument) {
+    if (!ownerDocument) {
+        ownerDocument = document;
+    }
+    var data = getExpandoData(ownerDocument);
+
+    if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
+      data.hasCSS = !!addStyleSheet(ownerDocument,
+        // corrects block display not defined in IE6/7/8/9
+        'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
+        // adds styling not present in IE6/7/8/9
+        'mark{background:#FF0;color:#000}'
+      );
+    }
+    if (!supportsUnknownElements) {
+      shivMethods(ownerDocument, data);
+    }
+    return ownerDocument;
+  }
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * The `html5` object is exposed so that more elements can be shived and
+   * existing shiving can be detected on iframes.
+   * @type Object
+   * @example
+   *
+   * // options can be changed before the script is included
+   * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
+   */
+  var html5 = {
+
+    /**
+     * An array or space separated string of node names of the elements to shiv.
+     * @memberOf html5
+     * @type Array|String
+     */
+    'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video',
+
+    /**
+     * current version of html5shiv
+     */
+    'version': version,
+
+    /**
+     * A flag to indicate that the HTML5 style sheet should be inserted.
+     * @memberOf html5
+     * @type Boolean
+     */
+    'shivCSS': (options.shivCSS !== false),
+
+    /**
+     * Is equal to true if a browser supports creating unknown/HTML5 elements
+     * @memberOf html5
+     * @type boolean
+     */
+    'supportsUnknownElements': supportsUnknownElements,
+
+    /**
+     * A flag to indicate that the document's `createElement` and `createDocumentFragment`
+     * methods should be overwritten.
+     * @memberOf html5
+     * @type Boolean
+     */
+    'shivMethods': (options.shivMethods !== false),
+
+    /**
+     * A string to describe the type of `html5` object ("default" or "default print").
+     * @memberOf html5
+     * @type String
+     */
+    'type': 'default',
+
+    // shivs the document according to the specified `html5` object options
+    'shivDocument': shivDocument,
+
+    //creates a shived element
+    createElement: createElement,
+
+    //creates a shived documentFragment
+    createDocumentFragment: createDocumentFragment
+  };
+
+  /*--------------------------------------------------------------------------*/
+
+  // expose html5
+  window.html5 = html5;
+
+  // shiv the document
+  shivDocument(document);
+
+  /*------------------------------- Print Shiv -------------------------------*/
+
+  /** Used to filter media types */
+  var reMedia = /^$|\b(?:all|print)\b/;
+
+  /** Used to namespace printable elements */
+  var shivNamespace = 'html5shiv';
+
+  /** Detect whether the browser supports shivable style sheets */
+  var supportsShivableSheets = !supportsUnknownElements && (function() {
+    // assign a false negative if unable to shiv
+    var docEl = document.documentElement;
+    return !(
+      typeof document.namespaces == 'undefined' ||
+      typeof document.parentWindow == 'undefined' ||
+      typeof docEl.applyElement == 'undefined' ||
+      typeof docEl.removeNode == 'undefined' ||
+      typeof window.attachEvent == 'undefined'
+    );
+  }());
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * Wraps all HTML5 elements in the given document with printable elements.
+   * (eg. the "header" element is wrapped with the "html5shiv:header" element)
+   * @private
+   * @param {Document} ownerDocument The document.
+   * @returns {Array} An array wrappers added.
+   */
+  function addWrappers(ownerDocument) {
+    var node,
+        nodes = ownerDocument.getElementsByTagName('*'),
+        index = nodes.length,
+        reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'),
+        result = [];
+
+    while (index--) {
+      node = nodes[index];
+      if (reElements.test(node.nodeName)) {
+        result.push(node.applyElement(createWrapper(node)));
+      }
+    }
+    return result;
+  }
+
+  /**
+   * Creates a printable wrapper for the given element.
+   * @private
+   * @param {Element} element The element.
+   * @returns {Element} The wrapper.
+   */
+  function createWrapper(element) {
+    var node,
+        nodes = element.attributes,
+        index = nodes.length,
+        wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName);
+
+    // copy element attributes to the wrapper
+    while (index--) {
+      node = nodes[index];
+      node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue);
+    }
+    // copy element styles to the wrapper
+    wrapper.style.cssText = element.style.cssText;
+    return wrapper;
+  }
+
+  /**
+   * Shivs the given CSS text.
+   * (eg. header{} becomes html5shiv\:header{})
+   * @private
+   * @param {String} cssText The CSS text to shiv.
+   * @returns {String} The shived CSS text.
+   */
+  function shivCssText(cssText) {
+    var pair,
+        parts = cssText.split('{'),
+        index = parts.length,
+        reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'),
+        replacement = '$1' + shivNamespace + '\\:$2';
+
+    while (index--) {
+      pair = parts[index] = parts[index].split('}');
+      pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement);
+      parts[index] = pair.join('}');
+    }
+    return parts.join('{');
+  }
+
+  /**
+   * Removes the given wrappers, leaving the original elements.
+   * @private
+   * @params {Array} wrappers An array of printable wrappers.
+   */
+  function removeWrappers(wrappers) {
+    var index = wrappers.length;
+    while (index--) {
+      wrappers[index].removeNode();
+    }
+  }
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * Shivs the given document for print.
+   * @memberOf html5
+   * @param {Document} ownerDocument The document to shiv.
+   * @returns {Document} The shived document.
+   */
+  function shivPrint(ownerDocument) {
+    var shivedSheet,
+        wrappers,
+        data = getExpandoData(ownerDocument),
+        namespaces = ownerDocument.namespaces,
+        ownerWindow = ownerDocument.parentWindow;
+
+    if (!supportsShivableSheets || ownerDocument.printShived) {
+      return ownerDocument;
+    }
+    if (typeof namespaces[shivNamespace] == 'undefined') {
+      namespaces.add(shivNamespace);
+    }
+
+    function removeSheet() {
+      clearTimeout(data._removeSheetTimer);
+      if (shivedSheet) {
+          shivedSheet.removeNode(true);
+      }
+      shivedSheet= null;
+    }
+
+    ownerWindow.attachEvent('onbeforeprint', function() {
+
+      removeSheet();
+
+      var imports,
+          length,
+          sheet,
+          collection = ownerDocument.styleSheets,
+          cssText = [],
+          index = collection.length,
+          sheets = Array(index);
+
+      // convert styleSheets collection to an array
+      while (index--) {
+        sheets[index] = collection[index];
+      }
+      // concat all style sheet CSS text
+      while ((sheet = sheets.pop())) {
+        // IE does not enforce a same origin policy for external style sheets...
+        // but has trouble with some dynamically created stylesheets
+        if (!sheet.disabled && reMedia.test(sheet.media)) {
+
+          try {
+            imports = sheet.imports;
+            length = imports.length;
+          } catch(er){
+            length = 0;
+          }
+
+          for (index = 0; index < length; index++) {
+            sheets.push(imports[index]);
+          }
+
+          try {
+            cssText.push(sheet.cssText);
+          } catch(er){}
+        }
+      }
+
+      // wrap all HTML5 elements with printable elements and add the shived style sheet
+      cssText = shivCssText(cssText.reverse().join(''));
+      wrappers = addWrappers(ownerDocument);
+      shivedSheet = addStyleSheet(ownerDocument, cssText);
+
+    });
+
+    ownerWindow.attachEvent('onafterprint', function() {
+      // remove wrappers, leaving the original elements, and remove the shived style sheet
+      removeWrappers(wrappers);
+      clearTimeout(data._removeSheetTimer);
+      data._removeSheetTimer = setTimeout(removeSheet, 500);
+    });
+
+    ownerDocument.printShived = true;
+    return ownerDocument;
+  }
+
+  /*--------------------------------------------------------------------------*/
+
+  // expose API
+  html5.type += ' print';
+  html5.shivPrint = shivPrint;
+
+  // shiv for print
+  shivPrint(document);
+
+}(this, document));

+ 298 - 0
omnomirc_www/aFarkas-html5shiv-4525162/src/html5shiv.js

@@ -0,0 +1,298 @@
+/**
+* @preserve HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+;(function(window, document) {
+/*jshint evil:true */
+  /** version */
+  var version = '3.6.2pre';
+
+  /** Preset options */
+  var options = window.html5 || {};
+
+  /** Used to skip problem elements */
+  var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
+
+  /** Not all elements can be cloned in IE **/
+  var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
+
+  /** Detect whether the browser supports default html5 styles */
+  var supportsHtml5Styles;
+
+  /** Name of the expando, to work with multiple documents or to re-shiv one document */
+  var expando = '_html5shiv';
+
+  /** The id for the the documents expando */
+  var expanID = 0;
+
+  /** Cached data for each document */
+  var expandoData = {};
+
+  /** Detect whether the browser supports unknown elements */
+  var supportsUnknownElements;
+
+  (function() {
+    try {
+        var a = document.createElement('a');
+        a.innerHTML = '<xyz></xyz>';
+        //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
+        supportsHtml5Styles = ('hidden' in a);
+
+        supportsUnknownElements = a.childNodes.length == 1 || (function() {
+          // assign a false positive if unable to shiv
+          (document.createElement)('a');
+          var frag = document.createDocumentFragment();
+          return (
+            typeof frag.cloneNode == 'undefined' ||
+            typeof frag.createDocumentFragment == 'undefined' ||
+            typeof frag.createElement == 'undefined'
+          );
+        }());
+    } catch(e) {
+      supportsHtml5Styles = true;
+      supportsUnknownElements = true;
+    }
+
+  }());
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * Creates a style sheet with the given CSS text and adds it to the document.
+   * @private
+   * @param {Document} ownerDocument The document.
+   * @param {String} cssText The CSS text.
+   * @returns {StyleSheet} The style element.
+   */
+  function addStyleSheet(ownerDocument, cssText) {
+    var p = ownerDocument.createElement('p'),
+        parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
+
+    p.innerHTML = 'x<style>' + cssText + '</style>';
+    return parent.insertBefore(p.lastChild, parent.firstChild);
+  }
+
+  /**
+   * Returns the value of `html5.elements` as an array.
+   * @private
+   * @returns {Array} An array of shived element node names.
+   */
+  function getElements() {
+    var elements = html5.elements;
+    return typeof elements == 'string' ? elements.split(' ') : elements;
+  }
+  
+    /**
+   * Returns the data associated to the given document
+   * @private
+   * @param {Document} ownerDocument The document.
+   * @returns {Object} An object of data.
+   */
+  function getExpandoData(ownerDocument) {
+    var data = expandoData[ownerDocument[expando]];
+    if (!data) {
+        data = {};
+        expanID++;
+        ownerDocument[expando] = expanID;
+        expandoData[expanID] = data;
+    }
+    return data;
+  }
+
+  /**
+   * returns a shived element for the given nodeName and document
+   * @memberOf html5
+   * @param {String} nodeName name of the element
+   * @param {Document} ownerDocument The context document.
+   * @returns {Object} The shived element.
+   */
+  function createElement(nodeName, ownerDocument, data){
+    if (!ownerDocument) {
+        ownerDocument = document;
+    }
+    if(supportsUnknownElements){
+        return ownerDocument.createElement(nodeName);
+    }
+    if (!data) {
+        data = getExpandoData(ownerDocument);
+    }
+    var node;
+
+    if (data.cache[nodeName]) {
+        node = data.cache[nodeName].cloneNode();
+    } else if (saveClones.test(nodeName)) {
+        node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
+    } else {
+        node = data.createElem(nodeName);
+    }
+
+    // Avoid adding some elements to fragments in IE < 9 because
+    // * Attributes like `name` or `type` cannot be set/changed once an element
+    //   is inserted into a document/fragment
+    // * Link elements with `src` attributes that are inaccessible, as with
+    //   a 403 response, will cause the tab/window to crash
+    // * Script elements appended to fragments will execute when their `src`
+    //   or `text` property is set
+    return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
+  }
+
+  /**
+   * returns a shived DocumentFragment for the given document
+   * @memberOf html5
+   * @param {Document} ownerDocument The context document.
+   * @returns {Object} The shived DocumentFragment.
+   */
+  function createDocumentFragment(ownerDocument, data){
+    if (!ownerDocument) {
+        ownerDocument = document;
+    }
+    if(supportsUnknownElements){
+        return ownerDocument.createDocumentFragment();
+    }
+    data = data || getExpandoData(ownerDocument);
+    var clone = data.frag.cloneNode(),
+        i = 0,
+        elems = getElements(),
+        l = elems.length;
+    for(;i<l;i++){
+        clone.createElement(elems[i]);
+    }
+    return clone;
+  }
+
+  /**
+   * Shivs the `createElement` and `createDocumentFragment` methods of the document.
+   * @private
+   * @param {Document|DocumentFragment} ownerDocument The document.
+   * @param {Object} data of the document.
+   */
+  function shivMethods(ownerDocument, data) {
+    if (!data.cache) {
+        data.cache = {};
+        data.createElem = ownerDocument.createElement;
+        data.createFrag = ownerDocument.createDocumentFragment;
+        data.frag = data.createFrag();
+    }
+
+
+    ownerDocument.createElement = function(nodeName) {
+      //abort shiv
+      if (!html5.shivMethods) {
+          return data.createElem(nodeName);
+      }
+      return createElement(nodeName, ownerDocument, data);
+    };
+
+    ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
+      'var n=f.cloneNode(),c=n.createElement;' +
+      'h.shivMethods&&(' +
+        // unroll the `createElement` calls
+        getElements().join().replace(/\w+/g, function(nodeName) {
+          data.createElem(nodeName);
+          data.frag.createElement(nodeName);
+          return 'c("' + nodeName + '")';
+        }) +
+      ');return n}'
+    )(html5, data.frag);
+  }
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * Shivs the given document.
+   * @memberOf html5
+   * @param {Document} ownerDocument The document to shiv.
+   * @returns {Document} The shived document.
+   */
+  function shivDocument(ownerDocument) {
+    if (!ownerDocument) {
+        ownerDocument = document;
+    }
+    var data = getExpandoData(ownerDocument);
+
+    if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
+      data.hasCSS = !!addStyleSheet(ownerDocument,
+        // corrects block display not defined in IE6/7/8/9
+        'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
+        // adds styling not present in IE6/7/8/9
+        'mark{background:#FF0;color:#000}'
+      );
+    }
+    if (!supportsUnknownElements) {
+      shivMethods(ownerDocument, data);
+    }
+    return ownerDocument;
+  }
+
+  /*--------------------------------------------------------------------------*/
+
+  /**
+   * The `html5` object is exposed so that more elements can be shived and
+   * existing shiving can be detected on iframes.
+   * @type Object
+   * @example
+   *
+   * // options can be changed before the script is included
+   * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
+   */
+  var html5 = {
+
+    /**
+     * An array or space separated string of node names of the elements to shiv.
+     * @memberOf html5
+     * @type Array|String
+     */
+    'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video',
+
+    /**
+     * current version of html5shiv
+     */
+    'version': version,
+
+    /**
+     * A flag to indicate that the HTML5 style sheet should be inserted.
+     * @memberOf html5
+     * @type Boolean
+     */
+    'shivCSS': (options.shivCSS !== false),
+
+    /**
+     * Is equal to true if a browser supports creating unknown/HTML5 elements
+     * @memberOf html5
+     * @type boolean
+     */
+    'supportsUnknownElements': supportsUnknownElements,
+
+    /**
+     * A flag to indicate that the document's `createElement` and `createDocumentFragment`
+     * methods should be overwritten.
+     * @memberOf html5
+     * @type Boolean
+     */
+    'shivMethods': (options.shivMethods !== false),
+
+    /**
+     * A string to describe the type of `html5` object ("default" or "default print").
+     * @memberOf html5
+     * @type String
+     */
+    'type': 'default',
+
+    // shivs the document according to the specified `html5` object options
+    'shivDocument': shivDocument,
+
+    //creates a shived element
+    createElement: createElement,
+
+    //creates a shived documentFragment
+    createDocumentFragment: createDocumentFragment
+  };
+
+  /*--------------------------------------------------------------------------*/
+
+  // expose html5
+  window.html5 = html5;
+
+  // shiv the document
+  shivDocument(document);
+
+}(this, document));

BIN
omnomirc_www/aFarkas-html5shiv-4525162/test/data/body-crash.jpg


+ 103 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/iframed-tests.html

@@ -0,0 +1,103 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>iframe tests</title>
+		
+		
+		<style>
+			body {
+				background: url(body-crash.jpg) no-repeat -999px -999px;
+			}
+			article {
+				border: 2px solid #8C8;
+			}
+		</style>
+		<script>
+			(function(){
+				window.querys = {};
+				var name;
+				var search= location.search.replace('?', '');
+				if(search){
+					search = search.split('&');
+					for(var i = 0; i < search.length; i++){
+						name = search[i].split('=');
+						querys[name[0]] = true;
+					}
+				}
+			})();
+		</script>
+		<script>
+			if(querys.disableMethodsBefore){
+				if(!window.html5){
+					window.html5 = {};
+				}
+				window.html5.shivMethods = false;
+			}
+			if(querys.disableCSS){
+				if(!window.html5){
+					window.html5 = {};
+				}
+				window.html5.shivCSS = false;
+			}
+			if(querys.addUnknownBefore){
+				if(!window.html5){
+					window.html5 = {};
+				}
+				window.html5.elements = 'abcxyz abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video';
+			}
+			
+			
+			if(!querys.noEmbed){
+				document.write('<script src="..\/..\/src\/html5shiv-printshiv.js"><\/script>');
+			}
+		</script>
+		<script>
+		
+			if(querys.disableMethodsAfter){
+				window.html5.shivMethods = false;
+			}
+			
+			if(querys.addUnknownAfter){
+				window.html5.elements = 'abcxyz abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video';
+				html5.shivDocument(document);
+			}
+		</script>
+		
+	</head>
+	<body>
+		<div id="qunit-fixture">
+			<abcxyz>
+				<div class="inside"></div>
+			</abcxyz>
+			<article>
+				<div class="inside"></div>
+			</article>
+			<aside>
+				<div class="inside"></div>
+			</aside>
+			<figcaption>
+				<div class="inside"></div>
+			</figcaption>
+			<figure>
+				<div class="inside"></div>
+			</figure>
+			<footer>
+				<div class="inside"></div>
+			</footer>
+			<header>
+				<div class="inside"></div>
+			</header>
+			<hgroup>
+				<div class="inside"></div>
+			</hgroup>
+			<nav>
+				<div class="inside"></div>
+			</nav>
+			<section>
+				<div class="inside"></div>
+			</section>
+			
+		</div>
+	</body>
+</html>

+ 11 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/inline-mixed-media.css

@@ -0,0 +1,11 @@
+@media screen, handheld {
+	article.inline-mixed-media {
+		border: 5px solid #000;
+	}
+}
+
+@media print  {
+	article.inline-mixed-media {
+		border: 5px dotted #000;
+	}
+}

+ 8 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/inline-print-media.css

@@ -0,0 +1,8 @@
+.inline-print-media form {
+	border: 5px solid #000;
+}
+@media print  {
+	.inline-print-media form {
+		border: 5px dotted #000;
+	}
+}

+ 8 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/no-print.css

@@ -0,0 +1,8 @@
+article:before {
+   content: "isfnotorprint";
+   isfnotorprint: true;
+}
+article {
+   content: "isfnotorprint";
+   isfnotorprint: true;
+}

BIN
omnomirc_www/aFarkas-html5shiv-4525162/test/data/paramtracer.swf


+ 8 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/print-styles.css

@@ -0,0 +1,8 @@
+.print-styles article {
+	border: 5px dotted #000;
+}
+@media print {
+	article.print-styles-print {
+		border: 5px dotted #000;
+	}
+}

+ 3 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/print.css

@@ -0,0 +1,3 @@
+article.print {
+	border: 5px dotted #000;
+}

+ 9 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/data/screen.css

@@ -0,0 +1,9 @@
+article.print {
+	border: 5px solid #000;
+}
+.print-styles article {
+	border: 5px solid #000;
+}
+article.print-styles-print {
+	border: 5px solid #000;
+}

+ 85 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/highcharts/area-basic.html

@@ -0,0 +1,85 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>Highcharts Example</title>
+		<script src="../../src/html5shiv-printshiv.js"></script>
+		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
+		<script src="highcharts.js"></script>
+	</head>
+	<body>
+		<div id="container" style="width:800px;height:400px;margin:0 auto"></div>
+		<script>
+			new Highcharts.Chart({
+				'chart': {
+					'renderTo': 'container',
+					'defaultSeriesType': 'area'
+				},
+				'title': {
+					'text': 'US and USSR nuclear stockpiles'
+				},
+				'subtitle': {
+					'text': 'Source: <a href="http://thebulletin.metapress.com/content/c4120650912x74k7/fulltext.pdf">'+
+						'thebulletin.metapress.com</a>'
+				},
+				'xAxis': {
+					'labels': {
+						'formatter': function() {
+							return this.value;
+						}
+					}
+				},
+				'yAxis': {
+					'title': {
+						'text': 'Nuclear weapon states'
+					},
+					'labels': {
+						'formatter': function() {
+							return this.value / 1000 +'k';
+						}
+					}
+				},
+				'tooltip': {
+					'formatter': function() {
+						return this.series.name +' produced <b>'+
+							Highcharts.numberFormat(this.y, 0) +'</b><br/>warheads in '+ this.x;
+					}
+				},
+				'plotOptions': {
+					'area': {
+						'pointStart': 1940,
+						'marker': {
+							'enabled': false,
+							'symbol': 'circle',
+							'radius': 2,
+							'states': {
+								'hover': {
+									'enabled': true
+								}
+							}
+						}
+					}
+				},
+				'series': [{
+					'name': 'USA',
+					'data': [null, null, null, null, null, 6 , 11, 32, 110, 235, 369, 640,
+						1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126,
+						27387, 29459, 31056, 31982, 32040, 31233, 29224, 27342, 26662,
+						26956, 27912, 28999, 28965, 27826, 25579, 25722, 24826, 24605,
+						24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586,
+						22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950,
+						10871, 10824, 10577, 10527, 10475, 10421, 10358, 10295, 10104 ]
+				}, {
+					'name': 'USSR/Russia',
+					'data': [null, null, null, null, null, null, null , null, null, null,
+					5, 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322,
+					4238, 5221, 6129, 7089, 8339, 9399, 10538, 11643, 13092, 14478,
+					15915, 17385, 19055, 21205, 23044, 25393, 27935, 30062, 32049,
+					33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000, 37000,
+					35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000,
+					21000, 20000, 19000, 18000, 18000, 17000, 16000]
+				}]
+			});
+		</script>
+	</body>
+</html>

+ 176 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/highcharts/highcharts.js

@@ -0,0 +1,176 @@
+/*
+ Highcharts JS v2.1.9 (2011-11-11)
+
+ (c) 2009-2011 Torstein H?nsi
+
+ License: www.highcharts.com/license
+*/
+(function(){function sa(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function ja(a,b){return parseInt(a,b||10)}function Sb(a){return typeof a==="string"}function Nb(a){return typeof a==="object"}function lc(a){return typeof a==="number"}function mc(a){return Fa.log(a)/Fa.LN10}function nc(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function K(a){return a!==Wa&&a!==null}function Ga(a,b,c){var d,e;if(Sb(b))if(K(c))a.setAttribute(b,c);else{if(a&&a.getAttribute)e=a.getAttribute(b)}else if(K(b)&&
+Nb(b))for(d in b)a.setAttribute(d,b[d]);return e}function zc(a){return Object.prototype.toString.call(a)==="[object Array]"?a:[a]}function A(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++){c=a[b];if(typeof c!=="undefined"&&c!==null)return c}}function Ja(a,b){if(Pc)if(b&&b.opacity!==Wa)b.filter="alpha(opacity="+b.opacity*100+")";sa(a.style,b)}function hb(a,b,c,d,e){a=ua.createElement(a);b&&sa(a,b);e&&Ja(a,{padding:0,border:jb,margin:0});c&&Ja(a,c);d&&d.appendChild(a);return a}function yb(a,b){var c=
+function(){};c.prototype=new a;sa(c.prototype,b);return c}function Ed(a,b,c,d){var e=Xa.lang;a=a;var f=isNaN(b=bb(b))?2:b;b=c===undefined?e.decimalPoint:c;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";c=String(ja(a=bb(+a||0).toFixed(f)));var g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+bb(a-c).toFixed(f).slice(2):"")}function Fd(a){var b={left:a.offsetLeft,top:a.offsetTop};for(a=a.offsetParent;a;){b.left+=a.offsetLeft;b.top+=a.offsetTop;
+if(a!==ua.body&&a!==ua.documentElement){b.left-=a.scrollLeft;b.top-=a.scrollTop}a=a.offsetParent}return b}function Gd(){this.symbol=this.color=0}function fe(a,b,c,d,e,f,g){var h=g.x;g=g.y;var i=h-a+c-25,j=g-b+d+10,m;if(i<7)i=c+h+15;if(i+a>c+e){i-=i+a-(c+e);j-=b;m=true}if(j<5){j=5;if(m&&g>=j&&g<=j+b)j=g+b-5}else if(j+b>d+f)j=d+f-b-5;return{x:i,y:j}}function Hd(a,b){var c=a.length,d;for(d=0;d<c;d++)a[d].ss_i=d;a.sort(function(e,f){var g=b(e,f);return g===0?e.ss_i-f.ss_i:g});for(d=0;d<c;d++)delete a[d].ss_i}
+function Ac(a){for(var b in a){a[b]&&a[b].destroy&&a[b].destroy();delete a[b]}}function oc(a,b){Bc=A(a,b.animation)}function Id(){var a=Xa.global.useUTC;Qc=a?Date.UTC:function(b,c,d,e,f,g){return(new Date(b,c,A(d,1),A(e,0),A(f,0),A(g,0))).getTime()};id=a?"getUTCMinutes":"getMinutes";jd=a?"getUTCHours":"getHours";kd=a?"getUTCDay":"getDay";Cc=a?"getUTCDate":"getDate";Rc=a?"getUTCMonth":"getMonth";Sc=a?"getUTCFullYear":"getFullYear";Jd=a?"setUTCMinutes":"setMinutes";Kd=a?"setUTCHours":"setHours";ld=
+a?"setUTCDate":"setDate";Ld=a?"setUTCMonth":"setMonth";Md=a?"setUTCFullYear":"setFullYear"}function pc(a){Tc||(Tc=hb(Tb));a&&Tc.appendChild(a);Tc.innerHTML=""}function Uc(){}function Nd(a,b){function c(p){function q(k,n){this.pos=k;this.minor=n;this.isNew=true;n||this.addLabel()}function w(k){if(k){this.options=k;this.id=k.id}return this}function x(k,n,t,r){this.isNegative=n;this.options=k;this.x=t;this.stack=r;this.alignOptions={align:k.align||(va?n?"left":"right":"center"),verticalAlign:k.verticalAlign||
+(va?"middle":n?"bottom":"top"),y:A(k.y,va?4:n?14:-6),x:A(k.x,va?n?-6:6:0)};this.textAlign=k.textAlign||(va?n?"right":"left":"center")}function V(){var k=[],n=[],t;pa=wa=null;zb=[];u(Ha,function(r){t=false;u(["xAxis","yAxis"],function(F){if(r.isCartesian&&(F==="xAxis"&&xa||F==="yAxis"&&!xa)&&(r.options[F]===o.index||r.options[F]===Wa&&o.index===0)){r[F]=I;zb.push(r);t=true}});if(!r.visible&&z.ignoreHiddenSeries)t=false;if(t){var J,E,Q,fa,ka,$;if(!xa){J=r.options.stacking;Vc=J==="percent";if(J){ka=
+r.options.stack;fa=r.type+A(ka,"");$="-"+fa;r.stackKey=fa;E=k[fa]||[];k[fa]=E;Q=n[$]||[];n[$]=Q}if(Vc){pa=0;wa=99}}if(r.isCartesian){u(r.data,function(F){var O=F.x,S=F.y,aa=S<0,Eb=aa?Q:E,kb=aa?$:fa;if(pa===null)pa=wa=F[qa];if(xa)if(O>wa)wa=O;else{if(O<pa)pa=O}else if(K(S)){if(J)Eb[O]=K(Eb[O])?Eb[O]+S:S;S=Eb?Eb[O]:S;F=A(F.low,S);if(!Vc)if(S>wa)wa=S;else if(F<pa)pa=F;if(J){s[kb]||(s[kb]={});s[kb][O]||(s[kb][O]=new x(o.stackLabels,aa,O,ka));s[kb][O].setTotal(S)}}});if(/(area|column|bar)/.test(r.type)&&
+!xa)if(pa>=0){pa=0;Od=true}else if(wa<0){wa=0;Pd=true}}}})}function N(k,n){var t,r;Fb=n?1:Fa.pow(10,lb(Fa.log(k)/Fa.LN10));t=k/Fb;if(!n){n=[1,2,2.5,5,10];if(o.allowDecimals===false||ca)if(Fb===1)n=[1,2,5,10];else if(Fb<=0.1)n=[1/Fb]}for(r=0;r<n.length;r++){k=n[r];if(t<=(n[r]+(n[r+1]||n[r]))/2)break}k*=Fb;return k}function ta(k){var n;n=k;Fb=A(Fb,Fa.pow(10,lb(Fa.log(Ta)/Fa.LN10)));if(Fb<1){n=W(1/Fb)*10;n=W(k*n)/n}return n}function da(){var k,n,t,r,J=o.tickInterval,E=o.tickPixelInterval;k=o.maxZoom||
+(xa&&!K(o.min)&&!K(o.max)?tb(l.smallestInterval*5,wa-pa):null);ya=R?Da:Aa;if(Ub){t=l[xa?"xAxis":"yAxis"][o.linkedTo];r=t.getExtremes();ia=A(r.min,r.dataMin);ra=A(r.max,r.dataMax)}else{ia=A(Vb,o.min,pa);ra=A(Gb,o.max,wa)}if(ca){ia=mc(ia);ra=mc(ra)}if(ra-ia<k){r=(k-ra+ia)/2;ia=Ia(ia-r,A(o.min,ia-r),pa);ra=tb(ia+k,A(o.max,ia+k),wa)}if(!Ya&&!Vc&&!Ub&&K(ia)&&K(ra)){k=ra-ia||1;if(!K(o.min)&&!K(Vb)&&Qd&&(pa<0||!Od))ia-=k*Qd;if(!K(o.max)&&!K(Gb)&&Rd&&(wa>0||!Pd))ra+=k*Rd}Ta=ia===ra?1:Ub&&!J&&E===t.options.tickPixelInterval?
+t.tickInterval:A(J,Ya?1:(ra-ia)*E/ya);if(!D&&!K(o.tickInterval))Ta=N(Ta);I.tickInterval=Ta;Wc=o.minorTickInterval==="auto"&&Ta?Ta/5:o.minorTickInterval;if(D){Ba=[];J=Xa.global.useUTC;var Q=1E3/ub,fa=6E4/ub,ka=36E5/ub;E=864E5/ub;k=6048E5/ub;r=2592E6/ub;var $=31556952E3/ub,F=[["second",Q,[1,2,5,10,15,30]],["minute",fa,[1,2,5,10,15,30]],["hour",ka,[1,2,3,4,6,8,12]],["day",E,[1,2]],["week",k,[1,2]],["month",r,[1,2,3,4,6]],["year",$,null]],O=F[6],S=O[1],aa=O[2];for(t=0;t<F.length;t++){O=F[t];S=O[1];aa=
+O[2];if(F[t+1])if(Ta<=(S*aa[aa.length-1]+F[t+1][1])/2)break}if(S===$&&Ta<5*S)aa=[1,2,5];F=N(Ta/S,aa);aa=new Date(ia*ub);aa.setMilliseconds(0);if(S>=Q)aa.setSeconds(S>=fa?0:F*lb(aa.getSeconds()/F));if(S>=fa)aa[Jd](S>=ka?0:F*lb(aa[id]()/F));if(S>=ka)aa[Kd](S>=E?0:F*lb(aa[jd]()/F));if(S>=E)aa[ld](S>=r?1:F*lb(aa[Cc]()/F));if(S>=r){aa[Ld](S>=$?0:F*lb(aa[Rc]()/F));n=aa[Sc]()}if(S>=$){n-=n%F;aa[Md](n)}S===k&&aa[ld](aa[Cc]()-aa[kd]()+o.startOfWeek);t=1;n=aa[Sc]();Q=aa.getTime()/ub;fa=aa[Rc]();for(ka=aa[Cc]();Q<
+ra&&t<Da;){Ba.push(Q);if(S===$)Q=Qc(n+t*F,0)/ub;else if(S===r)Q=Qc(n,fa+t*F)/ub;else if(!J&&(S===E||S===k))Q=Qc(n,fa,ka+t*F*(S===E?1:7));else Q+=S*F;t++}Ba.push(Q);Xc=o.dateTimeLabelFormats[O[0]]}else{t=ta(lb(ia/Ta)*Ta);n=ta(md(ra/Ta)*Ta);Ba=[];for(t=ta(t);t<=n;){Ba.push(t);t=ta(t+Ta)}}if(!Ub){if(Ya||xa&&l.hasColumn){n=(Ya?1:Ta)*0.5;if(Ya||!K(A(o.min,Vb)))ia-=n;if(Ya||!K(A(o.max,Gb)))ra+=n}n=Ba[0];t=Ba[Ba.length-1];if(o.startOnTick)ia=n;else ia>n&&Ba.shift();if(o.endOnTick)ra=t;else ra<t&&Ba.pop();
+Ob||(Ob={x:0,y:0});if(!D&&Ba.length>Ob[qa])Ob[qa]=Ba.length}}function Ma(){var k,n;Dc=ia;Sd=ra;V();da();Hb=fb;fb=ya/(ra-ia||1);if(!xa)for(k in s)for(n in s[k])s[k][n].cum=s[k][n].total;if(!I.isDirty)I.isDirty=ia!==Dc||ra!==Sd}function za(k){k=(new w(k)).render();Pb.push(k);return k}function eb(){var k=o.title,n=o.stackLabels,t=o.alternateGridColor,r=o.lineWidth,J,E,Q=(J=l.hasRendered)&&K(Dc)&&!isNaN(Dc);E=zb.length&&K(ia)&&K(ra);ya=R?Da:Aa;fb=ya/(ra-ia||1);cc=R?X:vb;if(E||Ub){if(Wc&&!Ya)for(E=ia+
+(Ba[0]-ia)%Wc;E<=ra;E+=Wc){Wb[E]||(Wb[E]=new q(E,true));Q&&Wb[E].isNew&&Wb[E].render(null,true);Wb[E].isActive=true;Wb[E].render()}u(Ba,function($,F){if(!Ub||$>=ia&&$<=ra){Q&&mb[$].isNew&&mb[$].render(F,true);mb[$].isActive=true;mb[$].render(F)}});t&&u(Ba,function($,F){if(F%2===0&&$<ra){dc[$]||(dc[$]=new w);dc[$].options={from:$,to:Ba[F+1]!==Wa?Ba[F+1]:ra,color:t};dc[$].render();dc[$].isActive=true}});J||u((o.plotLines||[]).concat(o.plotBands||[]),function($){Pb.push((new w($)).render())})}u([mb,
+Wb,dc],function($){for(var F in $)if($[F].isActive)$[F].isActive=false;else{$[F].destroy();delete $[F]}});if(r){J=X+(Oa?Da:0)+la;E=cb-vb-(Oa?Aa:0)+la;J=ga.crispLine([Za,R?X:J,R?E:ea,Ka,R?$a-Ib:J,R?E:cb-vb],r);if(La)La.animate({d:J});else La=ga.path(J).attr({stroke:o.lineColor,"stroke-width":r,zIndex:7}).add()}if(ba){J=R?X:ea;r=ja(k.style.fontSize||12);J={low:J+(R?0:ya),middle:J+ya/2,high:J+(R?ya:0)}[k.align];r=(R?ea+Aa:X)+(R?1:-1)*(Oa?-1:1)*nd+(L===2?r:0);ba[ba.isNew?"attr":"animate"]({x:R?J:r+(Oa?
+Da:0)+la+(k.x||0),y:R?r-(Oa?Aa:0)+la:J+(k.y||0)});ba.isNew=false}if(n&&n.enabled){var fa,ka;n=I.stackTotalGroup;if(!n)I.stackTotalGroup=n=ga.g("stack-labels").attr({visibility:Ab,zIndex:6}).translate(X,ea).add();for(fa in s){k=s[fa];for(ka in k)k[ka].render(n)}}I.isDirty=false}function ab(k){for(var n=Pb.length;n--;)Pb[n].id===k&&Pb[n].destroy()}var xa=p.isX,Oa=p.opposite,R=va?!xa:xa,L=R?Oa?0:2:Oa?1:3,s={},o=Ca(xa?Yc:od,[ge,he,Td,ie][L],p),I=this,ba,B=o.type,D=B==="datetime",ca=B==="logarithmic",
+la=o.offset||0,qa=xa?"x":"y",ya,fb,Hb,cc=R?X:vb,G,ha,na,Ra,La,pa,wa,zb,Vb,Gb,ra=null,ia=null,Dc,Sd,Qd=o.minPadding,Rd=o.maxPadding,Ub=K(o.linkedTo),Od,Pd,Vc;B=o.events;var pd,Pb=[],Ta,Wc,Fb,Ba,mb={},Wb={},dc={},qc,rc,nd,Xc,Ya=o.categories,je=o.labels.formatter||function(){var k=this.value;return Xc?Zc(Xc,k):Ta%1E6===0?k/1E6+"M":Ta%1E3===0?k/1E3+"k":!Ya&&k>=1E3?Ed(k,0):k},$c=R&&o.labels.staggerLines,ec=o.reversed,fc=Ya&&o.tickmarkPlacement==="between"?0.5:0;q.prototype={addLabel:function(){var k=this.pos,
+n=o.labels,t=!(k===ia&&!A(o.showFirstLabel,1)||k===ra&&!A(o.showLastLabel,0)),r=Ya&&R&&Ya.length&&!n.step&&!n.staggerLines&&!n.rotation&&Da/Ya.length||!R&&Da/2,J=Ya&&K(Ya[k])?Ya[k]:k,E=this.label;k=je.call({isFirst:k===Ba[0],isLast:k===Ba[Ba.length-1],dateTimeLabelFormat:Xc,value:ca?Fa.pow(10,J):J});r=r&&{width:Ia(1,W(r-2*(n.padding||10)))+Ua};r=sa(r,n.style);if(E===Wa)this.label=K(k)&&t&&n.enabled?ga.text(k,0,0,n.useHTML).attr({align:n.align,rotation:n.rotation}).css(r).add(na):null;else E&&E.attr({text:k}).css(r)},
+getLabelSize:function(){var k=this.label;return k?(this.labelBBox=k.getBBox())[R?"height":"width"]:0},render:function(k,n){var t=!this.minor,r=this.label,J=this.pos,E=o.labels,Q=this.gridLine,fa=t?o.gridLineWidth:o.minorGridLineWidth,ka=t?o.gridLineColor:o.minorGridLineColor,$=t?o.gridLineDashStyle:o.minorGridLineDashStyle,F=this.mark,O=t?o.tickLength:o.minorTickLength,S=t?o.tickWidth:o.minorTickWidth||0,aa=t?o.tickColor:o.minorTickColor,Eb=t?o.tickPosition:o.minorTickPosition,kb=E.step,nb=n&&ad||
+cb,Qb;Qb=R?G(J+fc,null,null,n)+cc:X+la+(Oa?(n&&qd||$a)-Ib-X:0);nb=R?nb-vb+la-(Oa?Aa:0):nb-G(J+fc,null,null,n)-cc;if(fa){J=ha(J+fc,fa,n);if(Q===Wa){Q={stroke:ka,"stroke-width":fa};if($)Q.dashstyle=$;if(t)Q.zIndex=1;this.gridLine=Q=fa?ga.path(J).attr(Q).add(Ra):null}!n&&Q&&J&&Q.animate({d:J})}if(S){if(Eb==="inside")O=-O;if(Oa)O=-O;t=ga.crispLine([Za,Qb,nb,Ka,Qb+(R?0:-O),nb+(R?O:0)],S);if(F)F.animate({d:t});else this.mark=ga.path(t).attr({stroke:aa,"stroke-width":S}).add(na)}if(r&&!isNaN(Qb)){Qb=Qb+
+E.x-(fc&&R?fc*fb*(ec?-1:1):0);nb=nb+E.y-(fc&&!R?fc*fb*(ec?1:-1):0);K(E.y)||(nb+=ja(r.styles.lineHeight)*0.9-r.getBBox().height/2);if($c)nb+=k/(kb||1)%$c*16;if(kb)r[k%kb?"hide":"show"]();r[this.isNew?"attr":"animate"]({x:Qb,y:nb})}this.isNew=false},destroy:function(){Ac(this)}};w.prototype={render:function(){var k=this,n=k.options,t=n.label,r=k.label,J=n.width,E=n.to,Q=n.from,fa=n.value,ka,$=n.dashStyle,F=k.svgElem,O=[],S,aa,Eb=n.color;aa=n.zIndex;var kb=n.events;if(ca){Q=mc(Q);E=mc(E);fa=mc(fa)}if(J){O=
+ha(fa,J);n={stroke:Eb,"stroke-width":J};if($)n.dashstyle=$}else if(K(Q)&&K(E)){Q=Ia(Q,ia);E=tb(E,ra);ka=ha(E);if((O=ha(Q))&&ka)O.push(ka[4],ka[5],ka[1],ka[2]);else O=null;n={fill:Eb}}else return;if(K(aa))n.zIndex=aa;if(F)if(O)F.animate({d:O},null,F.onGetPath);else{F.hide();F.onGetPath=function(){F.show()}}else if(O&&O.length){k.svgElem=F=ga.path(O).attr(n).add();if(kb){$=function(nb){F.on(nb,function(Qb){kb[nb].apply(k,[Qb])})};for(S in kb)$(S)}}if(t&&K(t.text)&&O&&O.length&&Da>0&&Aa>0){t=Ca({align:R&&
+ka&&"center",x:R?!ka&&4:10,verticalAlign:!R&&ka&&"middle",y:R?ka?16:10:ka?6:-4,rotation:R&&!ka&&90},t);if(!r)k.label=r=ga.text(t.text,0,0).attr({align:t.textAlign||t.align,rotation:t.rotation,zIndex:aa}).css(t.style).add();ka=[O[1],O[4],A(O[6],O[1])];O=[O[2],O[5],A(O[7],O[2])];S=tb.apply(Fa,ka);aa=tb.apply(Fa,O);r.align(t,false,{x:S,y:aa,width:Ia.apply(Fa,ka)-S,height:Ia.apply(Fa,O)-aa});r.show()}else r&&r.hide();return k},destroy:function(){Ac(this);nc(Pb,this)}};x.prototype={destroy:function(){Ac(this)},
+setTotal:function(k){this.cum=this.total=k},render:function(k){var n=this.options.formatter.call(this);if(this.label)this.label.attr({text:n,visibility:ob});else this.label=l.renderer.text(n,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,visibility:ob}).add(k)},setOffset:function(k,n){var t=this.isNegative,r=I.translate(this.total),J=I.translate(0);J=bb(r-J);var E=l.xAxis[0].translate(this.x)+k,Q=l.plotHeight;t={x:va?t?r:r-J:E,y:va?Q-E-n:t?Q-r-J:Q-r,width:va?
+J:n,height:va?n:J};this.label&&this.label.align(this.alignOptions,null,t).attr({visibility:Ab})}};G=function(k,n,t,r,J){var E=1,Q=0,fa=r?Hb:fb;r=r?Dc:ia;fa||(fa=fb);if(t){E*=-1;Q=ya}if(ec){E*=-1;Q-=E*ya}if(n){if(ec)k=ya-k;k=k/fa+r;if(ca&&J)k=Fa.pow(10,k)}else{if(ca&&J)k=mc(k);k=E*(k-r)*fa+Q}return k};ha=function(k,n,t){var r,J,E;k=G(k,null,null,t);var Q=t&&ad||cb,fa=t&&qd||$a,ka;t=J=W(k+cc);r=E=W(Q-k-cc);if(isNaN(k))ka=true;else if(R){r=ea;E=Q-vb;if(t<X||t>X+Da)ka=true}else{t=X;J=fa-Ib;if(r<ea||r>
+ea+Aa)ka=true}return ka?null:ga.crispLine([Za,t,r,Ka,J,E],n||0)};if(va&&xa&&ec===Wa)ec=true;sa(I,{addPlotBand:za,addPlotLine:za,adjustTickAmount:function(){if(Ob&&!D&&!Ya&&!Ub){var k=qc,n=Ba.length;qc=Ob[qa];if(n<qc){for(;Ba.length<qc;)Ba.push(ta(Ba[Ba.length-1]+Ta));fb*=(n-1)/(qc-1);ra=Ba[Ba.length-1]}if(K(k)&&qc!==k)I.isDirty=true}},categories:Ya,getExtremes:function(){return{min:ia,max:ra,dataMin:pa,dataMax:wa,userMin:Vb,userMax:Gb}},getPlotLinePath:ha,getThreshold:function(k){if(ia>k)k=ia;else if(ra<
+k)k=ra;return G(k,0,1)},isXAxis:xa,options:o,plotLinesAndBands:Pb,getOffset:function(){var k=zb.length&&K(ia)&&K(ra),n=0,t=0,r=o.title,J=o.labels,E=[-1,1,1,-1][L],Q;if(!na){na=ga.g("axis").attr({zIndex:7}).add();Ra=ga.g("grid").attr({zIndex:1}).add()}rc=0;if(k||Ub){u(Ba,function(fa){if(mb[fa])mb[fa].addLabel();else mb[fa]=new q(fa);if(L===0||L===2||{1:"left",3:"right"}[L]===J.align)rc=Ia(mb[fa].getLabelSize(),rc)});if($c)rc+=($c-1)*16}else for(Q in mb){mb[Q].destroy();delete mb[Q]}if(r&&r.text){if(!ba){ba=
+I.axisTitle=ga.text(r.text,0,0,r.useHTML).attr({zIndex:7,rotation:r.rotation||0,align:r.textAlign||{low:"left",middle:"center",high:"right"}[r.align]}).css(r.style).add();ba.isNew=true}n=ba.getBBox()[R?"height":"width"];t=A(r.margin,R?5:10)}la=E*(o.offset||Xb[L]);nd=rc+(L!==2&&rc&&E*o.labels[R?"y":"x"])+t;Xb[L]=Ia(Xb[L],nd+n+E*la)},render:eb,setCategories:function(k,n){I.categories=p.categories=Ya=k;u(zb,function(t){t.translate();t.setTooltipPoints(true)});I.isDirty=true;A(n,true)&&l.redraw()},setExtremes:function(k,
+n,t,r){t=A(t,true);Pa(I,"setExtremes",{min:k,max:n},function(){Vb=k;Gb=n;t&&l.redraw(r)})},setScale:Ma,setTickPositions:da,translate:G,redraw:function(){Yb.resetTracker&&Yb.resetTracker();eb();u(Pb,function(k){k.render()});u(zb,function(k){k.isDirty=true})},removePlotBand:ab,removePlotLine:ab,reversed:ec,stacks:s,destroy:function(){var k;pb(I);for(k in s){Ac(s[k]);s[k]=null}if(I.stackTotalGroup)I.stackTotalGroup=I.stackTotalGroup.destroy();u([mb,Wb,dc,Pb],function(n){Ac(n)});u([La,na,Ra,ba],function(n){n&&
+n.destroy()});La=na=Ra=ba=null}});for(pd in B)Qa(I,pd,B[pd]);Ma()}function d(){var p={};return{add:function(q,w,x,V){if(!p[q]){w=ga.text(w,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-Ib-20,y:ea+30}).on("click",V).attr({align:"right",zIndex:20}).add();p[q]=w}},remove:function(q){pc(p[q].element);p[q]=null}}}function e(p){function q(){var B=this.points||zc(this),D=B[0].series.xAxis,ca=this.x;D=D&&D.options.type==="datetime";var la=Sb(ca)||D,qa;qa=la?['<span style="font-size: 10px">'+(D?Zc("%A, %b %e, %Y",
+ca):ca)+"</span>"]:[];u(B,function(ya){qa.push(ya.point.tooltipFormatter(la))});return qa.join("<br/>")}function w(B,D){L=xa?B:(2*L+B)/3;s=xa?D:(s+D)/2;o.translate(L,s);rd=bb(B-L)>1||bb(D-s)>1?function(){w(B,D)}:null}function x(){if(!xa){var B=l.hoverPoints;o.hide();u(da,function(D){D&&D.hide()});B&&u(B,function(D){D.setState()});l.hoverPoints=null;xa=true}}var V,N=p.borderWidth,ta=p.crosshairs,da=[],Ma=p.style,za=p.shared,eb=ja(Ma.padding),ab=N+eb,xa=true,Oa,R,L=0,s=0;Ma.padding=0;var o=ga.g("tooltip").attr({zIndex:8}).add(),
+I=ga.rect(ab,ab,0,0,p.borderRadius,N).attr({fill:p.backgroundColor,"stroke-width":N}).add(o).shadow(p.shadow),ba=ga.text("",eb+ab,ja(Ma.fontSize)+eb+ab,p.useHTML).attr({zIndex:1}).css(Ma).add(o);o.hide();return{shared:za,refresh:function(B){var D,ca,la,qa=0,ya={},fb=[];la=B.tooltipPos;D=p.formatter||q;ya=l.hoverPoints;if(za){ya&&u(ya,function(Hb){Hb.setState()});l.hoverPoints=B;u(B,function(Hb){Hb.setState(Bb);qa+=Hb.plotY;fb.push(Hb.getLabelConfig())});ca=B[0].plotX;qa=W(qa)/B.length;ya={x:B[0].category};
+ya.points=fb;B=B[0]}else ya=B.getLabelConfig();ya=D.call(ya);V=B.series;ca=za?ca:B.plotX;qa=za?qa:B.plotY;D=W(la?la[0]:va?Da-qa:ca);ca=W(la?la[1]:va?Aa-ca:qa);la=za||!B.series.isCartesian||gc(D,ca);if(ya===false||!la)x();else{if(xa){o.show();xa=false}ba.attr({text:ya});la=ba.getBBox();Oa=la.width+2*eb;R=la.height+2*eb;I.attr({width:Oa,height:R,stroke:p.borderColor||B.color||V.color||"#606060"});D=fe(Oa,R,X,ea,Da,Aa,{x:D,y:ca});w(W(D.x-ab),W(D.y-ab))}if(ta){ta=zc(ta);for(D=ta.length;D--;){ca=B.series[D?
+"yAxis":"xAxis"];if(ta[D]&&ca){ca=ca.getPlotLinePath(B[D?"y":"x"],1);if(da[D])da[D].attr({d:ca,visibility:Ab});else{la={"stroke-width":ta[D].width||1,stroke:ta[D].color||"#C0C0C0",zIndex:2};if(ta[D].dashStyle)la.dashstyle=ta[D].dashStyle;da[D]=ga.path(ca).attr(la).add()}}}}},hide:x,destroy:function(){u(da,function(B){B&&B.destroy()});u([I,ba,o],function(B){B&&B.destroy()});I=ba=o=null}}}function f(p){function q(L){var s,o=Ud&&ua.width/ua.body.scrollWidth-1,I,ba,B;L=L||db.event;if(!L.target)L.target=
+L.srcElement;s=L.touches?L.touches.item(0):L;if(L.type!=="mousemove"||db.opera||o){Jb=Fd(oa);I=Jb.left;ba=Jb.top}if(Pc){B=L.x;s=L.y}else if(s.layerX===Wa){B=s.pageX-I;s=s.pageY-ba}else{B=L.layerX;s=L.layerY}if(o){B+=W((o+1)*I-I);s+=W((o+1)*ba-ba)}return sa(L,{chartX:B,chartY:s})}function w(L){var s={xAxis:[],yAxis:[]};u(Va,function(o){var I=o.translate,ba=o.isXAxis;s[ba?"xAxis":"yAxis"].push({axis:o,value:I((va?!ba:ba)?L.chartX-X:Aa-L.chartY+ea,true)})});return s}function x(){var L=l.hoverSeries,
+s=l.hoverPoint;s&&s.onMouseOut();L&&L.onMouseOut();hc&&hc.hide();sd=null}function V(){if(za){var L={xAxis:[],yAxis:[]},s=za.getBBox(),o=s.x-X,I=s.y-ea;if(Ma){u(Va,function(ba){var B=ba.translate,D=ba.isXAxis,ca=va?!D:D,la=B(ca?o:Aa-I-s.height,true,0,0,1);B=B(ca?o+s.width:Aa-I,true,0,0,1);L[D?"xAxis":"yAxis"].push({axis:ba,min:tb(la,B),max:Ia(la,B)})});Pa(l,"selection",L,td)}za=za.destroy()}l.mouseIsDown=ud=Ma=false;pb(ua,Kb?"touchend":"mouseup",V)}function N(L){var s=K(L.pageX)?L.pageX:L.page.x;L=
+K(L.pageX)?L.pageY:L.page.y;Jb&&!gc(s-Jb.left-X,L-Jb.top-ea)&&x()}var ta,da,Ma,za,eb=z.zoomType,ab=/x/.test(eb),xa=/y/.test(eb),Oa=ab&&!va||xa&&va,R=xa&&!va||ab&&va;bd=function(){if(Ec){Ec.translate(X,ea);va&&Ec.attr({width:l.plotWidth,height:l.plotHeight}).invert()}else l.trackerGroup=Ec=ga.g("tracker").attr({zIndex:9}).add()};bd();if(p.enabled)l.tooltip=hc=e(p);(function(){oa.onmousedown=function(s){s=q(s);!Kb&&s.preventDefault&&s.preventDefault();l.mouseIsDown=ud=true;ta=s.chartX;da=s.chartY;Qa(ua,
+Kb?"touchend":"mouseup",V)};var L=function(s){if(!(s&&s.touches&&s.touches.length>1)){s=q(s);if(!Kb)s.returnValue=false;var o=s.chartX,I=s.chartY,ba=!gc(o-X,I-ea);Jb||(Jb=Fd(oa));if(Kb&&s.type==="touchstart")if(Ga(s.target,"isTracker"))l.runTrackerClick||s.preventDefault();else!ke&&!ba&&s.preventDefault();if(ba){if(o<X)o=X;else if(o>X+Da)o=X+Da;if(I<ea)I=ea;else if(I>ea+Aa)I=ea+Aa}if(ud&&s.type!=="touchstart"){Ma=Math.sqrt(Math.pow(ta-o,2)+Math.pow(da-I,2));if(Ma>10){if(sc&&(ab||xa)&&gc(ta-X,da-ea))za||
+(za=ga.rect(X,ea,Oa?1:Da,R?1:Aa,0).attr({fill:z.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add());if(za&&Oa){o=o-ta;za.attr({width:bb(o),x:(o>0?0:o)+ta})}if(za&&R){I=I-da;za.attr({height:bb(I),y:(I>0?0:I)+da})}}}else if(!ba){var B;I=l.hoverPoint;o=l.hoverSeries;var D,ca,la=$a,qa=va?s.chartY:s.chartX-X;if(hc&&p.shared){B=[];D=Ha.length;for(ca=0;ca<D;ca++)if(Ha[ca].visible&&Ha[ca].tooltipPoints.length){s=Ha[ca].tooltipPoints[qa];s._dist=bb(qa-s.plotX);la=tb(la,s._dist);B.push(s)}for(D=
+B.length;D--;)B[D]._dist>la&&B.splice(D,1);if(B.length&&B[0].plotX!==sd){hc.refresh(B);sd=B[0].plotX}}if(o&&o.tracker)(s=o.tooltipPoints[qa])&&s!==I&&s.onMouseOver()}return ba||!sc}};oa.onmousemove=L;Qa(oa,"mouseleave",x);Qa(ua,"mousemove",N);oa.ontouchstart=function(s){if(ab||xa)oa.onmousedown(s);L(s)};oa.ontouchmove=L;oa.ontouchend=function(){Ma&&x()};oa.onclick=function(s){var o=l.hoverPoint;s=q(s);s.cancelBubble=true;if(!Ma)if(o&&Ga(s.target,"isTracker")){var I=o.plotX,ba=o.plotY;sa(o,{pageX:Jb.left+
+X+(va?Da-ba:I),pageY:Jb.top+ea+(va?Aa-I:ba)});Pa(o.series,"click",sa(s,{point:o}));o.firePointEvent("click",s)}else{sa(s,w(s));gc(s.chartX-X,s.chartY-ea)&&Pa(l,"click",s)}Ma=false}})();Vd=setInterval(function(){rd&&rd()},32);sa(this,{zoomX:ab,zoomY:xa,resetTracker:x,destroy:function(){if(l.trackerGroup)l.trackerGroup=Ec=l.trackerGroup.destroy();pb(ua,"mousemove",N);oa.onclick=oa.onmousedown=oa.onmousemove=oa.ontouchstart=oa.ontouchend=oa.ontouchmove=null}})}function g(p){var q=p.type||z.type||z.defaultSeriesType,
+w=wb[q],x=l.hasRendered;if(x)if(va&&q==="column")w=wb.bar;else if(!va&&q==="bar")w=wb.column;q=new w;q.init(l,p);if(!x&&q.inverted)va=true;if(q.isCartesian)sc=q.isCartesian;Ha.push(q);return q}function h(){z.alignTicks!==false&&u(Va,function(p){p.adjustTickAmount()});Ob=null}function i(p){var q=l.isDirtyLegend,w,x=l.isDirtyBox,V=Ha.length,N=V,ta=l.clipRect;for(oc(p,l);N--;){p=Ha[N];if(p.isDirty&&p.options.stacking){w=true;break}}if(w)for(N=V;N--;){p=Ha[N];if(p.options.stacking)p.isDirty=true}u(Ha,
+function(da){if(da.isDirty){da.cleanData();da.getSegments();if(da.options.legendType==="point")q=true}});if(q&&Fc.renderLegend){Fc.renderLegend();l.isDirtyLegend=false}if(sc){if(!cd){Ob=null;u(Va,function(da){da.setScale()})}h();Gc();u(Va,function(da){if(da.isDirty||x){da.redraw();x=true}})}if(x){vd();bd();if(ta){Hc(ta);ta.animate({width:l.plotSizeX,height:l.plotSizeY})}}u(Ha,function(da){if(da.isDirty&&da.visible&&(!da.isCartesian||da.xAxis))da.redraw()});Yb&&Yb.resetTracker&&Yb.resetTracker();Pa(l,
+"redraw")}function j(){var p=a.xAxis||{},q=a.yAxis||{},w;p=zc(p);u(p,function(x,V){x.index=V;x.isX=true});q=zc(q);u(q,function(x,V){x.index=V});Va=p.concat(q);l.xAxis=[];l.yAxis=[];Va=tc(Va,function(x){w=new c(x);l[w.isXAxis?"xAxis":"yAxis"].push(w);return w});h()}function m(p,q){uc=Ca(a.title,p);Ic=Ca(a.subtitle,q);u([["title",p,uc],["subtitle",q,Ic]],function(w){var x=w[0],V=l[x],N=w[1];w=w[2];if(V&&N)V=V.destroy();if(w&&w.text&&!V)l[x]=ga.text(w.text,0,0,w.useHTML).attr({align:w.align,"class":"highcharts-"+
+x,zIndex:1}).css(w.style).add().align(w,false,Rb)})}function v(){qb=z.renderTo;Wd=vc+wd++;if(Sb(qb))qb=ua.getElementById(qb);qb.innerHTML="";if(!qb.offsetWidth){Zb=qb.cloneNode(0);Ja(Zb,{position:ic,top:"-9999px",display:""});ua.body.appendChild(Zb)}dd=(Zb||qb).offsetWidth;Jc=(Zb||qb).offsetHeight;l.chartWidth=$a=z.width||dd||600;l.chartHeight=cb=z.height||(Jc>19?Jc:400);l.container=oa=hb(Tb,{className:"highcharts-container"+(z.className?" "+z.className:""),id:Wd},sa({position:Xd,overflow:ob,width:$a+
+Ua,height:cb+Ua,textAlign:"left"},z.style),Zb||qb);l.renderer=ga=z.forExport?new ed(oa,$a,cb,true):new fd(oa,$a,cb);var p,q;if(Yd&&oa.getBoundingClientRect){p=function(){Ja(oa,{left:0,top:0});q=oa.getBoundingClientRect();Ja(oa,{left:-(q.left-ja(q.left))+Ua,top:-(q.top-ja(q.top))+Ua})};p();Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}}function P(){function p(){var w=z.width||qb.offsetWidth,x=z.height||qb.offsetHeight;if(w&&x){if(w!==dd||x!==Jc){clearTimeout(q);q=setTimeout(function(){xd(w,
+x,false)},100)}dd=w;Jc=x}}var q;Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}function T(){Pa(l,"endResize",null,function(){cd-=1})}function Y(){var p=a.labels,q=a.credits,w;m();Fc=l.legend=new le;Gc();u(Va,function(x){x.setTickPositions(true)});h();Gc();vd();sc&&u(Va,function(x){x.render()});if(!l.seriesGroup)l.seriesGroup=ga.g("series-group").attr({zIndex:3}).add();u(Ha,function(x){x.translate();x.setTooltipPoints();x.render()});p.items&&u(p.items,function(){var x=sa(p.style,this.style),
+V=ja(x.left)+X,N=ja(x.top)+ea+12;delete x.left;delete x.top;ga.text(this.html,V,N).attr({zIndex:2}).css(x).add()});if(!l.toolbar)l.toolbar=d();if(q.enabled&&!l.credits){w=q.href;l.credits=ga.text(q.text,0,0).on("click",function(){if(w)location.href=w}).attr({align:q.position.align,zIndex:8}).css(q.style).add().align(q.position)}bd();l.hasRendered=true;if(Zb){qb.appendChild(oa);pc(Zb)}}function H(){var p,q=oa&&oa.parentNode;if(l!==null){Pa(l,"destroy");pb(db,"unload",H);pb(l);for(p=Va.length;p--;)Va[p]=
+Va[p].destroy();for(p=Ha.length;p--;)Ha[p]=Ha[p].destroy();u(["title","subtitle","seriesGroup","clipRect","credits","tracker"],function(w){var x=l[w];if(x)l[w]=x.destroy()});u([wc,xc,Kc,Fc,hc,ga,Yb],function(w){w&&w.destroy&&w.destroy()});wc=xc=Kc=Fc=hc=ga=Yb=null;if(oa){oa.innerHTML="";pb(oa);q&&pc(oa);oa=null}clearInterval(Vd);for(p in l)delete l[p];l=null}}function U(){if(!Lc&&db==db.top&&ua.readyState!=="complete")ua.attachEvent("onreadystatechange",function(){ua.detachEvent("onreadystatechange",
+U);ua.readyState==="complete"&&U()});else{v();yd();zd();u(a.series||[],function(p){g(p)});l.inverted=va=A(va,a.chart.inverted);j();l.render=Y;l.tracker=Yb=new f(a.tooltip);Y();Pa(l,"load");b&&b.apply(l,[l]);u(l.callbacks,function(p){p.apply(l,[l])})}}Yc=Ca(Yc,Xa.xAxis);od=Ca(od,Xa.yAxis);Xa.xAxis=Xa.yAxis=null;a=Ca(Xa,a);var z=a.chart,M=z.margin;M=Nb(M)?M:[M,M,M,M];var y=A(z.marginTop,M[0]),C=A(z.marginRight,M[1]),Z=A(z.marginBottom,M[2]),Sa=A(z.marginLeft,M[3]),Na=z.spacingTop,Ea=z.spacingRight,
+gb=z.spacingBottom,Lb=z.spacingLeft,Rb,uc,Ic,ea,Ib,vb,X,Xb,qb,Zb,oa,Wd,dd,Jc,$a,cb,qd,ad,wc,Kc,Ad,xc,l=this,ke=(M=z.events)&&!!M.click,Bd,gc,hc,ud,jc,Zd,Cd,Aa,Da,Yb,Ec,bd,Fc,$b,ac,Jb,sc=z.showAxes,cd=0,Va=[],Ob,Ha=[],va,ga,rd,Vd,sd,vd,Gc,yd,zd,xd,td,$d,le=function(){function p(G,ha){var na=G.legendItem,Ra=G.legendLine,La=G.legendSymbol,pa=Oa.color,wa=ha?N.itemStyle.color:pa,zb=ha?G.color:pa;pa=ha?G.pointAttr[ib]:{stroke:pa,fill:pa};na&&na.css({fill:wa});Ra&&Ra.attr({stroke:zb});La&&La.attr(pa)}function q(G,
+ha,na){var Ra=G.legendItem,La=G.legendLine,pa=G.legendSymbol;G=G.checkbox;Ra&&Ra.attr({x:ha,y:na});La&&La.translate(ha,na-4);pa&&pa.attr({x:ha+pa.xOff,y:na+pa.yOff});if(G){G.x=ha;G.y=na}}function w(){u(za,function(G){var ha=G.checkbox,na=qa.alignAttr;ha&&Ja(ha,{left:na.translateX+G.legendItemWidth+ha.x-40+Ua,top:na.translateY+ha.y-11+Ua})})}function x(G){var ha,na,Ra,La,pa=G.legendItem;La=G.series||G;var wa=La.options,zb=wa&&wa.borderWidth||0;if(!pa){La=/^(bar|pie|area|column)$/.test(La.type);G.legendItem=
+pa=ga.text(N.labelFormatter.call(G),0,0).css(G.visible?ab:Oa).on("mouseover",function(){G.setState(Bb);pa.css(xa)}).on("mouseout",function(){pa.css(G.visible?ab:Oa);G.setState()}).on("click",function(){var Gb=function(){G.setVisible()};G.firePointEvent?G.firePointEvent("legendItemClick",null,Gb):Pa(G,"legendItemClick",null,Gb)}).attr({zIndex:2}).add(qa);if(!La&&wa&&wa.lineWidth){var Vb={"stroke-width":wa.lineWidth,zIndex:2};if(wa.dashStyle)Vb.dashstyle=wa.dashStyle;G.legendLine=ga.path([Za,-da-Ma,
+0,Ka,-Ma,0]).attr(Vb).add(qa)}if(La)ha=ga.rect(na=-da-Ma,Ra=-11,da,12,2).attr({zIndex:3}).add(qa);else if(wa&&wa.marker&&wa.marker.enabled)ha=ga.symbol(G.symbol,na=-da/2-Ma,Ra=-4,wa.marker.radius).attr({zIndex:3}).add(qa);if(ha){ha.xOff=na+zb%2/2;ha.yOff=Ra+zb%2/2}G.legendSymbol=ha;p(G,G.visible);if(wa&&wa.showCheckbox){G.checkbox=hb("input",{type:"checkbox",checked:G.selected,defaultChecked:G.selected},N.itemCheckboxStyle,oa);Qa(G.checkbox,"click",function(Gb){Pa(G,"checkboxClick",{checked:Gb.target.checked},
+function(){G.select()})})}}ha=pa.getBBox();na=G.legendItemWidth=N.itemWidth||da+Ma+ha.width+R;B=ha.height;if(ta&&o-s+na>(fb||$a-2*R-s)){o=s;I+=B}ba=I;q(G,o,I);if(ta)o+=na;else I+=B;ya=fb||Ia(ta?o-s:na,ya)}function V(){o=s;I=L;ba=ya=0;qa||(qa=ga.g("legend").attr({zIndex:7}).add());za=[];u(Hb,function(Ra){var La=Ra.options;if(La.showInLegend)za=za.concat(La.legendType==="point"?Ra.data:Ra)});Hd(za,function(Ra,La){return(Ra.options.legendIndex||0)-(La.options.legendIndex||0)});cc&&za.reverse();u(za,
+x);$b=fb||ya;ac=ba-L+B;if(ca||la){$b+=2*R;ac+=2*R;if(D){if($b>0&&ac>0){D[D.isNew?"attr":"animate"](D.crisp(null,null,null,$b,ac));D.isNew=false}}else{D=ga.rect(0,0,$b,ac,N.borderRadius,ca||0).attr({stroke:N.borderColor,"stroke-width":ca||0,fill:la||jb}).add(qa).shadow(N.shadow);D.isNew=true}D[za.length?"show":"hide"]()}for(var G=["left","right","top","bottom"],ha,na=4;na--;){ha=G[na];if(eb[ha]&&eb[ha]!=="auto"){N[na<2?"align":"verticalAlign"]=ha;N[na<2?"x":"y"]=ja(eb[ha])*(na%2?-1:1)}}za.length&&
+qa.align(sa(N,{width:$b,height:ac}),true,Rb);cd||w()}var N=l.options.legend;if(N.enabled){var ta=N.layout==="horizontal",da=N.symbolWidth,Ma=N.symbolPadding,za,eb=N.style,ab=N.itemStyle,xa=N.itemHoverStyle,Oa=N.itemHiddenStyle,R=ja(eb.padding),L=18,s=4+R+da+Ma,o,I,ba,B=0,D,ca=N.borderWidth,la=N.backgroundColor,qa,ya,fb=N.width,Hb=l.series,cc=N.reversed;V();Qa(l,"endResize",w);return{colorizeItem:p,destroyItem:function(G){var ha=G.checkbox;u(["legendItem","legendLine","legendSymbol"],function(na){G[na]&&
+G[na].destroy()});ha&&pc(G.checkbox)},renderLegend:V,destroy:function(){if(D)D=D.destroy();if(qa)qa=qa.destroy()}}}};gc=function(p,q){return p>=0&&p<=Da&&q>=0&&q<=Aa};$d=function(){Pa(l,"selection",{resetSelection:true},td);l.toolbar.remove("zoom")};td=function(p){var q=Xa.lang,w=l.pointCount<100;l.toolbar.add("zoom",q.resetZoom,q.resetZoomTitle,$d);!p||p.resetSelection?u(Va,function(x){x.setExtremes(null,null,false,w)}):u(p.xAxis.concat(p.yAxis),function(x){var V=x.axis;if(l.tracker[V.isXAxis?"zoomX":
+"zoomY"])V.setExtremes(x.min,x.max,false,w)});i()};Gc=function(){var p=a.legend,q=A(p.margin,10),w=p.x,x=p.y,V=p.align,N=p.verticalAlign,ta;yd();if((l.title||l.subtitle)&&!K(y))if(ta=Ia(l.title&&!uc.floating&&!uc.verticalAlign&&uc.y||0,l.subtitle&&!Ic.floating&&!Ic.verticalAlign&&Ic.y||0))ea=Ia(ea,ta+A(uc.margin,15)+Na);if(p.enabled&&!p.floating)if(V==="right")K(C)||(Ib=Ia(Ib,$b-w+q+Ea));else if(V==="left")K(Sa)||(X=Ia(X,$b+w+q+Lb));else if(N==="top")K(y)||(ea=Ia(ea,ac+x+q+Na));else if(N==="bottom")K(Z)||
+(vb=Ia(vb,ac-x+q+gb));sc&&u(Va,function(da){da.getOffset()});K(Sa)||(X+=Xb[3]);K(y)||(ea+=Xb[0]);K(Z)||(vb+=Xb[2]);K(C)||(Ib+=Xb[1]);zd()};xd=function(p,q,w){var x=l.title,V=l.subtitle;cd+=1;oc(w,l);ad=cb;qd=$a;l.chartWidth=$a=W(p);l.chartHeight=cb=W(q);Ja(oa,{width:$a+Ua,height:cb+Ua});ga.setSize($a,cb,w);Da=$a-X-Ib;Aa=cb-ea-vb;Ob=null;u(Va,function(N){N.isDirty=true;N.setScale()});u(Ha,function(N){N.isDirty=true});l.isDirtyLegend=true;l.isDirtyBox=true;Gc();x&&x.align(null,null,Rb);V&&V.align(null,
+null,Rb);i(w);ad=null;Pa(l,"resize");Bc===false?T():setTimeout(T,Bc&&Bc.duration||500)};zd=function(){l.plotLeft=X=W(X);l.plotTop=ea=W(ea);l.plotWidth=Da=W($a-X-Ib);l.plotHeight=Aa=W(cb-ea-vb);l.plotSizeX=va?Aa:Da;l.plotSizeY=va?Da:Aa;Rb={x:Lb,y:Na,width:$a-Lb-Ea,height:cb-Na-gb}};yd=function(){ea=A(y,Na);Ib=A(C,Ea);vb=A(Z,gb);X=A(Sa,Lb);Xb=[0,0,0,0]};vd=function(){var p=z.borderWidth||0,q=z.backgroundColor,w=z.plotBackgroundColor,x=z.plotBackgroundImage,V,N={x:X,y:ea,width:Da,height:Aa};V=p+(z.shadow?
+8:0);if(p||q)if(wc)wc.animate(wc.crisp(null,null,null,$a-V,cb-V));else wc=ga.rect(V/2,V/2,$a-V,cb-V,z.borderRadius,p).attr({stroke:z.borderColor,"stroke-width":p,fill:q||jb}).add().shadow(z.shadow);if(w)if(Kc)Kc.animate(N);else Kc=ga.rect(X,ea,Da,Aa,0).attr({fill:w}).add().shadow(z.plotShadow);if(x)if(Ad)Ad.animate(N);else Ad=ga.image(x,X,ea,Da,Aa).add();if(z.plotBorderWidth)if(xc)xc.animate(xc.crisp(null,X,ea,Da,Aa));else xc=ga.rect(X,ea,Da,Aa,0,z.plotBorderWidth).attr({stroke:z.plotBorderColor,
+"stroke-width":z.plotBorderWidth,zIndex:4}).add();l.isDirtyBox=false};Qa(db,"unload",H);z.reflow!==false&&Qa(l,"load",P);if(M)for(Bd in M)Qa(l,Bd,M[Bd]);l.options=a;l.series=Ha;l.addSeries=function(p,q,w){var x;if(p){oc(w,l);q=A(q,true);Pa(l,"addSeries",{options:p},function(){x=g(p);x.isDirty=true;l.isDirtyLegend=true;q&&l.redraw()})}return x};l.animation=A(z.animation,true);l.destroy=H;l.get=function(p){var q,w,x;for(q=0;q<Va.length;q++)if(Va[q].options.id===p)return Va[q];for(q=0;q<Ha.length;q++)if(Ha[q].options.id===
+p)return Ha[q];for(q=0;q<Ha.length;q++){x=Ha[q].data;for(w=0;w<x.length;w++)if(x[w].id===p)return x[w]}return null};l.getSelectedPoints=function(){var p=[];u(Ha,function(q){p=p.concat(Dd(q.data,function(w){return w.selected}))});return p};l.getSelectedSeries=function(){return Dd(Ha,function(p){return p.selected})};l.hideLoading=function(){gd(jc,{opacity:0},{duration:a.loading.hideDuration,complete:function(){Ja(jc,{display:jb})}});Cd=false};l.isInsidePlot=gc;l.redraw=i;l.setSize=xd;l.setTitle=m;l.showLoading=
+function(p){var q=a.loading;if(!jc){jc=hb(Tb,{className:"highcharts-loading"},sa(q.style,{left:X+Ua,top:ea+Ua,width:Da+Ua,height:Aa+Ua,zIndex:10,display:jb}),oa);Zd=hb("span",null,q.labelStyle,jc)}Zd.innerHTML=p||a.lang.loading;if(!Cd){Ja(jc,{opacity:0,display:""});gd(jc,{opacity:q.style.opacity},{duration:q.showDuration});Cd=true}};l.pointCount=0;l.counters=new Gd;U()}var ua=document,db=window,Fa=Math,W=Fa.round,lb=Fa.floor,md=Fa.ceil,Ia=Fa.max,tb=Fa.min,bb=Fa.abs,rb=Fa.cos,Cb=Fa.sin,kc=Fa.PI,ae=
+kc*2/360,yc=navigator.userAgent,Pc=/msie/i.test(yc)&&!db.opera,Mc=ua.documentMode===8,Ud=/AppleWebKit/.test(yc),Yd=/Firefox/.test(yc),Lc=!!ua.createElementNS&&!!ua.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,me=Yd&&parseInt(yc.split("Firefox/")[1],10)<4,fd,Kb=ua.documentElement.ontouchstart!==undefined,be={},wd=0,ub=1,Tc,Xa,Zc,Bc,Nc,Wa,Tb="div",ic="absolute",Xd="relative",ob="hidden",vc="highcharts-",Ab="visible",Ua="px",jb="none",Za="M",Ka="L",ce="rgba(192,192,192,"+(Lc?1.0E-6:
+0.0020)+")",ib="",Bb="hover",Qc,id,jd,kd,Cc,Rc,Sc,Jd,Kd,ld,Ld,Md,ma=db.HighchartsAdapter,Db=ma||{},u=Db.each,Dd=Db.grep,tc=Db.map,Ca=Db.merge,Qa=Db.addEvent,pb=Db.removeEvent,Pa=Db.fireEvent,gd=Db.animate,Hc=Db.stop,wb={};Zc=function(a,b,c){function d(P){return P.toString().replace(/^([0-9])$/,"0$1")}if(!K(b)||isNaN(b))return"Invalid date";a=A(a,"%Y-%m-%d %H:%M:%S");b=new Date(b*ub);var e,f=b[jd](),g=b[kd](),h=b[Cc](),i=b[Rc](),j=b[Sc](),m=Xa.lang,v=m.weekdays;b={a:v[g].substr(0,3),A:v[g],d:d(h),
+e:h,b:m.shortMonths[i],B:m.months[i],m:d(i+1),y:j.toString().substr(2,2),Y:j,H:d(f),I:d(f%12||12),l:f%12||12,M:d(b[id]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:d(b.getSeconds())};for(e in b)a=a.replace("%"+e,b[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};Gd.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};Nc={init:function(a,b,c){b=b||"";var d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h,
+i,j=function(m){for(g=m.length;g--;)m[g]===Za&&m.splice(g+1,0,m[g+1],m[g+2],m[g+1],m[g+2])};if(e){j(b);j(c)}if(a.isArea){h=b.splice(b.length-6,6);i=c.splice(c.length-6,6)}if(d){c=[].concat(c).splice(0,f).concat(c);a.shift=false}if(b.length)for(a=c.length;b.length<a;){d=[].concat(b).splice(b.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}b=b.concat(d)}if(h){b=b.concat(h);c=c.concat(i)}return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;){d=parseFloat(a[f]);
+e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d}else e=b;return e}};ma&&ma.init&&ma.init(Nc);if(!ma&&db.jQuery){var Mb=jQuery;u=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===false)return c};Dd=Mb.grep;tc=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};Ca=function(){var a=arguments;return Mb.extend(true,null,a[0],a[1],a[2],a[3])};Qa=function(a,b,c){Mb(a).bind(b,c)};pb=function(a,b,c){var d=ua.removeEventListener?"removeEventListener":"detachEvent";
+if(ua[d]&&!a[d])a[d]=function(){};Mb(a).unbind(b,c)};Pa=function(a,b,c,d){var e=Mb.Event(b),f="detached"+b;sa(e,c);if(a[b]){a[f]=a[b];a[b]=null}Mb(a).trigger(e);if(a[f]){a[b]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};gd=function(a,b,c){var d=Mb(a);if(b.d){a.toD=b.d;b.d=1}d.stop();d.animate(b,c)};Hc=function(a){Mb(a).stop()};Mb.extend(Mb.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});var de=jQuery.fx,ee=de.step;u(["cur","_default","width","height"],function(a,b){var c=b?
+ee:de.prototype,d=c[a],e;if(d)c[a]=function(f){f=b?f:this;e=f.elem;return e.attr?e.attr(f.prop,f.now):d.apply(this,arguments)}});ee.d=function(a){var b=a.elem;if(!a.started){var c=Nc.init(b,b.d,b.toD);a.start=c[0];a.end=c[1];a.started=true}b.attr("d",Nc.step(a.start,a.end,a.pos,b.toD))}}ma={enabled:true,align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px",lineHeight:"14px"}};Xa={colors:["#4572A7","#AA4643","#89A54E","#80699B","#3D96AE","#DB843D","#92A8CD","#A47D7C","#B5CA92"],symbols:["circle",
+"diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","June","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:true},chart:{borderColor:"#4572A7",
+borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:true,spacingTop:10,spacingRight:10,spacingBottom:15,spacingLeft:10,style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0"},title:{text:"Chart title",align:"center",y:15,style:{color:"#3E576F",fontSize:"16px"}},subtitle:{text:"",align:"center",y:30,style:{color:"#6D869F"}},plotOptions:{line:{allowPointSelect:false,showCheckbox:false,
+animation:{duration:1E3},events:{},lineWidth:2,shadow:true,marker:{enabled:true,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:Ca(ma,{enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:ic,color:"#3E576F"}},legend:{enabled:true,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},
+borderWidth:1,borderColor:"#909090",borderRadius:5,shadow:false,style:{padding:"5px"},itemStyle:{cursor:"pointer",color:"#3E576F"},itemHoverStyle:{cursor:"pointer",color:"#000000"},itemHiddenStyle:{color:"#C0C0C0"},itemCheckboxStyle:{position:ic,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Xd,top:"1em"},showDuration:100,style:{position:ic,backgroundColor:"white",opacity:0.5,textAlign:"center"}},
+tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Kb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer"}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"10px"}}};var Yc={dateTimeLabelFormats:{second:"%H:%M:%S",minute:"%H:%M",
+hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:false,gridLineColor:"#C0C0C0",labels:ma,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:false,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F",
+fontWeight:"bold"}},type:"linear"},od=Ca(Yc,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{rotation:270,text:"Y-values"},stackLabels:{enabled:false,formatter:function(){return this.total},style:ma.style}}),ie={labels:{align:"right",x:-8,y:null},title:{rotation:270}},he={labels:{align:"left",x:8,y:null},title:{rotation:90}},Td={labels:{align:"center",x:0,y:14},title:{rotation:0}},
+ge=Ca(Td,{labels:{y:-5}}),xb=Xa.plotOptions;ma=xb.line;xb.spline=Ca(ma);xb.scatter=Ca(ma,{lineWidth:0,states:{hover:{lineWidth:0}}});xb.area=Ca(ma,{});xb.areaspline=Ca(xb.area);xb.column=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,states:{hover:{brightness:0.1,shadow:false},select:{color:"#C0C0C0",borderColor:"#000000",shadow:false}},dataLabels:{y:null,verticalAlign:null}});xb.bar=Ca(xb.column,{dataLabels:{align:"left",x:5,
+y:0}});xb.pie=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,center:["50%","50%"],colorByPoint:true,dataLabels:{distance:30,enabled:true,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Id();var bc=function(a){var b=[],c;(function(d){if(c=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(d))b=[ja(c[1]),ja(c[2]),ja(c[3]),parseFloat(c[4],
+10)];else if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))b=[ja(c[1],16),ja(c[2],16),ja(c[3],16),1]})(a);return{get:function(d){return b&&!isNaN(b[0])?d==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":d==="a"?b[3]:"rgba("+b.join(",")+")":a},brighten:function(d){if(lc(d)&&d!==0){var e;for(e=0;e<3;e++){b[e]+=ja(d*255);if(b[e]<0)b[e]=0;if(b[e]>255)b[e]=255}}return this},setOpacity:function(d){b[3]=d;return this}}};Uc.prototype={init:function(a,b){this.element=ua.createElementNS("http://www.w3.org/2000/svg",
+b);this.renderer=a},animate:function(a,b,c){if(b=A(b,Bc,true)){b=Ca(b);if(c)b.complete=c;gd(this,a,b)}else{this.attr(a);c&&c()}},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName,i=this.renderer,j,m=this.shadows,v=this.htmlNode,P,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;if(h==="circle")c={x:"cx",y:"cy"}[c]||c;else if(c==="strokeWidth")c="stroke-width";T=Ga(g,c)||this[c]||0;if(c!=="d"&&c!=="visibility")T=parseFloat(T)}else for(c in a){j=false;d=a[c];if(c==="d"){if(d&&d.join)d=
+d.join(" ");if(/(NaN| {2}|^$)/.test(d))d="M 0 0";this.d=d}else if(c==="x"&&h==="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];Ga(f,"x")===Ga(g,"x")&&Ga(f,"x",d)}if(this.rotation)Ga(g,"transform","rotate("+this.rotation+" "+d+" "+ja(a.y||Ga(g,"y"))+")")}else if(c==="fill")d=i.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"){this[c]=d;this.updateTransform();j=true}else if(c===
+"stroke")d=i.color(d,g,c);else if(c==="dashstyle"){c="stroke-dasharray";d=d&&d.toLowerCase();if(d==="solid")d=jb;else if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=d.length;e--;)d[e]=ja(d[e])*a["stroke-width"];d=d.join(",")}}else if(c==="isTracker")this[c]=d;else if(c==="width")d=ja(d);else if(c===
+"align"){c="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}else if(c==="title"){e=ua.createElementNS("http://www.w3.org/2000/svg","title");e.appendChild(ua.createTextNode(d));g.appendChild(e)}if(c==="strokeWidth")c="stroke-width";if(Ud&&c==="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(c)){if(!P){this.symbolAttr(a);P=true}j=true}if(m&&/^(width|height|visibility|x|y|d)$/.test(c))for(e=m.length;e--;)Ga(m[e],c,d);if((c==="width"||c==="height")&&h===
+"rect"&&d<0)d=0;if(c==="text"){this.textStr=d;this.added&&i.buildText(this)}else j||Ga(g,c,d);if(v&&(c==="x"||c==="y"||c==="translateX"||c==="translateY"||c==="visibility")){e=v.length?v:[this];f=e.length;var Y;for(Y=0;Y<f;Y++){v=e[Y];j=v.getBBox();v=v.htmlNode;Ja(v,sa(this.styles,{left:j.x+(this.translateX||0)+Ua,top:j.y+(this.translateY||0)+Ua}));c==="visibility"&&Ja(v,{visibility:d})}}}return T},symbolAttr:function(a){var b=this;u(["x","y","r","start","end","width","height","innerR"],function(c){b[c]=
+A(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](W(b.x*2)/2,W(b.y*2)/2,b.r,{start:b.start,end:b.end,width:b.width,height:b.height,innerR:b.innerR})})},clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},crisp:function(a,b,c,d,e){var f,g={},h={},i;a=a||this.strokeWidth||0;i=a%2/2;h.x=lb(b||this.x||0)+i;h.y=lb(c||this.y||0)+i;h.width=lb((d||this.width||0)-2*i);h.height=lb((e||this.height||0)-2*i);h.strokeWidth=a;for(f in h)if(this[f]!==h[f])this[f]=g[f]=h[f];
+return g},css:function(a){var b=this.element;b=a&&a.width&&b.nodeName==="text";var c,d="",e=function(f,g){return"-"+g.toLowerCase()};if(a&&a.color)a.fill=a.color;this.styles=a=sa(this.styles,a);if(Pc&&!Lc){b&&delete a.width;Ja(this.element,a)}else{for(c in a)d+=c.replace(/([A-Z])/g,e)+":"+a[c]+";";this.attr({style:d})}b&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=b;if(Kb&&a==="click"){a="touchstart";c=function(d){d.preventDefault();b()}}this.element["on"+a]=c;return this},
+translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.inverted,d=this.rotation,e=[];if(c){a+=this.attr("width");b+=this.attr("height")}if(a||b)e.push("translate("+a+","+b+")");if(c)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&Ga(this.element,"transform",e.join(" "))},toFront:function(){var a=
+this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){if(a){this.alignOptions=a;this.alignByTranslate=b;c||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;b=this.alignByTranslate}c=A(c,this.renderer);var d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),h={};if(/^(right|center)$/.test(d))f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=W(f);if(/^(bottom|middle)$/.test(e))g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||
+1);h[b?"translateY":"y"]=W(g);this[this.placed?"animate":"attr"](h);this.placed=true;this.alignAttr=h;return this},getBBox:function(){var a,b,c,d=this.rotation,e=d*ae;try{a=sa({},this.element.getBBox())}catch(f){a={width:0,height:0}}b=a.width;c=a.height;if(d){a.width=bb(c*Cb(e))+bb(b*rb(e));a.height=bb(c*rb(e))+bb(b*Cb(e))}return a},show:function(){return this.attr({visibility:Ab})},hide:function(){return this.attr({visibility:ob})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=
+d.childNodes,f=this.element,g=Ga(f,"zIndex");this.parentInverted=a&&a.inverted;this.textStr!==undefined&&b.buildText(this);if(a&&this.htmlNode){if(!a.htmlNode)a.htmlNode=[];a.htmlNode.push(this)}if(g){c.handleZ=true;g=ja(g)}if(c.handleZ)for(c=0;c<e.length;c++){a=e[c];b=Ga(a,"zIndex");if(a!==f&&(ja(b)>g||!K(g)&&K(b))){d.insertBefore(f,a);return this}}d.appendChild(f);this.added=true;return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||
+{},c=a.shadows,d,e;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=null;Hc(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(e=0;e<a.stops.length;e++)a.stops[e]=a.stops[e].destroy();a.stops=null}a.safeRemoveChild(b);c&&u(c,function(f){a.safeRemoveChild(f)});nc(a.renderer.alignedObjects,a);for(d in a)delete a[d];return null},empty:function(){for(var a=this.element,b=a.childNodes,c=b.length;c--;)a.removeChild(b[c])},shadow:function(a,b){var c=[],d,e,f=this.element,g=this.parentInverted?
+"(-1,-1)":"(1,1)";if(a){for(d=1;d<=3;d++){e=f.cloneNode(0);Ga(e,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*d,"stroke-width":7-2*d,transform:"translate"+g,fill:jb});b?b.element.appendChild(e):f.parentNode.insertBefore(e,f);c.push(e)}this.shadows=c}return this}};var ed=function(){this.init.apply(this,arguments)};ed.prototype={Element:Uc,init:function(a,b,c,d){var e=location,f;f=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",version:"1.1"});a.appendChild(f.element);
+this.box=f.element;this.boxWrapper=f;this.alignedObjects=[];this.url=Pc?"":e.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.forExport=d;this.gradients=[];this.setSize(b,c,false)},destroy:function(){var a,b=this.gradients,c=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();if(b){for(a=0;a<b.length;a++)this.gradients[a]=b[a].destroy();this.gradients=null}if(c)this.defs=c.destroy();return this.alignedObjects=null},createElement:function(a){var b=new this.Element;
+b.init(this,a);return b},buildText:function(a){for(var b=a.element,c=A(a.textStr,"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),d=b.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=Ga(b,"x"),h=a.styles,i=h&&a.useHTML&&!this.forExport,j=a.htmlNode,m=h&&ja(h.width),v=h&&h.lineHeight,P,T=d.length;T--;)b.removeChild(d[T]);m&&!a.added&&
+this.box.appendChild(b);u(c,function(Y,H){var U,z=0,M;Y=Y.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");U=Y.split("|||");u(U,function(y){if(y!==""||U.length===1){var C={},Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");e.test(y)&&Ga(Z,"style",y.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"));if(f.test(y)){Ga(Z,"onclick",'location.href="'+y.match(f)[1]+'"');Ja(Z,{cursor:"pointer"})}y=(y.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");Z.appendChild(ua.createTextNode(y));
+if(z)C.dx=3;else C.x=g;if(!z){if(H){!Lc&&a.renderer.forExport&&Ja(Z,{display:"block"});M=db.getComputedStyle&&ja(db.getComputedStyle(P,null).getPropertyValue("line-height"));if(!M||isNaN(M))M=v||P.offsetHeight||18;Ga(Z,"dy",M)}P=Z}Ga(Z,C);b.appendChild(Z);z++;if(m){y=y.replace(/-/g,"- ").split(" ");for(var Sa,Na=[];y.length||Na.length;){Sa=b.getBBox().width;C=Sa>m;if(!C||y.length===1){y=Na;Na=[];if(y.length){Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");Ga(Z,{dy:v||16,x:g});b.appendChild(Z);
+if(Sa>m)m=Sa}}else{Z.removeChild(Z.firstChild);Na.unshift(y.pop())}y.length&&Z.appendChild(ua.createTextNode(y.join(" ").replace(/- /g,"-")))}}}})});if(i){if(!j)j=a.htmlNode=hb("span",null,sa(h,{position:ic,top:0,left:0}),this.box.parentNode);j.innerHTML=a.textStr;for(T=d.length;T--;)d[T].style.visibility=ob}},crispLine:function(a,b){if(a[1]===a[4])a[1]=a[4]=W(a[1])+b%2/2;if(a[2]===a[5])a[2]=a[5]=W(a[2])+b%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,fill:jb})},circle:function(a,
+b,c){a=Nb(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,b||0,c||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}e=this.createElement("rect").attr({rx:e,ry:e,fill:jb});return e.attr(e.crisp(f,a,b,Ia(c,0),Ia(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;
+this.height=b;for(this.boxWrapper[A(c,true)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return K(a)?b.attr({"class":vc+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:jb};arguments.length>1&&sa(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e){var f,
+g=this.symbols[a];g=g&&g(W(b),W(c),d,e);var h=/^url\((.*?)\)$/,i;if(g){f=this.path(g);sa(f,{symbolName:a,x:b,y:c,r:d});e&&sa(f,e)}else if(h.test(a)){var j=function(m,v){m.attr({width:v[0],height:v[1]}).translate(-W(v[0]/2),-W(v[1]/2))};i=a.match(h)[1];a=be[i];f=this.image(i).attr({x:b,y:c});if(a)j(f,a);else{f.attr({width:0,height:0});hb("img",{onload:function(){j(f,be[i]=[this.width,this.height])},src:i})}}else f=this.circle(b,c,d);return f},symbols:{square:function(a,b,c){c=0.707*c;return[Za,a-c,
+b-c,Ka,a+c,b-c,a+c,b+c,a-c,b+c,"Z"]},triangle:function(a,b,c){return[Za,a,b-1.33*c,Ka,a+c,b+0.67*c,a-c,b+0.67*c,"Z"]},"triangle-down":function(a,b,c){return[Za,a,b+1.33*c,Ka,a-c,b-0.67*c,a+c,b-0.67*c,"Z"]},diamond:function(a,b,c){return[Za,a,b-c,Ka,a+c,b,a,b+c,a-c,b,"Z"]},arc:function(a,b,c,d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,h=rb(e),i=Cb(e),j=rb(f);f=Cb(f);d=d.end-e<kc?0:1;return[Za,a+c*h,b+c*i,"A",c,c,0,d,1,a+c*j,b+c*f,Ka,a+g*j,b+g*f,"A",g,g,0,d,0,a+g*h,b+g*i,"Z"]}},clipRect:function(a,b,
+c,d){var e=vc+wd++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;b=a.linearGradient;c=vc+wd++;var g,h,i;g=f.createElement("linearGradient").attr({id:c,gradientUnits:"userSpaceOnUse",x1:b[0],y1:b[1],x2:b[2],y2:b[3]}).add(f.defs);f.gradients.push(g);g.stops=[];u(a.stops,function(j){if(e.test(j[1])){d=bc(j[1]);h=d.get("rgb");i=d.get("a")}else{h=j[1];i=1}j=
+f.createElement("stop").attr({offset:j[0],"stop-color":h,"stop-opacity":i}).add(g);g.stops.push(j)});return"url("+this.url+"#"+c+")"}else if(e.test(a)){d=bc(a);Ga(b,c+"-opacity",d.get("a"));return d.get("rgb")}else{b.removeAttribute(c+"-opacity");return a}},text:function(a,b,c,d){var e=Xa.chart.style;b=W(A(b,0));c=W(A(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({fontFamily:e.fontFamily,fontSize:e.fontSize});a.x=b;a.y=c;a.useHTML=d;return a}};fd=ed;if(!Lc){Db=yb(Uc,{init:function(a,
+b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ",ic,";"];if(b==="shape"||b===Tb)d.push("left:0;top:0;width:10px;height:10px;");if(Mc)d.push("visibility: ",b===Tb?ob:Ab);c.push(' style="',d.join(""),'"/>');if(b){c=b===Tb||b==="span"||b==="img"?c.join(""):a.prepVML(c);this.element=hb(c)}this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box;d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);Mc&&d.gVis===ob&&Ja(c,{visibility:ob});d.appendChild(c);this.added=true;this.alignOnAdd&&
+this.updateTransform();return this},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,i=this.renderer,j=this.symbolName,m,v,P=this.shadows,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;T=c==="strokeWidth"||c==="stroke-width"?this.strokeweight:this[c]}else for(c in a){d=a[c];m=false;if(j&&/^(x|y|r|start|end|width|height|innerR)/.test(c)){if(!v){this.symbolAttr(a);v=true}m=true}else if(c==="d"){d=d||[];this.d=d.join(" ");e=d.length;for(m=[];e--;)m[e]=lc(d[e])?W(d[e]*10)-
+5:d[e]==="Z"?"x":d[e];d=m.join(" ")||"x";f.path=d;if(P)for(e=P.length;e--;)P[e].path=d;m=true}else if(c==="zIndex"||c==="visibility"){if(Mc&&c==="visibility"&&h==="DIV"){f.gVis=d;m=f.childNodes;for(e=m.length;e--;)Ja(m[e],{visibility:d});if(d===Ab)d=null}if(d)g[c]=d;m=true}else if(/^(width|height)$/.test(c)){this[c]=d;if(this.updateClipping){this[c]=d;this.updateClipping()}else g[c]=d;m=true}else if(/^(x|y)$/.test(c)){this[c]=d;if(f.tagName==="SPAN")this.updateTransform();else g[{x:"left",y:"top"}[c]]=
+d}else if(c==="class")f.className=d;else if(c==="stroke"){d=i.color(d,f,c);c="strokecolor"}else if(c==="stroke-width"||c==="strokeWidth"){f.stroked=d?true:false;c="strokeweight";this[c]=d;if(lc(d))d+=Ua}else if(c==="dashstyle"){(f.getElementsByTagName("stroke")[0]||hb(i.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid";this.dashstyle=d;m=true}else if(c==="fill")if(h==="SPAN")g.color=d;else{f.filled=d!==jb?true:false;d=i.color(d,f,c);c="fillcolor"}else if(c==="translateX"||c==="translateY"||c==="rotation"||
+c==="align"){if(c==="align")c="textAlign";this[c]=d;this.updateTransform();m=true}else if(c==="text"){this.bBox=null;f.innerHTML=d;m=true}if(P&&c==="visibility")for(e=P.length;e--;)P[e].style[c]=d;if(!m)if(Mc)f[c]=d;else Ga(f,c,d)}return T},clip:function(a){var b=this,c=a.members;c.push(b);b.destroyClip=function(){nc(c,b)};return b.css(a.getCSS(b.inverted))},css:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width){delete a.width;this.textWidth=b;this.updateTransform()}this.styles=sa(this.styles,
+a);Ja(this.element,a);return this},safeRemoveChild:function(a){a.parentNode&&pc(a)},destroy:function(){this.destroyClip&&this.destroyClip();return Uc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,b=a.length,c;b--;){c=a[b];c.parentNode.removeChild(c)}},getBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position=ic;b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},on:function(a,b){this.element["on"+
+a]=function(){var c=db.event;c.target=c.srcElement;b(c)};return this},updateTransform:function(){if(this.added){var a=this,b=a.element,c=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=g&&g!=="left";if(c||d)a.css({marginLeft:c,marginTop:d});a.inverted&&u(b.childNodes,function(z){a.renderer.invertChild(z,b)});if(b.tagName==="SPAN"){var j,m;c=a.rotation;var v;j=0;d=1;var P=0,T;v=ja(a.textWidth);var Y=a.xCorr||0,H=a.yCorr||0,U=[c,g,b.innerHTML,
+a.textWidth].join(",");if(U!==a.cTT){if(K(c)){j=c*ae;d=rb(j);P=Cb(j);Ja(b,{filter:c?["progid:DXImageTransform.Microsoft.Matrix(M11=",d,", M12=",-P,", M21=",P,", M22=",d,", sizingMethod='auto expand')"].join(""):jb})}j=b.offsetWidth;m=b.offsetHeight;if(j>v){Ja(b,{width:v+Ua,display:"block",whiteSpace:"normal"});j=v}v=W((ja(b.style.fontSize)||12)*1.2);Y=d<0&&-j;H=P<0&&-m;T=d*P<0;Y+=P*v*(T?1-h:h);H-=d*v*(c?T?h:1-h:1);if(i){Y-=j*h*(d<0?-1:1);if(c)H-=m*h*(P<0?-1:1);Ja(b,{textAlign:g})}a.xCorr=Y;a.yCorr=
+H}Ja(b,{left:e+Y,top:f+H});a.cTT=U}}else this.alignOnAdd=true},shadow:function(a,b){var c=[],d,e=this.element,f=this.renderer,g,h=e.style,i,j=e.path;if(j&&typeof j.value!=="string")j="x";if(a){for(d=1;d<=3;d++){i=['<shape isShadow="true" strokeweight="',7-2*d,'" filled="false" path="',j,'" coordsize="100,100" style="',e.style.cssText,'" />'];g=hb(f.prepVML(i),null,{left:ja(h.left)+1,top:ja(h.top)+1});i=['<stroke color="black" opacity="',0.05*d,'"/>'];hb(f.prepVML(i),null,null,g);b?b.element.appendChild(g):
+e.parentNode.insertBefore(g,e);c.push(g)}this.shadows=c}return this}});ma=function(){this.init.apply(this,arguments)};ma.prototype=Ca(ed.prototype,{Element:Db,isIE8:yc.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d;this.alignedObjects=[];d=this.createElement(Tb);a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(b,c,false);if(!ua.namespaces.hcv){ua.namespaces.add("hcv","urn:schemas-microsoft-com:vml");ua.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}},
+clipRect:function(a,b,c,d){var e=this.createElement();return sa(e,{members:[],left:a,top:b,width:c,height:d,getCSS:function(f){var g=this.top,h=this.left,i=h+this.width,j=g+this.height;g={clip:"rect("+W(f?h:g)+"px,"+W(f?j:i)+"px,"+W(f?i:j)+"px,"+W(f?g:h)+"px)"};!f&&Mc&&sa(g,{width:i+Ua,height:j+Ua});return g},updateClipping:function(){u(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,h=a.linearGradient,i,j,m,v;u(a.stops,
+function(P,T){if(e.test(P[1])){d=bc(P[1]);f=d.get("rgb");g=d.get("a")}else{f=P[1];g=1}if(T){m=f;v=g}else{i=f;j=g}});a=90-Fa.atan((h[3]-h[1])/(h[2]-h[0]))*180/kc;a=["<",c,' colors="0% ',i,",100% ",m,'" angle="',a,'" opacity="',v,'" o:opacity2="',j,'" type="gradient" focus="100%" />'];hb(this.prepVML(a),null,null,b)}else if(e.test(a)&&b.tagName!=="IMG"){d=bc(a);a=["<",c,' opacity="',d.get("a"),'"/>'];hb(this.prepVML(a),null,null,b);return d.get("rgb")}else{b=b.getElementsByTagName(c);if(b.length)b[0].opacity=
+1;return a}},prepVML:function(a){var b=this.isIE8;a=a.join("");if(b){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,b,c){var d=Xa.chart.style;return this.createElement("span").attr({text:a,x:W(b),y:W(c)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily,
+fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",d:a})},circle:function(a,b,c){return this.symbol("circle").attr({x:a,y:b,r:c})},g:function(a){var b;if(a)b={className:vc+a,"class":vc+a};return this.createElement(Tb).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:b,top:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;
+a=a.x}var g=this.symbol("rect");g.r=e;return g.attr(g.crisp(f,a,b,Ia(c,0),Ia(d,0)))},invertChild:function(a,b){var c=b.style;Ja(a,{flip:"x",left:ja(c.width)-10,top:ja(c.height)-10,rotation:-90})},symbols:{arc:function(a,b,c,d){var e=d.start,f=d.end,g=rb(e),h=Cb(e),i=rb(f),j=Cb(f);d=d.innerR;var m=0.07/c,v=d&&0.1/d||0;if(f-e===0)return["x"];else if(2*kc-f+e<m)i=-m;else if(f-e<v)i=rb(e+v);return["wa",a-c,b-c,a+c,b+c,a+c*g,b+c*h,a+c*i,b+c*j,"at",a-d,b-d,a+d,b+d,a+d*i,b+d*j,a+d*g,b+d*h,"x","e"]},circle:function(a,
+b,c){return["wa",a-c,b-c,a+c,b+c,a+c,b,a+c,b,"e"]},rect:function(a,b,c,d){if(!K(d))return[];var e=d.width;d=d.height;var f=a+e,g=b+d;c=tb(c,e,d);return[Za,a+c,b,Ka,f-c,b,"wa",f-2*c,b,f,b+2*c,f-c,b,f,b+c,Ka,f,g-c,"wa",f-2*c,g-2*c,f,g,f,g-c,f-c,g,Ka,a+c,g,"wa",a,g-2*c,a+2*c,g,a+c,g,a,g-c,Ka,a,b+c,"wa",a,b,a+2*c,b+2*c,a,b+c,a+c,b,"x","e"]}}});fd=ma}Nd.prototype.callbacks=[];var Oc=function(){};Oc.prototype={init:function(a,b){var c=a.chart.counters,d;this.series=a;this.applyOptions(b);this.pointAttr=
+{};if(a.options.colorByPoint){d=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=this.color||d[c.color++];c.wrapColor(d.length)}a.chart.pointCount++;return this},applyOptions:function(a){var b=this.series;this.config=a;if(lc(a)||a===null)this.y=a;else if(Nb(a)&&!lc(a.length)){sa(this,a);this.options=a}else if(Sb(a[0])){this.name=a[0];this.y=a[1]}else if(lc(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Wa)this.x=b.autoIncrement()},destroy:function(){var a=this,b=a.series,
+c=b.chart.hoverPoints,d;b.chart.pointCount--;if(c){a.setState();nc(c,a)}a===b.chart.hoverPoint&&a.onMouseOut();pb(a);u(["graphic","tracker","group","dataLabel","connector","shadowGroup"],function(e){a[e]&&a[e].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(d in a)a[d]=null},getLabelConfig:function(){return{x:this.category,y:this.y,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series.chart;a=A(a,
+!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=a;c.setState(a&&"select");b||u(d.getSelectedPoints(),function(e){if(e.selected&&e!==c){e.selected=false;e.setState(ib);e.firePointEvent("unselect")}})})},onMouseOver:function(){var a=this.series.chart,b=a.tooltip,c=a.hoverPoint;c&&c!==this&&c.onMouseOut();this.firePointEvent("mouseOver");b&&!b.shared&&b.refresh(this);this.setState(Bb);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState();
+this.series.chart.hoverPoint=null},tooltipFormatter:function(a){var b=this.series;return['<span style="color:'+b.color+'">',this.name||b.name,"</span>: ",!a?"<b>x = "+(this.name||this.x)+",</b> ":"","<b>",!a?"y = ":"",this.y,"</b>"].join("")},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g=e.chart;b=A(b,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(Nb(a)){e.getAttribs();f&&f.attr(d.pointAttr[e.state])}e.isDirty=true;b&&g.redraw(c)})},remove:function(a,b){var c=
+this,d=c.series,e=d.chart,f=d.data;oc(b,e);a=A(a,true);c.firePointEvent("remove",null,function(){nc(f,c);c.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;if(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])this.importEvents();if(a==="click"&&e.allowPointSelect)c=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Pa(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a=Ca(this.series.options.point,
+this.options).events,b;this.events=a;for(b in a)Qa(this,b,a[b]);this.hasImportedEvents=true}},setState:function(a){var b=this.series,c=b.options.states,d=xb[b.type].marker&&b.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=b.stateMarkerGraphic,h=b.chart,i=this.pointAttr;a=a||ib;if(!(a===this.state||this.selected&&a!=="select"||c[a]&&c[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(i[a]);else{if(a){if(!g)b.stateMarkerGraphic=g=h.renderer.circle(0,
+0,i[a].r).attr(i[a]).add(b.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var sb=function(){};sb.prototype={isCartesian:true,type:"line",pointClass:Oc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,b){var c,d;d=a.series.length;this.chart=a;b=this.setOptions(b);sa(this,{index:d,options:b,name:b.name||"Series "+(d+1),state:ib,pointAttr:{},visible:b.visible!==false,selected:b.selected===true});d=b.events;
+for(c in d)Qa(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(b.data,false)},autoIncrement:function(){var a=this.options,b=this.xIncrement;b=A(b,a.pointStart,0);this.pointInterval=A(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},cleanData:function(){var a=this.chart,b=this.data,c,d,e=a.smallestInterval,f,g;Hd(b,function(h,i){return h.x-i.x});if(this.options.connectNulls)for(g=
+b.length-1;g>=0;g--)b[g].y===null&&b[g-1]&&b[g+1]&&b.splice(g,1);for(g=b.length-1;g>=0;g--)if(b[g-1]){f=b[g].x-b[g-1].x;if(f>0&&(d===Wa||f<d)){d=f;c=g}}if(e===Wa||d<e)a.smallestInterval=d;this.closestPoints=c},getSegments:function(){var a=-1,b=[],c=this.data;u(c,function(d,e){if(d.y===null){e>a+1&&b.push(c.slice(a+1,e));a=e}else e===c.length-1&&b.push(c.slice(a+1,e+1))});this.segments=b},setOptions:function(a){var b=this.chart.options.plotOptions;return Ca(b[this.type],b.series,a)},getColor:function(){var a=
+this.chart.options.colors,b=this.chart.counters;this.color=this.options.color||a[b.color++]||"#0000ff";b.wrapColor(a.length)},getSymbol:function(){var a=this.chart.options.symbols,b=this.chart.counters;this.symbol=this.options.marker.symbol||a[b.symbol++];b.wrapSymbol(a.length)},addPoint:function(a,b,c,d){var e=this.data,f=this.graph,g=this.area,h=this.chart;a=(new this.pointClass).init(this,a);oc(d,h);if(f&&c)f.shift=c;if(g){g.shift=c;g.isArea=true}b=A(b,true);e.push(a);c&&e[0].remove(false);this.getAttribs();
+this.isDirty=true;b&&h.redraw()},setData:function(a,b){var c=this,d=c.data,e=c.initialColor,f=c.chart,g=d&&d.length||0;c.xIncrement=null;if(K(e))f.counters.color=e;for(a=tc(zc(a||[]),function(h){return(new c.pointClass).init(c,h)});g--;)d[g].destroy();c.data=a;c.cleanData();c.getSegments();c.getAttribs();c.isDirty=true;f.isDirtyBox=true;A(b,true)&&f.redraw(false)},remove:function(a,b){var c=this,d=c.chart;a=A(a,true);if(!c.isRemoving){c.isRemoving=true;Pa(c,"remove",null,function(){c.destroy();d.isDirtyLegend=
+d.isDirtyBox=true;a&&d.redraw(b)})}c.isRemoving=false},translate:function(){for(var a=this.chart,b=this.options.stacking,c=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],h=g.x,i=g.y,j=g.low,m=d.stacks[(i<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(h);if(b&&this.visible&&m&&m[h]){j=m[h];h=j.total;j.cum=j=j.cum-i;i=j+i;if(b==="percent"){j=h?j*100/h:0;i=h?i*100/h:0}g.percentage=h?g.y*100/h:0;g.stackTotal=h}if(K(j))g.yBottom=d.translate(j,0,1,0,1);if(i!==null)g.plotY=
+d.translate(i,0,1,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=c&&c[g.x]!==Wa?c[g.x]:g.x}},setTooltipPoints:function(a){var b=this.chart,c=b.inverted,d=[],e=W((c?b.plotTop:b.plotLeft)+b.plotSizeX),f,g,h=[];if(a)this.tooltipPoints=null;u(this.segments,function(i){d=d.concat(i)});if(this.xAxis&&this.xAxis.reversed)d=d.reverse();u(d,function(i,j){f=d[j-1]?d[j-1]._high+1:0;for(g=i._high=d[j+1]?lb((i.plotX+(d[j+1]?d[j+1].plotX:e))/2):e;f<=g;)h[c?e-f++:f++]=i});this.tooltipPoints=h},
+onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(!(!Kb&&a.mouseIsDown)){b&&b!==this&&b.onMouseOut();this.options.events.mouseOver&&Pa(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(Bb);a.hoverSeries=this}},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Pa(this,"mouseOut");c&&!a.stickyTracking&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this.chart,c=this.clipRect,
+d=this.options.animation;if(d&&!Nb(d))d={};if(a){if(!c.isAnimating){c.attr("width",0);c.isAnimating=true}}else{c.animate({width:b.plotSizeX},d);this.animate=null}},drawPoints:function(){var a,b=this.data,c=this.chart,d,e,f,g,h,i;if(this.options.marker.enabled)for(f=b.length;f--;){g=b[f];d=g.plotX;e=g.plotY;i=g.graphic;if(e!==Wa&&!isNaN(e)){a=g.pointAttr[g.selected?"select":ib];h=a.r;if(i)i.animate({x:d,y:e,r:h});else g.graphic=c.renderer.symbol(A(g.marker&&g.marker.symbol,this.symbol),d,e,h).attr(a).add(this.group)}}},
+convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e){g=e[f];h[f]=A(a[g],b[f],c[f],d[f])}return h},getAttribs:function(){var a=this,b=xb[a.type].marker?a.options.marker:a.options,c=b.states,d=c[Bb],e,f=a.color,g={stroke:f,fill:f},h=a.data,i=[],j,m=a.pointAttrToOptions,v;if(a.options.marker){d.radius=d.radius||b.radius+2;d.lineWidth=d.lineWidth||b.lineWidth+1}else d.color=d.color||bc(d.color||f).brighten(d.brightness).get();i[ib]=a.convertAttribs(b,
+g);u([Bb,"select"],function(P){i[P]=a.convertAttribs(c[P],i[ib])});a.pointAttr=i;for(f=h.length;f--;){g=h[f];if((b=g.options&&g.options.marker||g.options)&&b.enabled===false)b.radius=0;e=false;if(g.options)for(v in m)if(K(b[m[v]]))e=true;if(e){j=[];c=b.states||{};e=c[Bb]=c[Bb]||{};if(!a.options.marker)e.color=bc(e.color||g.options.color).brighten(e.brightness||d.brightness).get();j[ib]=a.convertAttribs(b,i[ib]);j[Bb]=a.convertAttribs(c[Bb],i[Bb],j[ib]);j.select=a.convertAttribs(c.select,i.select,
+j[ib])}else j=i;g.pointAttr=j}},destroy:function(){var a=this,b=a.chart,c=a.clipRect,d=/\/5[0-9\.]+ (Safari|Mobile)\//.test(yc),e,f;Pa(a,"destroy");pb(a);a.legendItem&&a.chart.legend.destroyItem(a);u(a.data,function(g){g.destroy()});if(c&&c!==b.clipRect)a.clipRect=c.destroy();u(["area","graph","dataLabelsGroup","group","tracker"],function(g){if(a[g]){e=d&&g==="group"?"hide":"destroy";a[g][e]()}});if(b.hoverSeries===a)b.hoverSeries=null;nc(b.series,a);for(f in a)delete a[f]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a,
+b,c=this.data,d=this.options,e=d.dataLabels,f,g=this.dataLabelsGroup,h=this.chart,i=h.renderer,j=h.inverted,m=this.type,v;v=d.stacking;var P=m==="column"||m==="bar",T=e.verticalAlign===null,Y=e.y===null;if(P)if(v){if(T)e=Ca(e,{verticalAlign:"middle"});if(Y)e=Ca(e,{y:{top:14,middle:4,bottom:-6}[e.verticalAlign]})}else if(T)e=Ca(e,{verticalAlign:"top"});if(g)g.translate(h.plotLeft,h.plotTop);else g=this.dataLabelsGroup=i.g("data-labels").attr({visibility:this.visible?Ab:ob,zIndex:6}).translate(h.plotLeft,
+h.plotTop).add();v=e.color;if(v==="auto")v=null;e.style.color=A(v,this.color,"black");u(c,function(H){var U=H.barX,z=U&&U+H.barW/2||H.plotX||-999,M=A(H.plotY,-999),y=H.dataLabel,C=e.align,Z=Y?H.y>=0?-6:12:e.y;f=e.formatter.call(H.getLabelConfig());a=(j?h.plotWidth-M:z)+e.x;b=(j?h.plotHeight-z:M)+Z;if(m==="column")a+={left:-1,right:1}[C]*H.barW/2||0;if(j&&H.y<0){C="right";a-=10}if(y){if(j&&!e.y)b=b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2;y.attr({text:f}).animate({x:a,y:b})}else if(K(f)){y=
+H.dataLabel=i.text(f,a,b).attr({align:C,rotation:e.rotation,zIndex:1}).css(e.style).add(g);j&&!e.y&&y.attr({y:b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2})}if(P&&d.stacking&&y){z=H.barY;M=H.barW;H=H.barH;y.align(e,null,{x:j?h.plotWidth-z-H:U,y:j?h.plotHeight-U-M:z,width:j?H:M,height:j?M:H})}})}},drawGraph:function(){var a=this,b=a.options,c=a.graph,d=[],e,f=a.area,g=a.group,h=b.lineColor||a.color,i=b.lineWidth,j=b.dashStyle,m,v=a.chart.renderer,P=a.yAxis.getThreshold(b.threshold||0),T=/^area/.test(a.type),
+Y=[],H=[];u(a.segments,function(U){m=[];u(U,function(C,Z){if(a.getPointSpline)m.push.apply(m,a.getPointSpline(U,C,Z));else{m.push(Z?Ka:Za);Z&&b.step&&m.push(C.plotX,U[Z-1].plotY);m.push(C.plotX,C.plotY)}});if(U.length>1)d=d.concat(m);else Y.push(U[0]);if(T){var z=[],M,y=m.length;for(M=0;M<y;M++)z.push(m[M]);y===3&&z.push(Ka,m[1],m[2]);if(b.stacking&&a.type!=="areaspline")for(M=U.length-1;M>=0;M--)z.push(U[M].plotX,U[M].yBottom);else z.push(Ka,U[U.length-1].plotX,P,Ka,U[0].plotX,P);H=H.concat(z)}});
+a.graphPath=d;a.singlePoints=Y;if(T){e=A(b.fillColor,bc(a.color).setOpacity(b.fillOpacity||0.75).get());if(f)f.animate({d:H});else a.area=a.chart.renderer.path(H).attr({fill:e}).add(g)}if(c){Hc(c);c.animate({d:d})}else if(i){c={stroke:h,"stroke-width":i};if(j)c.dashstyle=j;a.graph=v.path(d).attr(c).add(g).shadow(b.shadow)}},render:function(){var a=this,b=a.chart,c,d,e=a.options,f=e.animation,g=f&&a.animate;f=g?f&&f.duration||500:0;var h=a.clipRect,i=b.renderer;if(!h){h=a.clipRect=!b.hasRendered&&
+b.clipRect?b.clipRect:i.clipRect(0,0,b.plotSizeX,b.plotSizeY);if(!b.clipRect)b.clipRect=h}if(!a.group){c=a.group=i.g("series");if(b.inverted){d=function(){c.attr({width:b.plotWidth,height:b.plotHeight}).invert()};d();Qa(b,"resize",d);Qa(a,"destroy",function(){pb(b,"resize",d)})}c.clip(a.clipRect).attr({visibility:a.visible?Ab:ob,zIndex:e.zIndex}).translate(b.plotLeft,b.plotTop).add(b.seriesGroup)}a.drawDataLabels();g&&a.animate(true);a.drawGraph&&a.drawGraph();a.drawPoints();a.options.enableMouseTracking!==
+false&&a.drawTracker();g&&a.animate();setTimeout(function(){h.isAnimating=false;if((c=a.group)&&h!==b.clipRect&&h.renderer){c.clip(a.clipRect=b.clipRect);h.destroy()}},f);a.isDirty=false},redraw:function(){var a=this.chart,b=this.group;if(b){a.inverted&&b.attr({width:a.plotWidth,height:a.plotHeight});b.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},setState:function(a){var b=this.options,c=this.graph,d=b.states;b=b.lineWidth;a=a||
+ib;if(this.state!==a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)b=d[a].lineWidth||b+1;if(c&&!c.dashstyle)c.attr({"stroke-width":b},a?0:500)}}},setVisible:function(a,b){var c=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,h,i=this.data,j=c.options.chart.ignoreHiddenSeries;h=this.visible;h=(this.visible=a=a===Wa?!h:a)?"show":"hide";e&&e[h]();if(f)f[h]();else for(e=i.length;e--;){f=i[e];f.tracker&&f.tracker[h]()}g&&g[h]();d&&c.legend.colorizeItem(this,a);this.isDirty=
+true;this.options.stacking&&u(c.series,function(m){if(m.options.stacking&&m.visible)m.isDirty=true});if(j)c.isDirtyBox=true;b!==false&&c.redraw();Pa(this,h)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Wa?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Pa(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,c=[].concat(a.graphPath),d=c.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,h=b.cursor;
+h=h&&{cursor:h};var i=a.singlePoints,j;if(d)for(j=d+1;j--;){c[j]===Za&&c.splice(j+1,0,c[j+1]-f,c[j+2],Ka);if(j&&c[j]===Za||j===d)c.splice(j,0,Ka,c[j-2]+f,c[j-1])}for(j=0;j<i.length;j++){d=i[j];c.push(Za,d.plotX-f,d.plotY,Ka,d.plotX+f,d.plotY)}if(g)g.attr({d:c});else a.tracker=e.renderer.path(c).attr({isTracker:true,stroke:ce,fill:jb,"stroke-width":b.lineWidth+2*f,visibility:a.visible?Ab:ob,zIndex:b.zIndex||1}).on(Kb?"touchstart":"mouseover",function(){e.hoverSeries!==a&&a.onMouseOver()}).on("mouseout",
+function(){b.stickyTracking||a.onMouseOut()}).css(h).add(e.trackerGroup)}};ma=yb(sb);wb.line=ma;ma=yb(sb,{type:"area"});wb.area=ma;ma=yb(sb,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,m;if(c&&c<a.length-1){a=f.plotY;j=g.plotX;g=g.plotY;var v;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;m=(1.5*e+g)/2.5;v=(m-i)*(j-d)/(j-h)+e-m;i+=v;m+=v;if(i>a&&i>e){i=Ia(a,e);m=2*e-i}else if(i<a&&i<e){i=tb(a,e);m=2*e-i}if(m>g&&m>e){m=Ia(g,e);i=2*e-m}else if(m<
+g&&m<e){m=tb(g,e);i=2*e-m}b.rightContX=j;b.rightContY=m}if(c){b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e];f.rightContX=f.rightContY=null}else b=[Za,d,e];return b}});wb.spline=ma;ma=yb(ma,{type:"areaspline"});wb.areaspline=ma;var hd=yb(sb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){sb.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasColumn=true;b.hasRendered&&u(b.series,function(c){if(c.type===
+a.type)c.isDirty=true})},translate:function(){var a=this,b=a.chart,c=a.options,d=c.stacking,e=c.borderWidth,f=0,g=a.xAxis.reversed,h=a.xAxis.categories,i={},j,m;sb.prototype.translate.apply(a);u(b.series,function(C){if(C.type===a.type&&C.visible){if(C.options.stacking){j=C.stackKey;if(i[j]===Wa)i[j]=f++;m=i[j]}else m=f++;C.columnIndex=m}});var v=a.data,P=a.closestPoints;h=bb(v[1]?v[P].plotX-v[P-1].plotX:b.plotSizeX/(h&&h.length||1));P=h*c.groupPadding;var T=(h-2*P)/f,Y=c.pointWidth,H=K(Y)?(T-Y)/2:
+T*c.pointPadding,U=Ia(A(Y,T-2*H),1),z=H+(P+((g?f-a.columnIndex:a.columnIndex)||0)*T-h/2)*(g?-1:1),M=a.yAxis.getThreshold(c.threshold||0),y=A(c.minPointLength,5);u(v,function(C){var Z=C.plotY,Sa=C.yBottom||M,Na=C.plotX+z,Ea=md(tb(Z,Sa)),gb=md(Ia(Z,Sa)-Ea),Lb=a.yAxis.stacks[(C.y<0?"-":"")+a.stackKey],Rb;d&&a.visible&&Lb&&Lb[C.x]&&Lb[C.x].setOffset(z,U);if(bb(gb)<y){if(y){gb=y;Ea=bb(Ea-M)>y?Sa-y:M-(Z<=M?y:0)}Rb=Ea-3}sa(C,{barX:Na,barY:Ea,barW:U,barH:gb});C.shapeType="rect";Z=sa(b.renderer.Element.prototype.crisp.apply({},
+[e,Na,Ea,U,gb]),{r:c.borderRadius});if(e%2){Z.y-=1;Z.height+=1}C.shapeArgs=Z;C.trackerArgs=K(Rb)&&Ca(C.shapeArgs,{height:Ia(6,gb+3),y:Rb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d,e;u(a.data,function(f){var g=f.plotY;if(g!==Wa&&!isNaN(g)&&f.y!==null){d=f.graphic;e=f.shapeArgs;if(d){Hc(d);d.animate(e)}else f.graphic=c[f.shapeType](e).attr(f.pointAttr[f.selected?"select":ib]).add(a.group).shadow(b.shadow)}})},drawTracker:function(){var a=
+this,b=a.chart,c=b.renderer,d,e,f=+new Date,g=a.options,h=g.cursor,i=h&&{cursor:h},j;u(a.data,function(m){e=m.tracker;d=m.trackerArgs||m.shapeArgs;delete d.strokeWidth;if(m.y!==null)if(e)e.attr(d);else m.tracker=c[m.shapeType](d).attr({isTracker:f,fill:ce,visibility:a.visible?Ab:ob,zIndex:g.zIndex||1}).on(Kb?"touchstart":"mouseover",function(v){j=v.relatedTarget||v.fromElement;b.hoverSeries!==a&&Ga(j,"isTracker")!==f&&a.onMouseOver();m.onMouseOver()}).on("mouseout",function(v){if(!g.stickyTracking){j=
+v.relatedTarget||v.toElement;Ga(j,"isTracker")!==f&&a.onMouseOut()}}).css(i).add(m.group||b.trackerGroup)})},animate:function(a){var b=this,c=b.data;if(!a){u(c,function(d){var e=d.graphic;d=d.shapeArgs;if(e){e.attr({height:0,y:b.yAxis.translate(0,0,1)});e.animate({height:d.height,y:d.y},b.options.animation)}});b.animate=null}},remove:function(){var a=this,b=a.chart;b.hasRendered&&u(b.series,function(c){if(c.type===a.type)c.isDirty=true});sb.prototype.remove.apply(a,arguments)}});wb.column=hd;ma=yb(hd,
+{type:"bar",init:function(a){a.inverted=this.inverted=true;hd.prototype.init.apply(this,arguments)}});wb.bar=ma;ma=yb(sb,{type:"scatter",translate:function(){var a=this;sb.prototype.translate.apply(a);u(a.data,function(b){b.shapeType="circle";b.shapeArgs={x:b.plotX,y:b.plotY,r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,b=a.options.cursor,c=b&&{cursor:b},d;u(a.data,function(e){(d=e.graphic)&&d.attr({isTracker:true}).on("mouseover",function(){a.onMouseOver();e.onMouseOver()}).on("mouseout",
+function(){a.options.stickyTracking||a.onMouseOut()}).css(c)})},cleanData:function(){}});wb.scatter=ma;ma=yb(Oc,{init:function(){Oc.prototype.init.apply(this,arguments);var a=this,b;sa(a,{visible:a.visible!==false,name:A(a.name,"Slice")});b=function(){a.slice()};Qa(a,"select",b);Qa(a,"unselect",b);return a},setVisible:function(a){var b=this.series.chart,c=this.tracker,d=this.dataLabel,e=this.connector,f=this.shadowGroup,g;g=(this.visible=a=a===Wa?!this.visible:a)?"show":"hide";this.group[g]();c&&
+c[g]();d&&d[g]();e&&e[g]();f&&f[g]();this.legendItem&&b.legend.colorizeItem(this,a)},slice:function(a,b,c){var d=this.series.chart,e=this.slicedTranslation;oc(c,d);A(b,true);a=this.sliced=K(a)?a:!this.sliced;a={translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop};this.group.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}});ma=yb(sb,{type:"pie",isCartesian:false,pointClass:ma,pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor=
+this.chart.counters.color},animate:function(){var a=this;u(a.data,function(b){var c=b.graphic;b=b.shapeArgs;var d=-kc/2;if(c){c.attr({r:0,start:d,end:d});c.animate({r:b.r,start:b.start,end:b.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,b=-0.25,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f=c.center.concat([c.size,c.innerSize||0]),g=this.chart,h=g.plotWidth,i=g.plotHeight,j,m,v,P=this.data,T=2*kc,Y,H=tb(h,i),U,z,M,y=c.dataLabels.distance;f=tc(f,function(C,Z){return(U=
+/%$/.test(C))?[h,i,H,H][Z]*ja(C)/100:C});this.getX=function(C,Z){v=Fa.asin((C-f[1])/(f[2]/2+y));return f[0]+(Z?-1:1)*rb(v)*(f[2]/2+y)};this.center=f;u(P,function(C){a+=C.y});u(P,function(C){Y=a?C.y/a:0;j=W(b*T*1E3)/1E3;b+=Y;m=W(b*T*1E3)/1E3;C.shapeType="arc";C.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:j,end:m};v=(m+j)/2;C.slicedTranslation=tc([rb(v)*d+g.plotLeft,Cb(v)*d+g.plotTop],W);z=rb(v)*f[2]/2;M=Cb(v)*f[2]/2;C.tooltipPos=[f[0]+z*0.7,f[1]+M*0.7];C.labelPos=[f[0]+z+rb(v)*y,f[1]+M+Cb(v)*
+y,f[0]+z+rb(v)*e,f[1]+M+Cb(v)*e,f[0]+z,f[1]+M,y<0?"center":v<T/4?"left":"right",v];C.percentage=Y*100;C.total=a});this.setTooltipPoints()},render:function(){this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();this.drawDataLabels();this.options.animation&&this.animate&&this.animate();this.isDirty=false},drawPoints:function(){var a=this.chart,b=a.renderer,c,d,e,f=this.options.shadow,g,h;u(this.data,function(i){d=i.graphic;h=i.shapeArgs;e=i.group;g=i.shadowGroup;if(f&&!g)g=
+i.shadowGroup=b.g("shadow").attr({zIndex:4}).add();if(!e)e=i.group=b.g("point").attr({zIndex:5}).add();c=i.sliced?i.slicedTranslation:[a.plotLeft,a.plotTop];e.translate(c[0],c[1]);g&&g.translate(c[0],c[1]);if(d)d.animate(h);else i.graphic=b.arc(h).attr(sa(i.pointAttr[ib],{"stroke-linejoin":"round"})).add(i.group).shadow(f,g);i.visible===false&&i.setVisible(false)})},drawDataLabels:function(){var a=this.data,b,c=this.chart,d=this.options.dataLabels,e=A(d.connectorPadding,10),f=A(d.connectorWidth,1),
+g,h,i=A(d.softConnector,true),j=d.distance,m=this.center,v=m[2]/2;m=m[1];var P=j>0,T=[[],[]],Y,H,U,z,M=2,y;if(d.enabled){sb.prototype.drawDataLabels.apply(this);u(a,function(gb){if(gb.dataLabel)T[gb.labelPos[7]<kc/2?0:1].push(gb)});T[1].reverse();z=function(gb,Lb){return Lb.y-gb.y};for(a=T[0][0]&&T[0][0].dataLabel&&ja(T[0][0].dataLabel.styles.lineHeight);M--;){var C=[],Z=[],Sa=T[M],Na=Sa.length,Ea;for(y=m-v-j;y<=m+v+j;y+=a)C.push(y);U=C.length;if(Na>U){h=[].concat(Sa);h.sort(z);for(y=Na;y--;)h[y].rank=
+y;for(y=Na;y--;)Sa[y].rank>=U&&Sa.splice(y,1);Na=Sa.length}for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;b=9999;for(H=0;H<U;H++){g=bb(C[H]-h[1]);if(g<b){b=g;Ea=H}}if(Ea<y&&C[y]!==null)Ea=y;else{if(U<Na-y+Ea&&C[y]!==null)Ea=U-Na+y;for(;C[Ea]===null;)Ea++}Z.push({i:Ea,y:C[Ea]});C[Ea]=null}Z.sort(z);for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;g=b.dataLabel;H=Z.pop();Y=h[1];U=b.visible===false?ob:Ab;Ea=H.i;H=H.y;if(Y>H&&C[Ea+1]!==null||Y<H&&C[Ea-1]!==null)H=Y;Y=this.getX(Ea===0||Ea===C.length-1?Y:H,M);g.attr({visibility:U,
+align:h[6]})[g.moved?"animate":"attr"]({x:Y+d.x+({left:e,right:-e}[h[6]]||0),y:H+d.y});g.moved=true;if(P&&f){g=b.connector;h=i?[Za,Y+(h[6]==="left"?5:-5),H,"C",Y,H,2*h[2]-h[4],2*h[3]-h[5],h[2],h[3],Ka,h[4],h[5]]:[Za,Y+(h[6]==="left"?5:-5),H,Ka,h[2],h[3],Ka,h[4],h[5]];if(g){g.animate({d:h});g.attr("visibility",U)}else b.connector=g=this.chart.renderer.path(h).attr({"stroke-width":f,stroke:d.connectorColor||b.color||"#606060",visibility:U,zIndex:3}).translate(c.plotLeft,c.plotTop).add()}}}}},drawTracker:hd.prototype.drawTracker,
+getSymbol:function(){}});wb.pie=ma;db.Highcharts={Chart:Nd,dateFormat:Zc,pathAnim:Nc,getOptions:function(){return Xa},hasRtlBug:me,numberFormat:Ed,Point:Oc,Color:bc,Renderer:fd,seriesTypes:wb,setOptions:function(a){Xa=Ca(Xa,a);Id();return Xa},Series:sb,addEvent:Qa,removeEvent:pb,createElement:hb,discardElement:pc,css:Ja,each:u,extend:sa,map:tc,merge:Ca,pick:A,extendClass:yb,product:"Highcharts",version:"2.1.9"}})();

+ 71 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/html5shiv.html

@@ -0,0 +1,71 @@
+<!doctype html>
+<html lang="en" dir="ltr" id="html">
+	<head>
+		<meta charset="utf-8">
+		<title>html5shiv Test Suite</title>
+		<style>
+			body {
+				background: url(data/body-crash.jpg) no-repeat -999px -999px;
+			}
+			article {
+				border: 2px solid #8C8;
+			}
+		</style>
+		<link rel="stylesheet" media="screen" href="qunit/qunit.css">
+		<script src="../src/html5shiv-printshiv.js"></script>
+		
+		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
+		
+		<script src="qunit/qunit.js"></script>
+		
+		<script src="unit/tests.js"></script>
+	</head>
+	<body id="body">
+		<h1 id="qunit-header">html5shiv Test Suite</h1>
+		<h2 id="qunit-banner"></h2>
+		<div id="qunit-testrunner-toolbar"></div>
+		<h2 id="qunit-userAgent"></h2>
+		<ol id="qunit-tests"></ol>
+		
+		<iframe class="test-frame" src="data/iframed-tests.html?disableMethodsBefore"></iframe>
+		<iframe class="test-frame" src="data/iframed-tests.html?disableMethodsAfter"></iframe>
+		<iframe class="test-frame" src="data/iframed-tests.html?addUnknownBefore"></iframe>
+		<iframe class="test-frame" src="data/iframed-tests.html?addUnknownAfter"></iframe>
+		<iframe class="test-frame" src="data/iframed-tests.html?disableCSS"></iframe>
+		<iframe class="test-frame" src="data/iframed-tests.html?noEmbed"></iframe>
+		
+		
+		<div id="qunit-fixture">
+			<abcxyz>
+				<div class="inside"></div>
+			</abcxyz>
+			<article>
+				<div class="inside"></div>
+			</article>
+			<aside>
+				<div class="inside"></div>
+			</aside>
+			<figcaption>
+				<div class="inside"></div>
+			</figcaption>
+			<figure>
+				<div class="inside"></div>
+			</figure>
+			<footer>
+				<div class="inside"></div>
+			</footer>
+			<header>
+				<div class="inside"></div>
+			</header>
+			<hgroup>
+				<div class="inside"></div>
+			</hgroup>
+			<nav>
+				<div class="inside"></div>
+			</nav>
+			<section>
+				<div class="inside"></div>
+			</section>
+		</div>
+	</body>
+</html>

+ 14 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/iframe.1-1.html

@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>Test 1</title>
+		<link rel="stylesheet" href="style.css">
+		<script src="../src/html5shiv-printshiv.js"></script>
+	</head>
+	<body>
+		<section>
+			<p><a href="iframe.1-2.html">Change to Test Page 2</a></p>
+		</section>
+	</body>
+</html>

+ 13 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/iframe.1-2.html

@@ -0,0 +1,13 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>Test 2</title>
+		<link rel="stylesheet" href="style.css">
+		<script src="../src/html5shiv-printshiv.js"></script>
+	<body>
+		<section>
+			<p><a href="iframe.1-1.html">Change to Test Page 1</a> <span contenteditable>...</span></p>
+		</section>
+	</body>
+</html>

+ 27 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/iframe.1.html

@@ -0,0 +1,27 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>HTML5Shiv</title>
+		<link rel="stylesheet" href="style.css">
+		<style>
+			body {
+				color: #fff;
+				background: url(data/body-crash.jpg);
+			}
+		</style>
+		<script src="../src/html5shiv-printshiv.js"></script>
+		<script src="//use.typekit.com/fbz1vwc.js"></script>
+		<script>
+			Typekit.load();
+		</script>
+	</head>
+	<body>
+		<section>1</section>
+		<section>2</section>
+		<section style="border-color: red;">3</section>
+		<section>
+			<iframe src="iframe.1-1.html" style="width:100%;height:100%;" frameborder="0"></iframe>
+		</section>
+	</body>
+</html>

+ 45 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/index.html

@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>IE&lt;9 HTML5 Shiv Tests</title>
+		<link rel="stylesheet" href="style.css">
+		<script src="../src/html5shiv-printshiv.js"></script>
+	</head>
+	<body>
+		<h1>
+			HTML5 Shiv Tests
+		</h1>
+		<h2>manual Print tests</h2>
+		<ul>
+			<li>
+				<a href="html5shiv.html">html5shiv testsuite</a>: <span class="pass">PASS</span>
+			</li>
+			
+		</ul>
+		<h2>manual Print tests</h2>
+		<ul>
+			<li>
+				<a href="iframe.1.html">iframe.1.html</a>: <span class="pass">PASS</span>
+			</li>
+			<li>
+				<a href="mixed-test.html">mixed-test.html</a>: <span class="pass">PASS</span>
+			</li>
+			
+		</ul>
+		<h2>additional tests</h2>
+		<ul>
+			
+			<li>
+				<a href="object-test.html">object-test.html</a>: <span class="pass">PASS</span>
+			</li>
+			
+			<li>
+				<a href="highcharts/area-basic.html">area-basic.html</a>: <span class="pass">PASS</span>
+			</li>
+			<li>
+				<a href="jquery-1.7.1/index.html">simplified jQuery test suite</a>:
+			</li>
+		</ul>
+	<body>
+</html>

+ 11 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/dashboard.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dashboard>
+	<locations class="foo">
+		<location for="bar" checked="different">
+			<infowindowtab>
+				<tab title="Location"><![CDATA[blabla]]></tab>
+				<tab title="Users"><![CDATA[blublu]]></tab>
+			</infowindowtab>
+		</location>
+	</locations>
+</dashboard>

+ 8 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/iframe.html

@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <title>iframe</title>
+  </head>
+  <body>
+    <div><span>span text</span></div>
+  </body>
+</html>

+ 3 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/test.js

@@ -0,0 +1,3 @@
+var foobar = "bar";
+jQuery('#ap').html('bar');
+ok( true, "test.js executed");

+ 121 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/testinit.js

@@ -0,0 +1,121 @@
+var jQuery = this.jQuery || "jQuery", // For testing .noConflict()
+	$ = this.$ || "$",
+	originaljQuery = jQuery,
+	original$ = $,
+	amdDefined;
+
+/**
+ * Set up a mock AMD define function for testing AMD registration.
+ */
+function define(name, dependencies, callback) {
+	amdDefined = callback();
+}
+
+define.amd = {
+	jQuery: true
+};
+
+/**
+ * Returns an array of elements with the given IDs, eg.
+ * @example q("main", "foo", "bar")
+ * @result [<div id="main">, <span id="foo">, <input id="bar">]
+ */
+function q() {
+	var r = [];
+
+	for ( var i = 0; i < arguments.length; i++ ) {
+		r.push( document.getElementById( arguments[i] ) );
+	}
+
+	return r;
+}
+
+/**
+ * Asserts that a select matches the given IDs * @example t("Check for something", "//[a]", ["foo", "baar"]);
+ * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
+ */
+function t(a,b,c) {
+	var f = jQuery(b).get(), s = "";
+
+	for ( var i = 0; i < f.length; i++ ) {
+		s += (s && ",") + '"' + f[i].id + '"';
+	}
+
+	deepEqual(f, q.apply(q,c), a + " (" + b + ")");
+}
+
+var fireNative;
+if ( document.createEvent ) {
+	fireNative = function( node, type ) {
+		var event = document.createEvent('HTMLEvents');
+		event.initEvent( type, true, true );
+		node.dispatchEvent( event );
+	};
+} else {
+	fireNative = function( node, type ) {
+		var event = document.createEventObject();
+		node.fireEvent( 'on' + type, event );
+	};
+}
+
+/**
+ * Add random number to url to stop IE from caching
+ *
+ * @example url("data/test.html")
+ * @result "data/test.html?10538358428943"
+ *
+ * @example url("data/test.php?foo=bar")
+ * @result "data/test.php?foo=bar&10538358345554"
+ */
+function url(value) {
+	return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000);
+}
+
+(function () {
+	// Store the old counts so that we only assert on tests that have actually leaked,
+	// instead of asserting every time a test has leaked sometime in the past
+	var oldCacheLength = 0,
+		oldFragmentsLength = 0,
+		oldTimersLength = 0,
+		oldActive = 0;
+
+	/**
+	 * Ensures that tests have cleaned up properly after themselves. Should be passed as the
+	 * teardown function on all modules' lifecycle object.
+	 */
+	this.moduleTeardown = function () {
+		var i, fragmentsLength = 0, cacheLength = 0;
+
+		// Allow QUnit.reset to clean up any attached elements before checking for leaks
+		QUnit.reset();
+
+		for ( i in jQuery.cache ) {
+			++cacheLength;
+		}
+
+		jQuery.fragments = {};
+
+		for ( i in jQuery.fragments ) {
+			++fragmentsLength;
+		}
+
+		// Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test,
+		// if we unconditionally assert any of these, the test will fail with too many assertions :|
+		if ( cacheLength !== oldCacheLength ) {
+			equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" );
+			oldCacheLength = cacheLength;
+		}
+		if ( fragmentsLength !== oldFragmentsLength ) {
+			equal( fragmentsLength, oldFragmentsLength, "No unit tests leak memory in jQuery.fragments" );
+			oldFragmentsLength = fragmentsLength;
+		}
+		if ( jQuery.timers.length !== oldTimersLength ) {
+			equal( jQuery.timers.length, oldTimersLength, "No timers are still running" );
+			oldTimersLength = jQuery.timers.length;
+		}
+		if ( jQuery.active !== oldActive ) {
+			equal( jQuery.active, 0, "No AJAX requests are still active" );
+			oldActive = jQuery.active;
+		}
+	}
+}());

+ 27 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/testrunner.js

@@ -0,0 +1,27 @@
+jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
+
+// jQuery-specific QUnit.reset
+(function() {
+	var reset = QUnit.reset,
+		ajaxSettings = jQuery.ajaxSettings;
+
+	QUnit.reset = function() {
+		reset.apply(this, arguments);
+		jQuery.event.global = {};
+		jQuery.ajaxSettings = jQuery.extend({}, ajaxSettings);
+	};
+})();
+
+// load testswarm agent
+(function() {
+	var url = window.location.search;
+	url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+	if ( !url || url.indexOf("http") !== 0 ) {
+		return;
+	}
+
+	// (Temporarily) Disable Ajax tests to reduce network strain
+	// isLocal = QUnit.isLocal = true;
+
+	document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
+})();

+ 128 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/testsuite.css

@@ -0,0 +1,128 @@
+/* for testing opacity set in styles in IE */
+ol#empty { opacity: 0; filter:Alpha(opacity=0) progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff'); }
+
+div#fx-tests h4 {
+        background: red;
+}
+
+div#fx-tests h4.pass {
+        background: green;
+}
+
+div#fx-tests div.box {
+        background: red;
+        overflow: hidden;
+        border: 2px solid #000;
+}
+
+div#fx-tests div.overflow {
+        overflow: visible;
+}
+
+div.inline {
+        display: inline;
+}
+
+div.autoheight {
+        height: auto;
+}
+
+div.autowidth {
+        width: auto;
+}
+
+div.autoopacity {
+        opacity: auto;
+}
+
+div.largewidth {
+        width: 100px;
+}
+
+div.largeheight {
+        height: 100px;
+}
+
+div.largeopacity {
+        filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
+}
+
+div.medwidth {
+        width: 50px;
+}
+
+div.medheight {
+        height: 50px;
+}
+
+div.medopacity {
+        opacity: 0.5;
+        filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
+}
+
+div.nowidth {
+        width: 0px;
+}
+
+div.noheight {
+        height: 0px;
+}
+
+div.noopacity {
+        opacity: 0;
+        filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);
+}
+
+div.hidden {
+        display: none;
+}
+
+div#fx-tests div.widewidth {
+        background-repeat: repeat-x;
+}
+
+div#fx-tests div.wideheight {
+        background-repeat: repeat-y;
+}
+
+div#fx-tests div.widewidth.wideheight {
+        background-repeat: repeat;
+}
+
+div#fx-tests div.noback {
+        background-image: none;
+}
+
+div.chain, div.chain div { width: 100px; height: 20px; position: relative; float: left; }
+div.chain div { position: absolute; top: 0px; left: 0px; }
+
+div.chain.test { background: red; }
+div.chain.test div { background: green; }
+
+div.chain.out { background: green; }
+div.chain.out div { background: red; display: none; }
+
+/* tests to ensure jQuery can determine the native display mode of elements
+   that have been set as display: none in stylesheets */
+div#show-tests * { display: none; }
+
+#nothiddendiv { font-size: 16px; }
+#nothiddendivchild.em { font-size: 2em; }
+#nothiddendivchild.prct { font-size: 150%; }
+
+/* For testing type on vml in IE #7071 */
+v\:oval { behavior:url(#default#VML); display:inline-block; }
+
+/* 8099 changes to default styles are read correctly */
+tt { display: none; }
+sup { display: none; }
+dfn { display: none; }
+
+/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
+body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
+
+/* #6652 REMOVE FILTER:ALPHA(OPACITY=100) AFTER ANIMATION */
+#t6652 div { filter: alpha(opacity=50); }
+
+/* #10501 */
+section { background:#f0f; display:block; }

+ 8 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/data/versioncheck.js

@@ -0,0 +1,8 @@
+// Run minified source from dist (do make first)
+// Should be loaded before QUnit but after src
+(function() {
+	if ( /jquery\=min/.test( window.location.search ) ) {
+		jQuery.noConflict( true );
+		document.write(unescape("%3Cscript%20src%3D%27../dist/jquery.min.js%27%3E%3C/script%3E"));
+	}
+})();

+ 249 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/index.html

@@ -0,0 +1,249 @@
+<!doctype html>
+<html lang="en" dir="ltr" id="html">
+	<head>
+		<meta charset="utf-8">
+		<title>jQuery Test Suite</title>
+		<link rel="stylesheet" media="screen" href="../qunit/qunit.css">
+		<link rel="stylesheet" media="screen" href="data/testsuite.css">
+		<script src="data/testinit.js"></script>
+		<script src="../../src/html5shiv-printshiv.js"></script>
+		<script src="//code.jquery.com/jquery-1.7.1.min.js"></script>
+		<script src="data/versioncheck.js"></script>
+		<script src="../qunit/qunit.js"></script>
+		<script src="data/testrunner.js"></script>
+		<script src="unit/core.js"></script>
+		<script src="unit/traversing.js"></script>
+		<script src="unit/manipulation.js"></script>
+	</head>
+	<body id="body">
+		<h1 id="qunit-header"><a href="/jquery/test/index.html">jQuery Test Suite</a>
+			<a href="?jquery=min">(minified)</a>
+		</h1>
+		<h2 id="qunit-banner"></h2>
+		<div id="qunit-testrunner-toolbar"></div>
+		<h2 id="qunit-userAgent"></h2>
+		<ol id="qunit-tests"></ol>
+
+		<!-- Test HTML -->
+		<div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv">
+			<div id="nothiddendivchild"></div>
+		</div>
+
+		<!-- this iframe is outside the #qunit-fixture so it won't reload constantly wasting time, but it means the tests must be "safe" and clean up after themselves -->
+		<iframe id="loadediframe" name="loadediframe" style="display:none;" src="data/iframe.html"></iframe>
+		<dl id="dl" style="position:absolute;top:-32767px;left:-32767px;width:1px">
+		<div id="qunit-fixture">
+			<p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
+			<p id="ap">
+				Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
+				<a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>.
+				This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>:
+				<a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
+			</p>
+			<div id="foo">
+				<p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
+				<p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
+				<p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
+			</div>
+			<span id="name+value"></span>
+			<p id="first">Try them out:</p>
+			<ul id="firstUL"></ul>
+			<ol id="empty"></ol>
+			<form id="form" action="formaction">
+				<label for="action" id="label-for">Action:</label>
+				<input type="text" name="action" value="Test" id="text1" maxlength="30">
+				<input type="text" name="text2" value="Test" id="text2" disabled="disabled">
+				<input type="radio" name="radio1" id="radio1" value="on">
+
+				<input type="radio" name="radio2" id="radio2" checked="checked">
+				<input type="checkbox" name="check" id="check1" checked="checked">
+				<input type="checkbox" id="check2" value="on">
+
+				<input type="hidden" name="hidden" id="hidden1">
+				<input type="text" style="display:none;" name="foo[bar]" id="hidden2">
+
+				<input type="text" id="name" name="name" value="name">
+				<input type="search" id="search" name="search" value="search">
+
+				<button id="button" name="button" type="button">Button</button>
+				<textarea id="area1" maxlength="30">foobar</textarea>
+
+				<select name="select1" id="select1">
+					<option id="option1a" class="emptyopt" value="">Nothing</option>
+					<option id="option1b" value="1">1</option>
+					<option id="option1c" value="2">2</option>
+					<option id="option1d" value="3">3</option>
+				</select>
+				<select name="select2" id="select2">
+					<option id="option2a" class="emptyopt" value="">Nothing</option>
+					<option id="option2b" value="1">1</option>
+					<option id="option2c" value="2">2</option>
+					<option id="option2d" selected="selected" value="3">3</option>
+				</select>
+				<select name="select3" id="select3" multiple="multiple">
+					<option id="option3a" class="emptyopt" value="">Nothing</option>
+					<option id="option3b" selected="selected" value="1">1</option>
+					<option id="option3c" selected="selected" value="2">2</option>
+					<option id="option3d" value="3">3</option>
+					<option id="option3e">no value</option>
+				</select>
+				<select name="select4" id="select4" multiple="multiple">
+					<optgroup disabled="disabled">
+						<option id="option4a" class="emptyopt" value="">Nothing</option>
+						<option id="option4b" disabled="disabled" selected="selected" value="1">1</option>
+						<option id="option4c" selected="selected" value="2">2</option>
+					</optgroup>
+					<option selected="selected" disabled="disabled" id="option4d" value="3">3</option>
+					<option id="option4e">no value</option>
+				</select>
+				<select name="select5" id="select5">
+					<option id="option5a" value="3">1</option>
+					<option id="option5b" value="2">2</option>
+					<option id="option5c" value="1" data-attr="">3</option>
+				</select>
+
+				<object id="object1" codebase="stupid">
+					<param name="p1" value="x1">
+					<param name="p2" value="x2">
+				</object>
+
+				<span id="台北Táiběi"></span>
+				<span id="台北" lang="中文"></span>
+				<span id="utf8class1" class="台北Táiběi 台北"></span>
+				<span id="utf8class2" class="台北"></span>
+				<span id="foo:bar" class="foo:bar"></span>
+				<span id="test.foo[5]bar" class="test.foo[5]bar"></span>
+				<foo_bar id="foobar">test element</foo_bar>
+			</form>
+			<b id="floatTest">Float test.</b>
+			<iframe id="iframe" name="iframe"></iframe>
+			<form id="lengthtest">
+				<input type="text" id="length" name="test">
+				<input type="text" id="idTest" name="id">
+			</form>
+			<table id="table"></table>
+
+			<form id="name-tests">
+				<!-- Inputs with a grouped name attribute. -->
+				<input name="types[]" id="types_all" type="checkbox" value="all">
+				<input name="types[]" id="types_anime" type="checkbox" value="anime">
+				<input name="types[]" id="types_movie" type="checkbox" value="movie">
+			</form>
+
+			<form id="testForm" action="#" method="get">
+				<textarea name="T3" rows="2" cols="15">?
+Z</textarea>
+				<input type="hidden" name="H1" value="x">
+				<input type="hidden" name="H2">
+				<input name="PWD" type="password" value="">
+				<input name="T1" type="text">
+				<input name="T2" type="text" value="YES" readonly="readonly">
+				<input type="checkbox" name="C1" value="1">
+				<input type="checkbox" name="C2">
+				<input type="radio" name="R1" value="1">
+				<input type="radio" name="R1" value="2">
+				<input type="text" name="My Name" value="me">
+				<input type="reset" name="reset" value="NO">
+				<select name="S1">
+					<option value="abc">ABC</option>
+					<option value="abc">ABC</option>
+					<option value="abc">ABC</option>
+				</select>
+				<select name="S2" multiple="multiple" size="3">
+					<option value="abc">ABC</option>
+					<option value="abc">ABC</option>
+					<option value="abc">ABC</option>
+				</select>
+				<select name="S3">
+					<option selected="selected">YES</option>
+				</select>
+				<select name="S4">
+					<option value="" selected="selected">NO</option>
+				</select>
+				<input type="submit" name="sub1" value="NO">
+				<input type="submit" name="sub2" value="NO">
+				<input type="image" name="sub3" value="NO">
+				<button name="sub4" type="submit" value="NO">NO</button>
+				<input name="D1" type="text" value="NO" disabled="disabled">
+				<input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO">
+				<input type="radio" name="D3" value="NO" checked="checked" disabled="disabled">
+				<select name="D4" disabled="disabled">
+					<option selected="selected" value="NO">NO</option>
+				</select>
+				<input id="list-test" type="text">
+				<datalist id="datalist">
+					<option value="option"></option>
+				</datalist>
+			</form>
+			<div id="moretests">
+				<form>
+					<div id="checkedtest" style="display:none;">
+						<input type="radio" name="checkedtestradios" checked="checked">
+						<input type="radio" name="checkedtestradios" value="on">
+						<input type="checkbox" name="checkedtestcheckboxes" checked="checked">
+						<input type="checkbox" name="checkedtestcheckboxes">
+					</div>
+				</form>
+				<div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>
+				<div id="t2037">
+					<div><div class="hidden">hidden</div></div>
+				</div>
+				<div id="t6652">
+					<div></div>
+				</div>
+				<div id="no-clone-exception"><object><embed></embed></object></div>
+			</div>
+
+			<div id="tabindex-tests">
+				<ol id="listWithTabIndex" tabindex="5">
+					<li id="foodWithNegativeTabIndex" tabindex="-1">Rice</li>
+					<li id="foodNoTabIndex">Beans</li>
+					<li>Blinis</li>
+					<li>Tofu</li>
+				</ol>
+				<div id="divWithNoTabIndex">I'm hungry. I should...</div>
+				<span>...</span><a href="#" id="linkWithNoTabIndex">Eat lots of food</a><span>...</span> |
+				<span>...</span><a href="#" id="linkWithTabIndex" tabindex="2">Eat a little food</a><span>...</span> |
+				<span>...</span><a href="#" id="linkWithNegativeTabIndex" tabindex="-1">Eat no food</a><span>...</span>
+				<span>...</span><a id="linkWithNoHrefWithNoTabIndex">Eat a burger</a><span>...</span>
+				<span>...</span><a id="linkWithNoHrefWithTabIndex" tabindex="1">Eat some funyuns</a><span>...</span>
+				<span>...</span><a id="linkWithNoHrefWithNegativeTabIndex" tabindex="-1">Eat some funyuns</a><span>...</span>
+			</div>
+
+			<div id="liveHandlerOrder">
+				<span id="liveSpan1"><a href="#" id="liveLink1"></a></span>
+				<span id="liveSpan2"><a href="#" id="liveLink2"></a></span>
+			</div>
+
+			<div id="siblingTest">
+				<em id="siblingfirst">1</em>
+				<em id="siblingnext">2</em>
+			</div>
+		</div>
+		</dl>
+		<div id="fx-test-group" style="position:absolute;width:1px;height:1px;overflow:hidden;">
+			<div id="fx-queue" name="test">
+				<div id="fadein" class='chain test' name='div'>fadeIn<div>fadeIn</div></div>
+				<div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
+
+				<div id="show" class='chain test'>show<div>show</div></div>
+				<div id="hide" class='chain test out'>hide<div>hide</div></div>
+
+				<div id="togglein" class='chain test'>togglein<div>togglein</div></div>
+				<div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div>
+
+				<div id="slideup" class='chain test'>slideUp<div>slideUp</div></div>
+				<div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div>
+
+				<div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
+				<div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
+
+				<div id="fadetogglein" class='chain test'>fadeToggleIn<div>fadeToggleIn</div></div>
+				<div id="fadetoggleout" class='chain test out'>fadeToggleOut<div>fadeToggleOut</div></div>
+
+				<div id="fadeto" class='chain test'>fadeTo<div>fadeTo</div></div>
+			</div>
+			<div id="fx-tests"></div>
+		</div>
+	</body>
+</html>

+ 1249 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/unit/core.js

@@ -0,0 +1,1249 @@
+module("core", { teardown: moduleTeardown });
+
+test("Basic requirements", function() {
+	expect(7);
+	ok( Array.prototype.push, "Array.push()" );
+	ok( Function.prototype.apply, "Function.apply()" );
+	ok( document.getElementById, "getElementById" );
+	ok( document.getElementsByTagName, "getElementsByTagName" );
+	ok( RegExp, "RegExp" );
+	ok( jQuery, "jQuery" );
+	ok( $, "$" );
+});
+
+test("jQuery()", function() {
+	expect(29);
+
+	// Basic constructor's behavior
+
+	equal( jQuery().length, 0, "jQuery() === jQuery([])" );
+	equal( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" );
+	equal( jQuery(null).length, 0, "jQuery(null) === jQuery([])" );
+	equal( jQuery("").length, 0, "jQuery('') === jQuery([])" );
+	equal( jQuery("#").length, 0, "jQuery('#') === jQuery([])" );
+
+	var obj = jQuery("div");
+	equal( jQuery(obj).selector, "div", "jQuery(jQueryObj) == jQueryObj" );
+
+		// can actually yield more than one, when iframes are included, the window is an array as well
+	equal( jQuery(window).length, 1, "Correct number of elements generated for jQuery(window)" );
+
+
+	var main = jQuery("#qunit-fixture");
+	deepEqual( jQuery("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
+
+/*
+	// disabled since this test was doing nothing. i tried to fix it but i'm not sure
+	// what the expected behavior should even be. FF returns "\n" for the text node
+	// make sure this is handled
+	var crlfContainer = jQuery('<p>\r\n</p>');
+	var x = crlfContainer.contents().get(0).nodeValue;
+	equal( x, what???, "Check for \\r and \\n in jQuery()" );
+*/
+
+	/* // Disabled until we add this functionality in
+	var pass = true;
+	try {
+		jQuery("<div>Testing</div>").appendTo(document.getElementById("iframe").contentDocument.body);
+	} catch(e){
+		pass = false;
+	}
+	ok( pass, "jQuery('&lt;tag&gt;') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );*/
+
+	var code = jQuery("<code/>");
+	equal( code.length, 1, "Correct number of elements generated for code" );
+	equal( code.parent().length, 0, "Make sure that the generated HTML has no parent." );
+	var img = jQuery("<img/>");
+	equal( img.length, 1, "Correct number of elements generated for img" );
+	equal( img.parent().length, 0, "Make sure that the generated HTML has no parent." );
+	var div = jQuery("<div/><hr/><code/><b/>");
+	equal( div.length, 4, "Correct number of elements generated for div hr code b" );
+	equal( div.parent().length, 0, "Make sure that the generated HTML has no parent." );
+
+	equal( jQuery([1,2,3]).get(1), 2, "Test passing an array to the factory" );
+
+	equal( jQuery(document.body).get(0), jQuery("body").get(0), "Test passing an html node to the factory" );
+
+	var exec = false;
+
+	var elem = jQuery("<div/>", {
+		width: 10,
+		css: { paddingLeft:1, paddingRight:1 },
+		click: function(){ ok(exec, "Click executed."); },
+		text: "test",
+		"class": "test2",
+		id: "test3"
+	});
+
+	equal( elem[0].style.width, "10px", "jQuery() quick setter width");
+	equal( elem[0].style.paddingLeft, "1px", "jQuery quick setter css");
+	equal( elem[0].style.paddingRight, "1px", "jQuery quick setter css");
+	equal( elem[0].childNodes.length, 1, "jQuery quick setter text");
+	equal( elem[0].firstChild.nodeValue, "test", "jQuery quick setter text");
+	equal( elem[0].className, "test2", "jQuery() quick setter class");
+	equal( elem[0].id, "test3", "jQuery() quick setter id");
+
+	exec = true;
+	elem.click();
+
+	// manually clean up detached elements
+	elem.remove();
+
+	for ( var i = 0; i < 3; ++i ) {
+		elem = jQuery("<input type='text' value='TEST' />");
+	}
+	equal( elem[0].defaultValue, "TEST", "Ensure cached nodes are cloned properly (Bug #6655)" );
+
+	// manually clean up detached elements
+	elem.remove();
+
+	equal( jQuery(" <div/> ").length, 1, "Make sure whitespace is trimmed." );
+	equal( jQuery(" a<div/>b ").length, 1, "Make sure whitespace and other characters are trimmed." );
+
+	var long = "";
+	for ( var i = 0; i < 128; i++ ) {
+		long += "12345678";
+	}
+
+	equal( jQuery(" <div>" + long + "</div> ").length, 1, "Make sure whitespace is trimmed on long strings." );
+	equal( jQuery(" a<div>" + long + "</div>b ").length, 1, "Make sure whitespace and other characters are trimmed on long strings." );
+});
+
+test("selector state", function() {
+	expect(31);
+
+	var test;
+
+	test = jQuery(undefined);
+	equal( test.selector, "", "Empty jQuery Selector" );
+	equal( test.context, undefined, "Empty jQuery Context" );
+
+	test = jQuery(document);
+	equal( test.selector, "", "Document Selector" );
+	equal( test.context, document, "Document Context" );
+
+	test = jQuery(document.body);
+	equal( test.selector, "", "Body Selector" );
+	equal( test.context, document.body, "Body Context" );
+
+	test = jQuery("#qunit-fixture");
+	equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" );
+	equal( test.context, document, "#qunit-fixture Context" );
+
+	test = jQuery("#notfoundnono");
+	equal( test.selector, "#notfoundnono", "#notfoundnono Selector" );
+	equal( test.context, document, "#notfoundnono Context" );
+
+	test = jQuery("#qunit-fixture", document);
+	equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" );
+	equal( test.context, document, "#qunit-fixture Context" );
+
+	test = jQuery("#qunit-fixture", document.body);
+	equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" );
+	equal( test.context, document.body, "#qunit-fixture Context" );
+
+	// Test cloning
+	test = jQuery(test);
+	equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" );
+	equal( test.context, document.body, "#qunit-fixture Context" );
+
+	test = jQuery(document.body).find("#qunit-fixture");
+	equal( test.selector, "#qunit-fixture", "#qunit-fixture find Selector" );
+	equal( test.context, document.body, "#qunit-fixture find Context" );
+
+	test = jQuery("#qunit-fixture").filter("div");
+	equal( test.selector, "#qunit-fixture.filter(div)", "#qunit-fixture filter Selector" );
+	equal( test.context, document, "#qunit-fixture filter Context" );
+
+	test = jQuery("#qunit-fixture").not("div");
+	equal( test.selector, "#qunit-fixture.not(div)", "#qunit-fixture not Selector" );
+	equal( test.context, document, "#qunit-fixture not Context" );
+
+	test = jQuery("#qunit-fixture").filter("div").not("div");
+	equal( test.selector, "#qunit-fixture.filter(div).not(div)", "#qunit-fixture filter, not Selector" );
+	equal( test.context, document, "#qunit-fixture filter, not Context" );
+
+	test = jQuery("#qunit-fixture").filter("div").not("div").end();
+	equal( test.selector, "#qunit-fixture.filter(div)", "#qunit-fixture filter, not, end Selector" );
+	equal( test.context, document, "#qunit-fixture filter, not, end Context" );
+
+	test = jQuery("#qunit-fixture").parent("body");
+	equal( test.selector, "#qunit-fixture.parent(body)", "#qunit-fixture parent Selector" );
+	equal( test.context, document, "#qunit-fixture parent Context" );
+
+	test = jQuery("#qunit-fixture").eq(0);
+	equal( test.selector, "#qunit-fixture.slice(0,1)", "#qunit-fixture eq Selector" );
+	equal( test.context, document, "#qunit-fixture eq Context" );
+
+	var d = "<div />";
+	equal(
+		jQuery(d).appendTo(jQuery(d)).selector,
+		jQuery(d).appendTo(d).selector,
+		"manipulation methods make same selector for jQuery objects"
+	);
+});
+
+test( "globalEval", function() {
+
+	expect( 3 );
+
+	jQuery.globalEval( "var globalEvalTest = true;" );
+	ok( window.globalEvalTest, "Test variable declarations are global" );
+
+	window.globalEvalTest = false;
+
+	jQuery.globalEval( "globalEvalTest = true;" );
+	ok( window.globalEvalTest, "Test variable assignments are global" );
+
+	window.globalEvalTest = false;
+
+	jQuery.globalEval( "this.globalEvalTest = true;" );
+	ok( window.globalEvalTest, "Test context (this) is the window object" );
+
+	window.globalEvalTest = undefined;
+});
+
+
+
+test("noConflict", function() {
+	expect(7);
+
+	var $$ = jQuery;
+
+	equal( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" );
+	equal( jQuery, $$, "Make sure jQuery wasn't touched." );
+	equal( $, original$, "Make sure $ was reverted." );
+
+	jQuery = $ = $$;
+
+	equal( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" );
+	equal( jQuery, originaljQuery, "Make sure jQuery was reverted." );
+	equal( $, original$, "Make sure $ was reverted." );
+	ok( $$("#qunit-fixture").html("test"), "Make sure that jQuery still works." );
+
+	jQuery = $$;
+});
+
+test("trim", function() {
+	expect(9);
+
+	var nbsp = String.fromCharCode(160);
+
+	equal( jQuery.trim("hello  "), "hello", "trailing space" );
+	equal( jQuery.trim("  hello"), "hello", "leading space" );
+	equal( jQuery.trim("  hello   "), "hello", "space on both sides" );
+	equal( jQuery.trim("  " + nbsp + "hello  " + nbsp + " "), "hello", "&nbsp;" );
+
+	equal( jQuery.trim(), "", "Nothing in." );
+	equal( jQuery.trim( undefined ), "", "Undefined" );
+	equal( jQuery.trim( null ), "", "Null" );
+	equal( jQuery.trim( 5 ), "5", "Number" );
+	equal( jQuery.trim( false ), "false", "Boolean" );
+});
+
+test("type", function() {
+	expect(23);
+
+	equal( jQuery.type(null), "null", "null" );
+	equal( jQuery.type(undefined), "undefined", "undefined" );
+	equal( jQuery.type(true), "boolean", "Boolean" );
+	equal( jQuery.type(false), "boolean", "Boolean" );
+	equal( jQuery.type(Boolean(true)), "boolean", "Boolean" );
+	equal( jQuery.type(0), "number", "Number" );
+	equal( jQuery.type(1), "number", "Number" );
+	equal( jQuery.type(Number(1)), "number", "Number" );
+	equal( jQuery.type(""), "string", "String" );
+	equal( jQuery.type("a"), "string", "String" );
+	equal( jQuery.type(String("a")), "string", "String" );
+	equal( jQuery.type({}), "object", "Object" );
+	equal( jQuery.type(/foo/), "regexp", "RegExp" );
+	equal( jQuery.type(new RegExp("asdf")), "regexp", "RegExp" );
+	equal( jQuery.type([1]), "array", "Array" );
+	equal( jQuery.type(new Date()), "date", "Date" );
+	equal( jQuery.type(new Function("return;")), "function", "Function" );
+	equal( jQuery.type(function(){}), "function", "Function" );
+	equal( jQuery.type(window), "object", "Window" );
+	equal( jQuery.type(document), "object", "Document" );
+	equal( jQuery.type(document.body), "object", "Element" );
+	equal( jQuery.type(document.createTextNode("foo")), "object", "TextNode" );
+	equal( jQuery.type(document.getElementsByTagName("*")), "object", "NodeList" );
+});
+
+test("isPlainObject", function() {
+	expect(15);
+
+	stop();
+
+	// The use case that we want to match
+	ok(jQuery.isPlainObject({}), "{}");
+
+	// Not objects shouldn't be matched
+	ok(!jQuery.isPlainObject(""), "string");
+	ok(!jQuery.isPlainObject(0) && !jQuery.isPlainObject(1), "number");
+	ok(!jQuery.isPlainObject(true) && !jQuery.isPlainObject(false), "boolean");
+	ok(!jQuery.isPlainObject(null), "null");
+	ok(!jQuery.isPlainObject(undefined), "undefined");
+
+	// Arrays shouldn't be matched
+	ok(!jQuery.isPlainObject([]), "array");
+
+	// Instantiated objects shouldn't be matched
+	ok(!jQuery.isPlainObject(new Date), "new Date");
+
+	var fn = function(){};
+
+	// Functions shouldn't be matched
+	ok(!jQuery.isPlainObject(fn), "fn");
+
+	// Again, instantiated objects shouldn't be matched
+	ok(!jQuery.isPlainObject(new fn), "new fn (no methods)");
+
+	// Makes the function a little more realistic
+	// (and harder to detect, incidentally)
+	fn.prototype = {someMethod: function(){}};
+
+	// Again, instantiated objects shouldn't be matched
+	ok(!jQuery.isPlainObject(new fn), "new fn");
+
+	// DOM Element
+	ok(!jQuery.isPlainObject(document.createElement("div")), "DOM Element");
+
+	// Window
+	ok(!jQuery.isPlainObject(window), "window");
+
+	try {
+		jQuery.isPlainObject( window.location );
+		ok( true, "Does not throw exceptions on host objects");
+	} catch ( e ) {
+		ok( false, "Does not throw exceptions on host objects -- FAIL");
+	}
+
+	try {
+		var iframe = document.createElement("iframe");
+		document.body.appendChild(iframe);
+
+		window.iframeDone = function(otherObject){
+			// Objects from other windows should be matched
+			ok(jQuery.isPlainObject(new otherObject), "new otherObject");
+			document.body.removeChild( iframe );
+			start();
+		};
+
+		var doc = iframe.contentDocument || iframe.contentWindow.document;
+		doc.open();
+		doc.write("<body onload='window.parent.iframeDone(Object);'>");
+		doc.close();
+	} catch(e) {
+		document.body.removeChild( iframe );
+
+		ok(true, "new otherObject - iframes not supported");
+		start();
+	}
+});
+
+test("isFunction", function() {
+	expect(19);
+
+	// Make sure that false values return false
+	ok( !jQuery.isFunction(), "No Value" );
+	ok( !jQuery.isFunction( null ), "null Value" );
+	ok( !jQuery.isFunction( undefined ), "undefined Value" );
+	ok( !jQuery.isFunction( "" ), "Empty String Value" );
+	ok( !jQuery.isFunction( 0 ), "0 Value" );
+
+	// Check built-ins
+	// Safari uses "(Internal Function)"
+	ok( jQuery.isFunction(String), "String Function("+String+")" );
+	ok( jQuery.isFunction(Array), "Array Function("+Array+")" );
+	ok( jQuery.isFunction(Object), "Object Function("+Object+")" );
+	ok( jQuery.isFunction(Function), "Function Function("+Function+")" );
+
+	// When stringified, this could be misinterpreted
+	var mystr = "function";
+	ok( !jQuery.isFunction(mystr), "Function String" );
+
+	// When stringified, this could be misinterpreted
+	var myarr = [ "function" ];
+	ok( !jQuery.isFunction(myarr), "Function Array" );
+
+	// When stringified, this could be misinterpreted
+	var myfunction = { "function": "test" };
+	ok( !jQuery.isFunction(myfunction), "Function Object" );
+
+	// Make sure normal functions still work
+	var fn = function(){};
+	ok( jQuery.isFunction(fn), "Normal Function" );
+
+	var obj = document.createElement("object");
+
+	// Firefox says this is a function
+	ok( !jQuery.isFunction(obj), "Object Element" );
+
+	// IE says this is an object
+	// Since 1.3, this isn't supported (#2968)
+	//ok( jQuery.isFunction(obj.getAttribute), "getAttribute Function" );
+
+	var nodes = document.body.childNodes;
+
+	// Safari says this is a function
+	ok( !jQuery.isFunction(nodes), "childNodes Property" );
+
+	var first = document.body.firstChild;
+
+	// Normal elements are reported ok everywhere
+	ok( !jQuery.isFunction(first), "A normal DOM Element" );
+
+	var input = document.createElement("input");
+	input.type = "text";
+	document.body.appendChild( input );
+
+	// IE says this is an object
+	// Since 1.3, this isn't supported (#2968)
+	//ok( jQuery.isFunction(input.focus), "A default function property" );
+
+	document.body.removeChild( input );
+
+	var a = document.createElement("a");
+	a.href = "some-function";
+	document.body.appendChild( a );
+
+	// This serializes with the word 'function' in it
+	ok( !jQuery.isFunction(a), "Anchor Element" );
+
+	document.body.removeChild( a );
+
+	// Recursive function calls have lengths and array-like properties
+	function callme(callback){
+		function fn(response){
+			callback(response);
+		}
+
+		ok( jQuery.isFunction(fn), "Recursive Function Call" );
+
+		fn({ some: "data" });
+	};
+
+	callme(function(){
+		callme(function(){});
+	});
+});
+
+test( "isNumeric", function() {
+	expect( 37 );
+
+	var t = jQuery.isNumeric,
+		Traditionalists = function(n) {
+			this.value = n;
+			this.toString = function(){
+				return String(this.value);
+			};
+		},
+		answer = new Traditionalists( "42" ),
+		rong = new Traditionalists( "Devo" );
+
+	ok( t("-10"), "Negative integer string");
+	ok( t("0"), "Zero string");
+	ok( t("5"), "Positive integer string");
+	ok( t(-16), "Negative integer number");
+	ok( t(0), "Zero integer number");
+	ok( t(32), "Positive integer number");
+	ok( t("040"), "Octal integer literal string");
+	ok( t(0144), "Octal integer literal");
+	ok( t("0xFF"), "Hexadecimal integer literal string");
+	ok( t(0xFFF), "Hexadecimal integer literal");
+	ok( t("-1.6"), "Negative floating point string");
+	ok( t("4.536"), "Positive floating point string");
+	ok( t(-2.6), "Negative floating point number");
+	ok( t(3.1415), "Positive floating point number");
+	ok( t(8e5), "Exponential notation");
+	ok( t("123e-2"), "Exponential notation string");
+	ok( t(answer), "Custom .toString returning number");
+	equal( t(""), false, "Empty string");
+	equal( t("        "), false, "Whitespace characters string");
+	equal( t("\t\t"), false, "Tab characters string");
+	equal( t("abcdefghijklm1234567890"), false, "Alphanumeric character string");
+	equal( t("xabcdefx"), false, "Non-numeric character string");
+	equal( t(true), false, "Boolean true literal");
+	equal( t(false), false, "Boolean false literal");
+	equal( t("bcfed5.2"), false, "Number with preceding non-numeric characters");
+	equal( t("7.2acdgs"), false, "Number with trailling non-numeric characters");
+	equal( t(undefined), false, "Undefined value");
+	equal( t(null), false, "Null value");
+	equal( t(NaN), false, "NaN value");
+	equal( t(Infinity), false, "Infinity primitive");
+	equal( t(Number.POSITIVE_INFINITY), false, "Positive Infinity");
+	equal( t(Number.NEGATIVE_INFINITY), false, "Negative Infinity");
+	equal( t(rong), false, "Custom .toString returning non-number");
+	equal( t({}), false, "Empty object");
+	equal( t(function(){} ), false, "Instance of a function");
+	equal( t( new Date ), false, "Instance of a Date");
+	equal( t(function(){} ), false, "Instance of a function");
+});
+
+test("isXMLDoc - HTML", function() {
+	expect(4);
+
+	ok( !jQuery.isXMLDoc( document ), "HTML document" );
+	ok( !jQuery.isXMLDoc( document.documentElement ), "HTML documentElement" );
+	ok( !jQuery.isXMLDoc( document.body ), "HTML Body Element" );
+
+	var iframe = document.createElement("iframe");
+	document.body.appendChild( iframe );
+
+	try {
+		var body = jQuery(iframe).contents()[0];
+
+		try {
+			ok( !jQuery.isXMLDoc( body ), "Iframe body element" );
+		} catch(e) {
+			ok( false, "Iframe body element exception" );
+		}
+
+	} catch(e) {
+		ok( true, "Iframe body element - iframe not working correctly" );
+	}
+
+	document.body.removeChild( iframe );
+});
+
+test("XSS via location.hash", function() {
+	expect(1);
+
+	stop();
+	jQuery._check9521 = function(x){
+		ok( x, "script called from #id-like selector with inline handler" );
+		jQuery("#check9521").remove();
+		delete jQuery._check9521;
+		start();
+	};
+	try {
+		// This throws an error because it's processed like an id
+		jQuery( '#<img id="check9521" src="no-such-.gif" onerror="jQuery._check9521(false)">' ).appendTo("#qunit-fixture");
+	} catch (err) {
+		jQuery._check9521(true);
+	};
+});
+
+if ( !isLocal ) {
+test("isXMLDoc - XML", function() {
+	expect(3);
+	stop();
+	jQuery.get("data/dashboard.xml", function(xml) {
+		ok( jQuery.isXMLDoc( xml ), "XML document" );
+		ok( jQuery.isXMLDoc( xml.documentElement ), "XML documentElement" );
+		ok( jQuery.isXMLDoc( jQuery("tab", xml)[0] ), "XML Tab Element" );
+		start();
+	});
+});
+}
+
+test("isWindow", function() {
+	expect( 12 );
+
+	ok( jQuery.isWindow(window), "window" );
+	ok( !jQuery.isWindow(), "empty" );
+	ok( !jQuery.isWindow(null), "null" );
+	ok( !jQuery.isWindow(undefined), "undefined" );
+	ok( !jQuery.isWindow(document), "document" );
+	ok( !jQuery.isWindow(document.documentElement), "documentElement" );
+	ok( !jQuery.isWindow(""), "string" );
+	ok( !jQuery.isWindow(1), "number" );
+	ok( !jQuery.isWindow(true), "boolean" );
+	ok( !jQuery.isWindow({}), "object" );
+	// HMMM
+	// ok( !jQuery.isWindow({ setInterval: function(){} }), "fake window" );
+	ok( !jQuery.isWindow(/window/), "regexp" );
+	ok( !jQuery.isWindow(function(){}), "function" );
+});
+
+test("jQuery('html')", function() {
+	expect(18);
+
+	QUnit.reset();
+	jQuery.foo = false;
+	var s = jQuery("<script>jQuery.foo='test';</script>")[0];
+	ok( s, "Creating a script" );
+	ok( !jQuery.foo, "Make sure the script wasn't executed prematurely" );
+	jQuery("body").append("<script>jQuery.foo='test';</script>");
+	ok( jQuery.foo, "Executing a scripts contents in the right context" );
+
+	// Test multi-line HTML
+	var div = jQuery("<div>\r\nsome text\n<p>some p</p>\nmore text\r\n</div>")[0];
+	equal( div.nodeName.toUpperCase(), "DIV", "Make sure we're getting a div." );
+	equal( div.firstChild.nodeType, 3, "Text node." );
+	equal( div.lastChild.nodeType, 3, "Text node." );
+	equal( div.childNodes[1].nodeType, 1, "Paragraph." );
+	equal( div.childNodes[1].firstChild.nodeType, 3, "Paragraph text." );
+
+	QUnit.reset();
+	ok( jQuery("<link rel='stylesheet'/>")[0], "Creating a link" );
+
+	ok( !jQuery("<script/>")[0].parentNode, "Create a script" );
+
+	ok( jQuery("<input/>").attr("type", "hidden"), "Create an input and set the type." );
+
+	var j = jQuery("<span>hi</span> there <!-- mon ami -->");
+	ok( j.length >= 2, "Check node,textnode,comment creation (some browsers delete comments)" );
+
+	ok( !jQuery("<option>test</option>")[0].selected, "Make sure that options are auto-selected #2050" );
+
+	ok( jQuery("<div></div>")[0], "Create a div with closing tag." );
+	ok( jQuery("<table></table>")[0], "Create a table with closing tag." );
+
+	// Test very large html string #7990
+	var i;
+	var li = "<li>very large html string</li>";
+	var html = ["<ul>"];
+	for ( i = 0; i < 50000; i += 1 ) {
+		html.push(li);
+	}
+	html.push("</ul>");
+	html = jQuery(html.join(""))[0];
+	equal( html.nodeName.toUpperCase(), "UL");
+	equal( html.firstChild.nodeName.toUpperCase(), "LI");
+	equal( html.childNodes.length, 50000 );
+});
+
+test("jQuery('html', context)", function() {
+	expect(1);
+
+	var $div = jQuery("<div/>")[0];
+	var $span = jQuery("<span/>", $div);
+	equal($span.length, 1, "Verify a span created with a div context works, #1763");
+});
+
+if ( !isLocal ) {
+test("jQuery(selector, xml).text(str) - Loaded via XML document", function() {
+	expect(2);
+	stop();
+	jQuery.get("data/dashboard.xml", function(xml) {
+		// tests for #1419 where IE was a problem
+		var tab = jQuery("tab", xml).eq(0);
+		equal( tab.text(), "blabla", "Verify initial text correct" );
+		tab.text("newtext");
+		equal( tab.text(), "newtext", "Verify new text correct" );
+		start();
+	});
+});
+}
+
+test("end()", function() {
+	expect(3);
+	equal( "Yahoo", jQuery("#yahoo").parent().end().text(), "Check for end" );
+	ok( jQuery("#yahoo").end(), "Check for end with nothing to end" );
+
+	var x = jQuery("#yahoo");
+	x.parent();
+	equal( "Yahoo", jQuery("#yahoo").text(), "Check for non-destructive behaviour" );
+});
+
+test("length", function() {
+	expect(1);
+	equal( jQuery("#qunit-fixture p").length, 6, "Get Number of Elements Found" );
+});
+
+test("size()", function() {
+	expect(1);
+	equal( jQuery("#qunit-fixture p").size(), 6, "Get Number of Elements Found" );
+});
+
+test("get()", function() {
+	expect(1);
+	deepEqual( jQuery("#qunit-fixture p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" );
+});
+
+test("toArray()", function() {
+	expect(1);
+	deepEqual( jQuery("#qunit-fixture p").toArray(),
+		q("firstp","ap","sndp","en","sap","first"),
+		"Convert jQuery object to an Array" )
+})
+
+test("inArray()", function() {
+	expect(19);
+
+	var selections = {
+		p:   q("firstp", "sap", "ap", "first"),
+		em:  q("siblingnext", "siblingfirst"),
+		div: q("qunit-testrunner-toolbar", "nothiddendiv", "nothiddendivchild", "foo"),
+		a:   q("mark", "groups", "google", "simon1"),
+		empty: []
+	},
+	tests = {
+		p:    { elem: jQuery("#ap")[0],           index: 2 },
+		em:   { elem: jQuery("#siblingfirst")[0], index: 1 },
+		div:  { elem: jQuery("#nothiddendiv")[0], index: 1 },
+		a:    { elem: jQuery("#simon1")[0],       index: 3 }
+	},
+	falseTests = {
+		p:  jQuery("#liveSpan1")[0],
+		em: jQuery("#nothiddendiv")[0],
+		empty: ""
+	};
+
+	jQuery.each( tests, function( key, obj ) {
+		equal( jQuery.inArray( obj.elem, selections[ key ] ), obj.index, "elem is in the array of selections of its tag" );
+		// Third argument (fromIndex)
+		equal( !!~jQuery.inArray( obj.elem, selections[ key ], 5 ), false, "elem is NOT in the array of selections given a starting index greater than its position" );
+		equal( !!~jQuery.inArray( obj.elem, selections[ key ], 1 ), true, "elem is in the array of selections given a starting index less than or equal to its position" );
+		equal( !!~jQuery.inArray( obj.elem, selections[ key ], -3 ), true, "elem is in the array of selections given a negative index" );
+	});
+
+	jQuery.each( falseTests, function( key, elem ) {
+		equal( !!~jQuery.inArray( elem, selections[ key ] ), false, "elem is NOT in the array of selections" );
+	});
+
+});
+
+test("get(Number)", function() {
+	expect(2);
+	equal( jQuery("#qunit-fixture p").get(0), document.getElementById("firstp"), "Get A Single Element" );
+	strictEqual( jQuery("#firstp").get(1), undefined, "Try get with index larger elements count" );
+});
+
+test("get(-Number)",function() {
+	expect(2);
+	equal( jQuery("p").get(-1), document.getElementById("first"), "Get a single element with negative index" );
+	strictEqual( jQuery("#firstp").get(-2), undefined, "Try get with index negative index larger then elements count" );
+})
+
+test("each(Function)", function() {
+	expect(1);
+	var div = jQuery("div");
+	div.each(function(){this.foo = "zoo";});
+	var pass = true;
+	for ( var i = 0; i < div.size(); i++ ) {
+		if ( div.get(i).foo != "zoo" ) pass = false;
+	}
+	ok( pass, "Execute a function, Relative" );
+});
+
+test("slice()", function() {
+	expect(7);
+
+	var $links = jQuery("#ap a");
+
+	deepEqual( $links.slice(1,2).get(), q("groups"), "slice(1,2)" );
+	deepEqual( $links.slice(1).get(), q("groups", "anchor1", "mark"), "slice(1)" );
+	deepEqual( $links.slice(0,3).get(), q("google", "groups", "anchor1"), "slice(0,3)" );
+	deepEqual( $links.slice(-1).get(), q("mark"), "slice(-1)" );
+
+	deepEqual( $links.eq(1).get(), q("groups"), "eq(1)" );
+	deepEqual( $links.eq("2").get(), q("anchor1"), "eq('2')" );
+	deepEqual( $links.eq(-1).get(), q("mark"), "eq(-1)" );
+});
+
+test("first()/last()", function() {
+	expect(4);
+
+	var $links = jQuery("#ap a"), $none = jQuery("asdf");
+
+	deepEqual( $links.first().get(), q("google"), "first()" );
+	deepEqual( $links.last().get(), q("mark"), "last()" );
+
+	deepEqual( $none.first().get(), [], "first() none" );
+	deepEqual( $none.last().get(), [], "last() none" );
+});
+
+test("map()", function() {
+	expect(8);
+
+	deepEqual(
+		jQuery("#ap").map(function(){
+			return jQuery(this).find("a").get();
+		}).get(),
+		q("google", "groups", "anchor1", "mark"),
+		"Array Map"
+	);
+
+	deepEqual(
+		jQuery("#ap > a").map(function(){
+			return this.parentNode;
+		}).get(),
+		q("ap","ap","ap"),
+		"Single Map"
+	);
+
+	//for #2616
+	var keys = jQuery.map( {a:1,b:2}, function( v, k ){
+		return k;
+	});
+	equal( keys.join(""), "ab", "Map the keys from a hash to an array" );
+
+	var values = jQuery.map( {a:1,b:2}, function( v, k ){
+		return v;
+	});
+	equal( values.join(""), "12", "Map the values from a hash to an array" );
+
+	// object with length prop
+	var values = jQuery.map( {a:1,b:2, length:3}, function( v, k ){
+		return v;
+	});
+	equal( values.join(""), "123", "Map the values from a hash with a length property to an array" );
+
+	var scripts = document.getElementsByTagName("script");
+	var mapped = jQuery.map( scripts, function( v, k ){
+		return v;
+	});
+	equal( mapped.length, scripts.length, "Map an array(-like) to a hash" );
+
+	var nonsense = document.getElementsByTagName("asdf");
+	var mapped = jQuery.map( nonsense, function( v, k ){
+		return v;
+	});
+	equal( mapped.length, nonsense.length, "Map an empty array(-like) to a hash" );
+
+	var flat = jQuery.map( Array(4), function( v, k ){
+		return k % 2 ? k : [k,k,k];//try mixing array and regular returns
+	});
+	equal( flat.join(""), "00012223", "try the new flatten technique(#2616)" );
+});
+
+test("jQuery.merge()", function() {
+	expect(8);
+
+	var parse = jQuery.merge;
+
+	deepEqual( parse([],[]), [], "Empty arrays" );
+
+	deepEqual( parse([1],[2]), [1,2], "Basic" );
+	deepEqual( parse([1,2],[3,4]), [1,2,3,4], "Basic" );
+
+	deepEqual( parse([1,2],[]), [1,2], "Second empty" );
+	deepEqual( parse([],[1,2]), [1,2], "First empty" );
+
+	// Fixed at [5998], #3641
+	deepEqual( parse([-2,-1], [0,1,2]), [-2,-1,0,1,2], "Second array including a zero (falsy)");
+
+	// After fixing #5527
+	deepEqual( parse([], [null, undefined]), [null, undefined], "Second array including null and undefined values");
+	deepEqual( parse({length:0}, [1,2]), {length:2, 0:1, 1:2}, "First array like");
+});
+
+test("jQuery.extend(Object, Object)", function() {
+	expect(28);
+
+	var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+		options = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
+		optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" },
+		merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" },
+		deep1 = { foo: { bar: true } },
+		deep1copy = { foo: { bar: true } },
+		deep2 = { foo: { baz: true }, foo2: document },
+		deep2copy = { foo: { baz: true }, foo2: document },
+		deepmerged = { foo: { bar: true, baz: true }, foo2: document },
+		arr = [1, 2, 3],
+		nestedarray = { arr: arr };
+
+	jQuery.extend(settings, options);
+	deepEqual( settings, merged, "Check if extended: settings must be extended" );
+	deepEqual( options, optionsCopy, "Check if not modified: options must not be modified" );
+
+	jQuery.extend(settings, null, options);
+	deepEqual( settings, merged, "Check if extended: settings must be extended" );
+	deepEqual( options, optionsCopy, "Check if not modified: options must not be modified" );
+
+	jQuery.extend(true, deep1, deep2);
+	deepEqual( deep1.foo, deepmerged.foo, "Check if foo: settings must be extended" );
+	deepEqual( deep2.foo, deep2copy.foo, "Check if not deep2: options must not be modified" );
+	equal( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" );
+
+	ok( jQuery.extend(true, {}, nestedarray).arr !== arr, "Deep extend of object must clone child array" );
+
+	// #5991
+	ok( jQuery.isArray( jQuery.extend(true, { arr: {} }, nestedarray).arr ), "Cloned array heve to be an Array" );
+	ok( jQuery.isPlainObject( jQuery.extend(true, { arr: arr }, { arr: {} }).arr ), "Cloned object heve to be an plain object" );
+
+	var empty = {};
+	var optionsWithLength = { foo: { length: -1 } };
+	jQuery.extend(true, empty, optionsWithLength);
+	deepEqual( empty.foo, optionsWithLength.foo, "The length property must copy correctly" );
+
+	empty = {};
+	var optionsWithDate = { foo: { date: new Date } };
+	jQuery.extend(true, empty, optionsWithDate);
+	deepEqual( empty.foo, optionsWithDate.foo, "Dates copy correctly" );
+
+	var myKlass = function() {};
+	var customObject = new myKlass();
+	var optionsWithCustomObject = { foo: { date: customObject } };
+	empty = {};
+	jQuery.extend(true, empty, optionsWithCustomObject);
+	ok( empty.foo && empty.foo.date === customObject, "Custom objects copy correctly (no methods)" );
+
+	// Makes the class a little more realistic
+	myKlass.prototype = { someMethod: function(){} };
+	empty = {};
+	jQuery.extend(true, empty, optionsWithCustomObject);
+	ok( empty.foo && empty.foo.date === customObject, "Custom objects copy correctly" );
+
+	var ret = jQuery.extend(true, { foo: 4 }, { foo: new Number(5) } );
+	ok( ret.foo == 5, "Wrapped numbers copy correctly" );
+
+	var nullUndef;
+	nullUndef = jQuery.extend({}, options, { xnumber2: null });
+	ok( nullUndef.xnumber2 === null, "Check to make sure null values are copied");
+
+	nullUndef = jQuery.extend({}, options, { xnumber2: undefined });
+	ok( nullUndef.xnumber2 === options.xnumber2, "Check to make sure undefined values are not copied");
+
+	nullUndef = jQuery.extend({}, options, { xnumber0: null });
+	ok( nullUndef.xnumber0 === null, "Check to make sure null values are inserted");
+
+	var target = {};
+	var recursive = { foo:target, bar:5 };
+	jQuery.extend(true, target, recursive);
+	deepEqual( target, { bar:5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" );
+
+	var ret = jQuery.extend(true, { foo: [] }, { foo: [0] } ); // 1907
+	equal( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" );
+
+	var ret = jQuery.extend(true, { foo: "1,2,3" }, { foo: [1, 2, 3] } );
+	ok( typeof ret.foo != "string", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" );
+
+	var ret = jQuery.extend(true, { foo:"bar" }, { foo:null } );
+	ok( typeof ret.foo !== "undefined", "Make sure a null value doesn't crash with deep extend, for #1908" );
+
+	var obj = { foo:null };
+	jQuery.extend(true, obj, { foo:"notnull" } );
+	equal( obj.foo, "notnull", "Make sure a null value can be overwritten" );
+
+	function func() {}
+	jQuery.extend(func, { key: "value" } );
+	equal( func.key, "value", "Verify a function can be extended" );
+
+	var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+		defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+		options1 = { xnumber2: 1, xstring2: "x" },
+		options1Copy = { xnumber2: 1, xstring2: "x" },
+		options2 = { xstring2: "xx", xxx: "newstringx" },
+		options2Copy = { xstring2: "xx", xxx: "newstringx" },
+		merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" };
+
+	var settings = jQuery.extend({}, defaults, options1, options2);
+	deepEqual( settings, merged2, "Check if extended: settings must be extended" );
+	deepEqual( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" );
+	deepEqual( options1, options1Copy, "Check if not modified: options1 must not be modified" );
+	deepEqual( options2, options2Copy, "Check if not modified: options2 must not be modified" );
+});
+
+test("jQuery.each(Object,Function)", function() {
+	expect(14);
+	jQuery.each( [0,1,2], function(i, n){
+		equal( i, n, "Check array iteration" );
+	});
+
+	jQuery.each( [5,6,7], function(i, n){
+		equal( i, n - 5, "Check array iteration" );
+	});
+
+	jQuery.each( { name: "name", lang: "lang" }, function(i, n){
+		equal( i, n, "Check object iteration" );
+	});
+
+	var total = 0;
+	jQuery.each([1,2,3], function(i,v){ total += v; });
+	equal( total, 6, "Looping over an array" );
+	total = 0;
+	jQuery.each([1,2,3], function(i,v){ total += v; if ( i == 1 ) return false; });
+	equal( total, 3, "Looping over an array, with break" );
+	total = 0;
+	jQuery.each({"a":1,"b":2,"c":3}, function(i,v){ total += v; });
+	equal( total, 6, "Looping over an object" );
+	total = 0;
+	jQuery.each({"a":3,"b":3,"c":3}, function(i,v){ total += v; return false; });
+	equal( total, 3, "Looping over an object, with break" );
+
+	var f = function(){};
+	f.foo = "bar";
+	jQuery.each(f, function(i){
+		f[i] = "baz";
+	});
+	equal( "baz", f.foo, "Loop over a function" );
+
+	var stylesheet_count = 0;
+	jQuery.each(document.styleSheets, function(i){
+		stylesheet_count++;
+	});
+	//html5shiv may add 1-2 stylesheets
+	ok(stylesheet_count > 1 && stylesheet_count < 5, "should not throw an error in IE while looping over document.styleSheets and return proper amount");
+
+});
+
+test("jQuery.makeArray", function(){
+	expect(17);
+
+	equal( jQuery.makeArray(jQuery("html>*"))[0].nodeName.toUpperCase(), "HEAD", "Pass makeArray a jQuery object" );
+
+	equal( jQuery.makeArray(document.getElementsByName("PWD")).slice(0,1)[0].name, "PWD", "Pass makeArray a nodelist" );
+
+	equal( (function(){ return jQuery.makeArray(arguments); })(1,2).join(""), "12", "Pass makeArray an arguments array" );
+
+	equal( jQuery.makeArray([1,2,3]).join(""), "123", "Pass makeArray a real array" );
+
+	equal( jQuery.makeArray().length, 0, "Pass nothing to makeArray and expect an empty array" );
+
+	equal( jQuery.makeArray( 0 )[0], 0 , "Pass makeArray a number" );
+
+	equal( jQuery.makeArray( "foo" )[0], "foo", "Pass makeArray a string" );
+
+	equal( jQuery.makeArray( true )[0].constructor, Boolean, "Pass makeArray a boolean" );
+
+	equal( jQuery.makeArray( document.createElement("div") )[0].nodeName.toUpperCase(), "DIV", "Pass makeArray a single node" );
+
+	equal( jQuery.makeArray( {length:2, 0:"a", 1:"b"} ).join(""), "ab", "Pass makeArray an array like map (with length)" );
+
+	ok( !!jQuery.makeArray( document.documentElement.childNodes ).slice(0,1)[0].nodeName, "Pass makeArray a childNodes array" );
+
+	// function, is tricky as it has length
+	equal( jQuery.makeArray( function(){ return 1;} )[0](), 1, "Pass makeArray a function" );
+
+	//window, also has length
+	equal( jQuery.makeArray(window)[0], window, "Pass makeArray the window" );
+
+	equal( jQuery.makeArray(/a/)[0].constructor, RegExp, "Pass makeArray a regex" );
+
+	ok( jQuery.makeArray(document.getElementById("form")).length >= 13, "Pass makeArray a form (treat as elements)" );
+
+	// For #5610
+	deepEqual( jQuery.makeArray({length: "0"}), [], "Make sure object is coerced properly.");
+	deepEqual( jQuery.makeArray({length: "5"}), [], "Make sure object is coerced properly.");
+});
+
+test("jQuery.inArray", function(){
+	expect(3);
+
+	equal( jQuery.inArray( 0, false ), -1 , "Search in 'false' as array returns -1 and doesn't throw exception" );
+
+	equal( jQuery.inArray( 0, null ), -1 , "Search in 'null' as array returns -1 and doesn't throw exception" );
+
+	equal( jQuery.inArray( 0, undefined ), -1 , "Search in 'undefined' as array returns -1 and doesn't throw exception" );
+});
+
+test("jQuery.isEmptyObject", function(){
+	expect(2);
+
+	equal(true, jQuery.isEmptyObject({}), "isEmptyObject on empty object literal" );
+	equal(false, jQuery.isEmptyObject({a:1}), "isEmptyObject on non-empty object literal" );
+
+	// What about this ?
+	// equal(true, jQuery.isEmptyObject(null), "isEmptyObject on null" );
+});
+
+test("jQuery.proxy", function(){
+	expect(7);
+
+	var test = function(){ equal( this, thisObject, "Make sure that scope is set properly." ); };
+	var thisObject = { foo: "bar", method: test };
+
+	// Make sure normal works
+	test.call( thisObject );
+
+	// Basic scoping
+	jQuery.proxy( test, thisObject )();
+
+	// Another take on it
+	jQuery.proxy( thisObject, "method" )();
+
+	// Make sure it doesn't freak out
+	equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." );
+
+        // Partial application
+        var test2 = function( a ){ equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); };
+        jQuery.proxy( test2, null, "pre-applied" )();
+
+        // Partial application w/ normal arguments
+        var test3 = function( a, b ){ equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); };
+        jQuery.proxy( test3, null, "pre-applied" )( "normal" );
+
+	// Test old syntax
+	var test4 = { meth: function( a ){ equal( a, "boom", "Ensure old syntax works." ); } };
+	jQuery.proxy( test4, "meth" )( "boom" );
+});
+
+test("jQuery.parseJSON", function(){
+	expect(8);
+
+	equal( jQuery.parseJSON(), null, "Nothing in, null out." );
+	equal( jQuery.parseJSON( null ), null, "Nothing in, null out." );
+	equal( jQuery.parseJSON( "" ), null, "Nothing in, null out." );
+
+	deepEqual( jQuery.parseJSON("{}"), {}, "Plain object parsing." );
+	deepEqual( jQuery.parseJSON("{\"test\":1}"), {"test":1}, "Plain object parsing." );
+
+	deepEqual( jQuery.parseJSON("\n{\"test\":1}"), {"test":1}, "Make sure leading whitespaces are handled." );
+
+	try {
+		jQuery.parseJSON("{a:1}");
+		ok( false, "Test malformed JSON string." );
+	} catch( e ) {
+		ok( true, "Test malformed JSON string." );
+	}
+
+	try {
+		jQuery.parseJSON("{'a':1}");
+		ok( false, "Test malformed JSON string." );
+	} catch( e ) {
+		ok( true, "Test malformed JSON string." );
+	}
+});
+
+test("jQuery.parseXML", 4, function(){
+	var xml, tmp;
+	try {
+		xml = jQuery.parseXML( "<p>A <b>well-formed</b> xml string</p>" );
+		tmp = xml.getElementsByTagName( "p" )[ 0 ];
+		ok( !!tmp, "<p> present in document" );
+		tmp = tmp.getElementsByTagName( "b" )[ 0 ];
+		ok( !!tmp, "<b> present in document" );
+		strictEqual( tmp.childNodes[ 0 ].nodeValue, "well-formed", "<b> text is as expected" );
+	} catch (e) {
+		strictEqual( e, undefined, "unexpected error" );
+	}
+	try {
+		xml = jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" );
+		ok( false, "invalid xml not detected" );
+	} catch( e ) {
+		strictEqual( e.message, "Invalid XML: <p>Not a <<b>well-formed</b> xml string</p>", "invalid xml detected" );
+	}
+});
+
+test("jQuery.sub() - Static Methods", function(){
+    expect(18);
+    var Subclass = jQuery.sub();
+    Subclass.extend({
+        topLevelMethod: function() {return this.debug;},
+        debug: false,
+        config: {
+            locale: "en_US"
+        },
+        setup: function(config) {
+            this.extend(true, this.config, config);
+        }
+    });
+    Subclass.fn.extend({subClassMethod: function() { return this;}});
+
+    //Test Simple Subclass
+    ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
+    ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
+    deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
+    equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
+
+    //Create a SubSubclass
+    var SubSubclass = Subclass.sub();
+
+    //Make Sure the SubSubclass inherited properly
+    ok(SubSubclass.topLevelMethod() === false, "SubSubclass.topLevelMethod thought debug was true");
+    ok(SubSubclass.config.locale == "en_US", SubSubclass.config.locale + " is wrong!");
+    deepEqual(SubSubclass.config.test, undefined, "SubSubclass.config.test is set incorrectly");
+    equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
+
+    //Modify The Subclass and test the Modifications
+    SubSubclass.fn.extend({subSubClassMethod: function() { return this;}});
+    SubSubclass.setup({locale: "es_MX", test: "worked"});
+    SubSubclass.debug = true;
+    SubSubclass.ajax = function() {return false;};
+    ok(SubSubclass.topLevelMethod(), "SubSubclass.topLevelMethod thought debug was false");
+    deepEqual(SubSubclass(document).subClassMethod, Subclass.fn.subClassMethod, "Methods Differ!");
+    ok(SubSubclass.config.locale == "es_MX", SubSubclass.config.locale + " is wrong!");
+    ok(SubSubclass.config.test == "worked", "SubSubclass.config.test is set incorrectly");
+    notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods");
+
+    //This shows that the modifications to the SubSubClass did not bubble back up to it's superclass
+    ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true");
+    ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!");
+    deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly");
+    deepEqual(Subclass(document).subSubClassMethod, undefined, "subSubClassMethod set incorrectly");
+    equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods");
+});
+
+test("jQuery.sub() - .fn Methods", function(){
+	expect(378);
+
+	var Subclass = jQuery.sub(),
+			SubclassSubclass = Subclass.sub(),
+			jQueryDocument = jQuery(document),
+			selectors, contexts, methods, method, arg, description;
+
+	jQueryDocument.toString = function(){ return "jQueryDocument"; };
+
+	Subclass.fn.subclassMethod = function(){};
+	SubclassSubclass.fn.subclassSubclassMethod = function(){};
+
+	selectors = [
+		"body",
+		"html, body",
+		"<div></div>"
+	];
+
+	methods = [ // all methods that return a new jQuery instance
+		["eq", 1],
+		["add", document],
+		["end"],
+		["has"],
+		["closest", "div"],
+		["filter", document],
+		["find", "div"]
+	];
+
+	contexts = [undefined, document, jQueryDocument];
+
+	jQuery.each(selectors, function(i, selector){
+
+		jQuery.each(methods, function(){
+			method = this[0];
+			arg = this[1];
+
+			jQuery.each(contexts, function(i, context){
+
+				description = "(\""+selector+"\", "+context+")."+method+"("+(arg||"")+")";
+
+				deepEqual(
+					jQuery(selector, context)[method](arg).subclassMethod, undefined,
+					"jQuery"+description+" doesn't have Subclass methods"
+				);
+				deepEqual(
+					jQuery(selector, context)[method](arg).subclassSubclassMethod, undefined,
+					"jQuery"+description+" doesn't have SubclassSubclass methods"
+				);
+				deepEqual(
+					Subclass(selector, context)[method](arg).subclassMethod, Subclass.fn.subclassMethod,
+					"Subclass"+description+" has Subclass methods"
+				);
+				deepEqual(
+					Subclass(selector, context)[method](arg).subclassSubclassMethod, undefined,
+					"Subclass"+description+" doesn't have SubclassSubclass methods"
+				);
+				deepEqual(
+					SubclassSubclass(selector, context)[method](arg).subclassMethod, Subclass.fn.subclassMethod,
+					"SubclassSubclass"+description+" has Subclass methods"
+				);
+				deepEqual(
+					SubclassSubclass(selector, context)[method](arg).subclassSubclassMethod, SubclassSubclass.fn.subclassSubclassMethod,
+					"SubclassSubclass"+description+" has SubclassSubclass methods"
+				);
+
+			});
+		});
+	});
+
+});
+
+test("jQuery.camelCase()", function() {
+
+	var tests = {
+		"foo-bar": "fooBar",
+		"foo-bar-baz": "fooBarBaz",
+		"girl-u-want": "girlUWant",
+		"the-4th-dimension": "the4thDimension",
+		"-o-tannenbaum": "OTannenbaum",
+		"-moz-illa": "MozIlla",
+		"-ms-take": "msTake"
+	};
+
+	expect(7);
+
+	jQuery.each( tests, function( key, val ) {
+		equal( jQuery.camelCase( key ), val, "Converts: " + key + " => " + val );
+	});
+});

+ 1701 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/unit/manipulation.js

@@ -0,0 +1,1701 @@
+module("manipulation", { teardown: moduleTeardown });
+
+// Ensure that an extended Array prototype doesn't break jQuery
+Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); };
+
+var bareObj = function(value) { return value; };
+var functionReturningObj = function(value) { return (function() { return value; }); };
+
+test("text()", function() {
+	expect(3);
+	var expected = "This link has class=\"blog\": Simon Willison's Weblog";
+	equal( jQuery("#sap").text(), expected, "Check for merged text of more then one element." );
+
+	// Check serialization of text values
+	equal( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." );
+	notEqual( jQuery(document).text(), "", "Retrieving text for the document retrieves all text (#10724).");
+});
+
+var testText = function(valueObj) {
+	expect(4);
+	var val = valueObj("<div><b>Hello</b> cruel world!</div>");
+	equal( jQuery("#foo").text(val)[0].innerHTML.replace(/>/g, "&gt;"), "&lt;div&gt;&lt;b&gt;Hello&lt;/b&gt; cruel world!&lt;/div&gt;", "Check escaped text" );
+
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	j.text(valueObj("hi!"));
+	equal( jQuery(j[0]).text(), "hi!", "Check node,textnode,comment with text()" );
+	equal( j[1].nodeValue, " there ", "Check node,textnode,comment with text()" );
+
+	// Blackberry 4.6 doesn't maintain comments in the DOM
+	equal( jQuery("#nonnodes")[0].childNodes.length < 3 ? 8 : j[2].nodeType, 8, "Check node,textnode,comment with text()" );
+};
+
+test("text(String)", function() {
+	testText(bareObj);
+});
+
+test("text(Function)", function() {
+	testText(functionReturningObj);
+});
+
+test("text(Function) with incoming value", function() {
+	expect(2);
+
+	var old = "This link has class=\"blog\": Simon Willison's Weblog";
+
+	jQuery("#sap").text(function(i, val) {
+		equal( val, old, "Make sure the incoming value is correct." );
+		return "foobar";
+	});
+
+	equal( jQuery("#sap").text(), "foobar", "Check for merged text of more then one element." );
+
+	QUnit.reset();
+});
+
+var testWrap = function(val) {
+	expect(19);
+	var defaultText = "Try them out:";
+	var result = jQuery("#first").wrap(val( "<div class='red'><span></span></div>" )).text();
+	equal( defaultText, result, "Check for wrapping of on-the-fly html" );
+	ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" );
+
+	QUnit.reset();
+	result = jQuery("#first").wrap(val( document.getElementById("empty") )).parent();
+	ok( result.is("ol"), "Check for element wrapping" );
+	equal( result.text(), defaultText, "Check for element wrapping" );
+
+	QUnit.reset();
+	jQuery("#check1").click(function() {
+		var checkbox = this;
+		ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
+		jQuery(checkbox).wrap(val( "<div id='c1' style='display:none;'></div>" ));
+		ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" );
+	}).click();
+
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	j.wrap(val( "<i></i>" ));
+
+	// Blackberry 4.6 doesn't maintain comments in the DOM
+	equal( jQuery("#nonnodes > i").length, jQuery("#nonnodes")[0].childNodes.length, "Check node,textnode,comment wraps ok" );
+	equal( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" );
+
+	// Try wrapping a disconnected node
+	var cacheLength = 0;
+	for (var i in jQuery.cache) {
+		cacheLength++;
+	}
+
+	j = jQuery("<label/>").wrap(val( "<li/>" ));
+	equal( j[0].nodeName.toUpperCase(), "LABEL", "Element is a label" );
+	equal( j[0].parentNode.nodeName.toUpperCase(), "LI", "Element has been wrapped" );
+
+	for (i in jQuery.cache) {
+		cacheLength--;
+	}
+	equal(cacheLength, 0, "No memory leak in jQuery.cache (bug #7165)");
+
+	// Wrap an element containing a text node
+	j = jQuery("<span/>").wrap("<div>test</div>");
+	equal( j[0].previousSibling.nodeType, 3, "Make sure the previous node is a text element" );
+	equal( j[0].parentNode.nodeName.toUpperCase(), "DIV", "And that we're in the div element." );
+
+	// Try to wrap an element with multiple elements (should fail)
+	j = jQuery("<div><span></span></div>").children().wrap("<p></p><div></div>");
+	equal( j[0].parentNode.parentNode.childNodes.length, 1, "There should only be one element wrapping." );
+	equal( j.length, 1, "There should only be one element (no cloning)." );
+	equal( j[0].parentNode.nodeName.toUpperCase(), "P", "The span should be in the paragraph." );
+
+	// Wrap an element with a jQuery set
+	j = jQuery("<span/>").wrap(jQuery("<div></div>"));
+	equal( j[0].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." );
+
+	// Wrap an element with a jQuery set and event
+	result = jQuery("<div></div>").click(function(){
+		ok(true, "Event triggered.");
+
+		// Remove handlers on detached elements
+		result.unbind();
+		jQuery(this).unbind();
+	});
+
+	j = jQuery("<span/>").wrap(result);
+	equal( j[0].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." );
+
+	j.parent().trigger("click");
+
+	// clean up attached elements
+	QUnit.reset();
+}
+
+test("wrap(String|Element)", function() {
+	testWrap(bareObj);
+});
+
+test("wrap(Function)", function() {
+	testWrap(functionReturningObj);
+});
+
+test("wrap(Function) with index (#10177)", function() {
+	var expectedIndex = 0,
+	    targets = jQuery("#qunit-fixture p");
+
+	expect(targets.length);
+	targets.wrap(function(i) {
+		equal( i, expectedIndex, "Check if the provided index (" + i + ") is as expected (" + expectedIndex + ")" );
+		expectedIndex++;
+
+		return "<div id='wrap_index_'" + i + "'></div>";
+	});
+});
+
+test("wrap(String) consecutive elements (#10177)", function() {
+	var targets = jQuery("#qunit-fixture p");
+
+	expect(targets.length * 2);
+	targets.wrap("<div class='wrapper'></div>");
+	
+	targets.each(function() {
+		var $this = jQuery(this);
+		
+		ok( $this.parent().is('.wrapper'), "Check each elements parent is correct (.wrapper)" );
+		equal( $this.siblings().length, 0, "Each element should be wrapped individually" );
+	});
+});
+
+var testWrapAll = function(val) {
+	expect(8);
+	var prev = jQuery("#firstp")[0].previousSibling;
+	var p = jQuery("#firstp,#first")[0].parentNode;
+
+	var result = jQuery("#firstp,#first").wrapAll(val( "<div class='red'><div class='tmp'></div></div>" ));
+	equal( result.parent().length, 1, "Check for wrapping of on-the-fly html" );
+	ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" );
+	ok( jQuery("#firstp").parent().parent().is(".red"), "Check if wrapper has class 'red'" );
+	equal( jQuery("#first").parent().parent()[0].previousSibling, prev, "Correct Previous Sibling" );
+	equal( jQuery("#first").parent().parent()[0].parentNode, p, "Correct Parent" );
+
+	QUnit.reset();
+	var prev = jQuery("#firstp")[0].previousSibling;
+	var p = jQuery("#first")[0].parentNode;
+	var result = jQuery("#firstp,#first").wrapAll(val( document.getElementById("empty") ));
+	equal( jQuery("#first").parent()[0], jQuery("#firstp").parent()[0], "Same Parent" );
+	equal( jQuery("#first").parent()[0].previousSibling, prev, "Correct Previous Sibling" );
+	equal( jQuery("#first").parent()[0].parentNode, p, "Correct Parent" );
+}
+
+test("wrapAll(String|Element)", function() {
+	testWrapAll(bareObj);
+});
+
+var testWrapInner = function(val) {
+	expect(11);
+	var num = jQuery("#first").children().length;
+	var result = jQuery("#first").wrapInner(val("<div class='red'><div id='tmp'></div></div>"));
+	equal( jQuery("#first").children().length, 1, "Only one child" );
+	ok( jQuery("#first").children().is(".red"), "Verify Right Element" );
+	equal( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" );
+
+	QUnit.reset();
+	var num = jQuery("#first").html("foo<div>test</div><div>test2</div>").children().length;
+	var result = jQuery("#first").wrapInner(val("<div class='red'><div id='tmp'></div></div>"));
+	equal( jQuery("#first").children().length, 1, "Only one child" );
+	ok( jQuery("#first").children().is(".red"), "Verify Right Element" );
+	equal( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" );
+
+	QUnit.reset();
+	var num = jQuery("#first").children().length;
+	var result = jQuery("#first").wrapInner(val(document.getElementById("empty")));
+	equal( jQuery("#first").children().length, 1, "Only one child" );
+	ok( jQuery("#first").children().is("#empty"), "Verify Right Element" );
+	equal( jQuery("#first").children().children().length, num, "Verify Elements Intact" );
+
+	var div = jQuery("<div/>");
+	div.wrapInner(val("<span></span>"));
+	equal(div.children().length, 1, "The contents were wrapped.");
+	equal(div.children()[0].nodeName.toLowerCase(), "span", "A span was inserted.");
+}
+
+test("wrapInner(String|Element)", function() {
+	testWrapInner(bareObj);
+});
+
+test("wrapInner(Function)", function() {
+	testWrapInner(functionReturningObj)
+});
+
+test("unwrap()", function() {
+	expect(9);
+
+	jQuery("body").append("  <div id='unwrap' style='display: none;'> <div id='unwrap1'> <span class='unwrap'>a</span> <span class='unwrap'>b</span> </div> <div id='unwrap2'> <span class='unwrap'>c</span> <span class='unwrap'>d</span> </div> <div id='unwrap3'> <b><span class='unwrap unwrap3'>e</span></b> <b><span class='unwrap unwrap3'>f</span></b> </div> </div>");
+
+	var abcd = jQuery("#unwrap1 > span, #unwrap2 > span").get(),
+		abcdef = jQuery("#unwrap span").get();
+
+	equal( jQuery("#unwrap1 span").add("#unwrap2 span:first").unwrap().length, 3, "make #unwrap1 and #unwrap2 go away" );
+	deepEqual( jQuery("#unwrap > span").get(), abcd, "all four spans should still exist" );
+
+	deepEqual( jQuery("#unwrap3 span").unwrap().get(), jQuery("#unwrap3 > span").get(), "make all b in #unwrap3 go away" );
+
+	deepEqual( jQuery("#unwrap3 span").unwrap().get(), jQuery("#unwrap > span.unwrap3").get(), "make #unwrap3 go away" );
+
+	deepEqual( jQuery("#unwrap").children().get(), abcdef, "#unwrap only contains 6 child spans" );
+
+	deepEqual( jQuery("#unwrap > span").unwrap().get(), jQuery("body > span.unwrap").get(), "make the 6 spans become children of body" );
+
+	deepEqual( jQuery("body > span.unwrap").unwrap().get(), jQuery("body > span.unwrap").get(), "can't unwrap children of body" );
+	deepEqual( jQuery("body > span.unwrap").unwrap().get(), abcdef, "can't unwrap children of body" );
+
+	deepEqual( jQuery("body > span.unwrap").get(), abcdef, "body contains 6 .unwrap child spans" );
+
+	jQuery("body > span.unwrap").remove();
+});
+
+var testAppend = function(valueObj) {
+	expect(41);
+	var defaultText = "Try them out:"
+	var result = jQuery("#first").append(valueObj("<b>buga</b>"));
+	equal( result.text(), defaultText + "buga", "Check if text appending works" );
+	equal( jQuery("#select3").append(valueObj("<option value='appendTest'>Append Test</option>")).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element");
+
+	QUnit.reset();
+	var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:";
+	jQuery("#sap").append(valueObj(document.getElementById("first")));
+	equal( jQuery("#sap").text(), expected, "Check for appending of element" );
+
+	QUnit.reset();
+	expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
+	jQuery("#sap").append(valueObj([document.getElementById("first"), document.getElementById("yahoo")]));
+	equal( jQuery("#sap").text(), expected, "Check for appending of array of elements" );
+
+	QUnit.reset();
+	expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
+	jQuery("#sap").append(valueObj(jQuery("#yahoo, #first")));
+	equal( jQuery("#sap").text(), expected, "Check for appending of jQuery object" );
+
+	QUnit.reset();
+	jQuery("#sap").append(valueObj( 5 ));
+	ok( jQuery("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" );
+
+	QUnit.reset();
+	jQuery("#sap").append(valueObj( " text with spaces " ));
+	ok( jQuery("#sap")[0].innerHTML.match(/ text with spaces $/), "Check for appending text with spaces" );
+
+	QUnit.reset();
+	ok( jQuery("#sap").append(valueObj( [] )), "Check for appending an empty array." );
+	ok( jQuery("#sap").append(valueObj( "" )), "Check for appending an empty string." );
+	ok( jQuery("#sap").append(valueObj( document.getElementsByTagName("foo") )), "Check for appending an empty nodelist." );
+
+	QUnit.reset();
+	jQuery("form").append(valueObj("<input name='radiotest' type='radio' checked='checked' />"));
+	jQuery("form input[name=radiotest]").each(function(){
+		ok( jQuery(this).is(":checked"), "Append checked radio");
+	}).remove();
+
+	QUnit.reset();
+	jQuery("form").append(valueObj("<input name='radiotest' type='radio' checked    =   'checked' />"));
+	jQuery("form input[name=radiotest]").each(function(){
+		ok( jQuery(this).is(":checked"), "Append alternately formated checked radio");
+	}).remove();
+
+	QUnit.reset();
+	jQuery("form").append(valueObj("<input name='radiotest' type='radio' checked />"));
+	jQuery("form input[name=radiotest]").each(function(){
+		ok( jQuery(this).is(":checked"), "Append HTML5-formated checked radio");
+	}).remove();
+
+	QUnit.reset();
+	jQuery("#sap").append(valueObj( document.getElementById("form") ));
+	equal( jQuery("#sap>form").size(), 1, "Check for appending a form" ); // Bug #910
+
+	QUnit.reset();
+	var pass = true;
+	try {
+		var body = jQuery("#iframe")[0].contentWindow.document.body;
+
+		pass = false;
+		jQuery( body ).append(valueObj( "<div>test</div>" ));
+		pass = true;
+	} catch(e) {}
+
+	ok( pass, "Test for appending a DOM node to the contents of an IFrame" );
+
+	QUnit.reset();
+	jQuery("<fieldset/>").appendTo("#form").append(valueObj( "<legend id='legend'>test</legend>" ));
+	t( "Append legend", "#legend", ["legend"] );
+
+	QUnit.reset();
+	jQuery("#select1").append(valueObj( "<OPTION>Test</OPTION>" ));
+	equal( jQuery("#select1 option:last").text(), "Test", "Appending &lt;OPTION&gt; (all caps)" );
+
+	jQuery("#table").append(valueObj( "<colgroup></colgroup>" ));
+	ok( jQuery("#table colgroup").length, "Append colgroup" );
+
+	jQuery("#table colgroup").append(valueObj( "<col/>" ));
+	ok( jQuery("#table colgroup col").length, "Append col" );
+
+	QUnit.reset();
+	jQuery("#table").append(valueObj( "<caption></caption>" ));
+	ok( jQuery("#table caption").length, "Append caption" );
+
+	QUnit.reset();
+	jQuery("form:last")
+		.append(valueObj( "<select id='appendSelect1'></select>" ))
+		.append(valueObj( "<select id='appendSelect2'><option>Test</option></select>" ));
+
+	t( "Append Select", "#appendSelect1, #appendSelect2", ["appendSelect1", "appendSelect2"] );
+
+	equal( "Two nodes", jQuery("<div />").append("Two", " nodes").text(), "Appending two text nodes (#4011)" );
+
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	var d = jQuery("<div/>").appendTo("#nonnodes").append(j);
+	equal( jQuery("#nonnodes").length, 1, "Check node,textnode,comment append moved leaving just the div" );
+	ok( d.contents().length >= 2, "Check node,textnode,comment append works" );
+	d.contents().appendTo("#nonnodes");
+	d.remove();
+	ok( jQuery("#nonnodes").contents().length >= 2, "Check node,textnode,comment append cleanup worked" );
+
+	QUnit.reset();
+	var $input = jQuery("<input />").attr({ "type": "checkbox", "checked": true }).appendTo('#testForm');
+	equal( $input[0].checked, true, "A checked checkbox that is appended stays checked" );
+
+	QUnit.reset();
+	var $radios = jQuery("input:radio[name='R1']"),
+		$radioNot = jQuery("<input type='radio' name='R1' checked='checked'/>").insertAfter( $radios ),
+		$radio = $radios.eq(1).click();
+	$radioNot[0].checked = false;
+	$radios.parent().wrap("<div></div>");
+	equal( $radio[0].checked, true, "Reappending radios uphold which radio is checked" );
+	equal( $radioNot[0].checked, false, "Reappending radios uphold not being checked" );
+	QUnit.reset();
+
+	var prev = jQuery("#sap").children().length;
+
+	jQuery("#sap").append(
+		"<span></span>",
+		"<span></span>",
+		"<span></span>"
+	);
+
+	equal( jQuery("#sap").children().length, prev + 3, "Make sure that multiple arguments works." );
+	QUnit.reset();
+}
+
+test("append(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	testAppend(bareObj);
+});
+
+test("append(Function)", function() {
+	testAppend(functionReturningObj);
+});
+
+test("append(Function) with incoming value", function() {
+	expect(12);
+
+	var defaultText = "Try them out:", old = jQuery("#first").html();
+
+	var result = jQuery("#first").append(function(i, val){
+		equal( val, old, "Make sure the incoming value is correct." );
+		return "<b>buga</b>";
+	});
+	equal( result.text(), defaultText + "buga", "Check if text appending works" );
+
+	var select = jQuery("#select3");
+	old = select.html();
+
+	equal( select.append(function(i, val){
+		equal( val, old, "Make sure the incoming value is correct." );
+		return "<option value='appendTest'>Append Test</option>";
+	}).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element");
+
+	QUnit.reset();
+	var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:";
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").append(function(i, val){
+		equal( val, old, "Make sure the incoming value is correct." );
+		return document.getElementById("first");
+	});
+	equal( jQuery("#sap").text(), expected, "Check for appending of element" );
+
+	QUnit.reset();
+	expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").append(function(i, val){
+		equal( val, old, "Make sure the incoming value is correct." );
+		return [document.getElementById("first"), document.getElementById("yahoo")];
+	});
+	equal( jQuery("#sap").text(), expected, "Check for appending of array of elements" );
+
+	QUnit.reset();
+	expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").append(function(i, val){
+		equal( val, old, "Make sure the incoming value is correct." );
+		return jQuery("#yahoo, #first");
+	});
+	equal( jQuery("#sap").text(), expected, "Check for appending of jQuery object" );
+
+	QUnit.reset();
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").append(function(i, val){
+		equal( val, old, "Make sure the incoming value is correct." );
+		return 5;
+	});
+	ok( jQuery("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" );
+
+	QUnit.reset();
+});
+
+test("append the same fragment with events (Bug #6997, 5566)", function () {
+	var doExtra = !jQuery.support.noCloneEvent && document.fireEvent;
+	expect(2 + (doExtra ? 1 : 0));
+	stop();
+
+	var element;
+
+	// This patch modified the way that cloning occurs in IE; we need to make sure that
+	// native event handlers on the original object don't get disturbed when they are
+	// modified on the clone
+	if ( doExtra ) {
+		element = jQuery("div:first").click(function () {
+			ok(true, "Event exists on original after being unbound on clone");
+			jQuery(this).unbind("click");
+		});
+		var clone = element.clone(true).unbind("click");
+		clone[0].fireEvent("onclick");
+		element[0].fireEvent("onclick");
+
+		// manually clean up detached elements
+		clone.remove();
+	}
+
+	element = jQuery("<a class='test6997'></a>").click(function () {
+		ok(true, "Append second element events work");
+	});
+
+	jQuery("#listWithTabIndex li").append(element)
+		.find("a.test6997").eq(1).click();
+
+	element = jQuery("<li class='test6997'></li>").click(function () {
+		ok(true, "Before second element events work");
+		start();
+	});
+
+	jQuery("#listWithTabIndex li").before(element);
+	jQuery("#listWithTabIndex li.test6997").eq(1).click();
+});
+
+test("append HTML5 sectioning elements (Bug #6485)", function () {
+	expect(2);
+
+	jQuery("#qunit-fixture").append("<article style='font-size:10px'><section><aside>HTML5 elements</aside></section></article>");
+
+	var article = jQuery("article"),
+	aside = jQuery("aside");
+
+	equal( article.css("fontSize"), "10px", "HTML5 elements are styleable");
+	equal( aside.length, 1, "HTML5 elements do not collapse their children")
+});
+
+test("HTML5 Elements inherit styles from style rules (Bug #10501)", function () {
+	expect(1);
+
+	jQuery("#qunit-fixture").append("<article id='article'></article>");
+	jQuery("#article").append("<section>This section should have a pink background.</section>");
+
+	// In IE, the missing background color will claim its value is "transparent"
+	notEqual( jQuery("section").css("background-color"), "transparent", "HTML5 elements inherit styles");
+});
+
+test("html5 clone() cannot use the fragment cache in IE (#6485)", function () {
+	expect(1);
+
+	jQuery("<article><section><aside>HTML5 elements</aside></section></article>").appendTo("#qunit-fixture");
+
+	var clone = jQuery("article").clone();
+
+	jQuery("#qunit-fixture").append( clone );
+
+	equal( jQuery("aside").length, 2, "clone()ing HTML5 elems does not collapse them" );
+});
+
+test("html(String) with HTML5 (Bug #6485)", function() {
+	expect(2);
+
+	jQuery("#qunit-fixture").html("<article><section><aside>HTML5 elements</aside></section></article>");
+	equal( jQuery("#qunit-fixture").children().children().length, 1, "Make sure HTML5 article elements can hold children. innerHTML shortcut path" );
+	equal( jQuery("#qunit-fixture").children().children().children().length, 1, "Make sure nested HTML5 elements can hold children." );
+});
+
+test("append(xml)", function() {
+	expect( 1 );
+
+	function createXMLDoc() {
+		// Initialize DOM based upon latest installed MSXML or Netscape
+		var elem,
+			aActiveX =
+				[ "MSXML6.DomDocument",
+				"MSXML3.DomDocument",
+				"MSXML2.DomDocument",
+				"MSXML.DomDocument",
+				"Microsoft.XmlDom" ];
+
+		if ( document.implementation && "createDocument" in document.implementation ) {
+			return document.implementation.createDocument( "", "", null );
+		} else {
+			// IE
+			for ( var n = 0, len = aActiveX.length; n < len; n++ ) {
+				try {
+					elem = new ActiveXObject( aActiveX[ n ] );
+					return elem;
+				} catch(_){};
+			}
+		}
+	}
+
+	var xmlDoc = createXMLDoc(),
+		xml1 = xmlDoc.createElement("head"),
+		xml2 = xmlDoc.createElement("test");
+
+	ok( jQuery( xml1 ).append( xml2 ), "Append an xml element to another without raising an exception." );
+
+});
+
+test("appendTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	expect(17);
+
+	var defaultText = "Try them out:"
+	jQuery("<b>buga</b>").appendTo("#first");
+	equal( jQuery("#first").text(), defaultText + "buga", "Check if text appending works" );
+	equal( jQuery("<option value='appendTest'>Append Test</option>").appendTo("#select3").parent().find("option:last-child").attr("value"), "appendTest", "Appending html options to select element");
+
+	QUnit.reset();
+	var l = jQuery("#first").children().length + 2;
+	jQuery("<strong>test</strong>");
+	jQuery("<strong>test</strong>");
+	jQuery([ jQuery("<strong>test</strong>")[0], jQuery("<strong>test</strong>")[0] ])
+		.appendTo("#first");
+	equal( jQuery("#first").children().length, l, "Make sure the elements were inserted." );
+	equal( jQuery("#first").children().last()[0].nodeName.toLowerCase(), "strong", "Verify the last element." );
+
+	QUnit.reset();
+	var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:";
+	jQuery(document.getElementById("first")).appendTo("#sap");
+	equal( jQuery("#sap").text(), expected, "Check for appending of element" );
+
+	QUnit.reset();
+	expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo";
+	jQuery([document.getElementById("first"), document.getElementById("yahoo")]).appendTo("#sap");
+	equal( jQuery("#sap").text(), expected, "Check for appending of array of elements" );
+
+	QUnit.reset();
+	ok( jQuery(document.createElement("script")).appendTo("body").length, "Make sure a disconnected script can be appended." );
+
+	QUnit.reset();
+	expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:";
+	jQuery("#yahoo, #first").appendTo("#sap");
+	equal( jQuery("#sap").text(), expected, "Check for appending of jQuery object" );
+
+	QUnit.reset();
+	jQuery("#select1").appendTo("#foo");
+	t( "Append select", "#foo select", ["select1"] );
+
+	QUnit.reset();
+	var div = jQuery("<div/>").click(function(){
+		ok(true, "Running a cloned click.");
+	});
+	div.appendTo("#qunit-fixture, #moretests");
+
+	jQuery("#qunit-fixture div:last").click();
+	jQuery("#moretests div:last").click();
+
+	QUnit.reset();
+	div = jQuery("<div/>").appendTo("#qunit-fixture, #moretests");
+
+	equal( div.length, 2, "appendTo returns the inserted elements" );
+
+	div.addClass("test");
+
+	ok( jQuery("#qunit-fixture div:last").hasClass("test"), "appendTo element was modified after the insertion" );
+	ok( jQuery("#moretests div:last").hasClass("test"), "appendTo element was modified after the insertion" );
+
+	QUnit.reset();
+
+	div = jQuery("<div/>");
+	jQuery("<span>a</span><b>b</b>").filter("span").appendTo( div );
+
+	equal( div.children().length, 1, "Make sure the right number of children were inserted." );
+
+	div = jQuery("#moretests div");
+
+	var num = jQuery("#qunit-fixture div").length;
+	div.remove().appendTo("#qunit-fixture");
+
+	equal( jQuery("#qunit-fixture div").length, num, "Make sure all the removed divs were inserted." );
+
+	QUnit.reset();
+
+	stop();
+	jQuery.getScript('data/test.js', function() {
+		jQuery('script[src*="data\\/test\\.js"]').remove();
+		start();
+	});
+});
+
+var testPrepend = function(val) {
+	expect(5);
+	var defaultText = "Try them out:"
+	var result = jQuery("#first").prepend(val( "<b>buga</b>" ));
+	equal( result.text(), "buga" + defaultText, "Check if text prepending works" );
+	equal( jQuery("#select3").prepend(val( "<option value='prependTest'>Prepend Test</option>" )).find("option:first-child").attr("value"), "prependTest", "Prepending html options to select element");
+
+	QUnit.reset();
+	var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog";
+	jQuery("#sap").prepend(val( document.getElementById("first") ));
+	equal( jQuery("#sap").text(), expected, "Check for prepending of element" );
+
+	QUnit.reset();
+	expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
+	jQuery("#sap").prepend(val( [document.getElementById("first"), document.getElementById("yahoo")] ));
+	equal( jQuery("#sap").text(), expected, "Check for prepending of array of elements" );
+
+	QUnit.reset();
+	expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
+	jQuery("#sap").prepend(val( jQuery("#yahoo, #first") ));
+	equal( jQuery("#sap").text(), expected, "Check for prepending of jQuery object" );
+};
+
+test("prepend(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	testPrepend(bareObj);
+});
+
+test("prepend(Function)", function() {
+	testPrepend(functionReturningObj);
+});
+
+test("prepend(Function) with incoming value", function() {
+	expect(10);
+
+	var defaultText = "Try them out:", old = jQuery("#first").html();
+	var result = jQuery("#first").prepend(function(i, val) {
+		equal( val, old, "Make sure the incoming value is correct." );
+		return "<b>buga</b>";
+	});
+	equal( result.text(), "buga" + defaultText, "Check if text prepending works" );
+
+	old = jQuery("#select3").html();
+
+	equal( jQuery("#select3").prepend(function(i, val) {
+		equal( val, old, "Make sure the incoming value is correct." );
+		return "<option value='prependTest'>Prepend Test</option>";
+	}).find("option:first-child").attr("value"), "prependTest", "Prepending html options to select element");
+
+	QUnit.reset();
+	var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog";
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").prepend(function(i, val) {
+		equal( val, old, "Make sure the incoming value is correct." );
+		return document.getElementById("first");
+	});
+
+	equal( jQuery("#sap").text(), expected, "Check for prepending of element" );
+
+	QUnit.reset();
+	expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").prepend(function(i, val) {
+		equal( val, old, "Make sure the incoming value is correct." );
+		return [document.getElementById("first"), document.getElementById("yahoo")];
+	});
+
+	equal( jQuery("#sap").text(), expected, "Check for prepending of array of elements" );
+
+	QUnit.reset();
+	expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
+	old = jQuery("#sap").html();
+
+	jQuery("#sap").prepend(function(i, val) {
+		equal( val, old, "Make sure the incoming value is correct." );
+		return jQuery("#yahoo, #first");
+	});
+
+	equal( jQuery("#sap").text(), expected, "Check for prepending of jQuery object" );
+});
+
+test("prependTo(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	expect(6);
+	var defaultText = "Try them out:"
+	jQuery("<b>buga</b>").prependTo("#first");
+	equal( jQuery("#first").text(), "buga" + defaultText, "Check if text prepending works" );
+	equal( jQuery("<option value='prependTest'>Prepend Test</option>").prependTo("#select3").parent().find("option:first-child").attr("value"), "prependTest", "Prepending html options to select element");
+
+	QUnit.reset();
+	var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog";
+	jQuery(document.getElementById("first")).prependTo("#sap");
+	equal( jQuery("#sap").text(), expected, "Check for prepending of element" );
+
+	QUnit.reset();
+	expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog";
+	jQuery([document.getElementById("first"), document.getElementById("yahoo")]).prependTo("#sap");
+	equal( jQuery("#sap").text(), expected, "Check for prepending of array of elements" );
+
+	QUnit.reset();
+	expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog";
+	jQuery("#yahoo, #first").prependTo("#sap");
+	equal( jQuery("#sap").text(), expected, "Check for prepending of jQuery object" );
+
+	QUnit.reset();
+	jQuery("<select id='prependSelect1'></select>").prependTo("form:last");
+	jQuery("<select id='prependSelect2'><option>Test</option></select>").prependTo("form:last");
+
+	t( "Prepend Select", "#prependSelect2, #prependSelect1", ["prependSelect2", "prependSelect1"] );
+});
+
+var testBefore = function(val) {
+	expect(6);
+	var expected = "This is a normal link: bugaYahoo";
+	jQuery("#yahoo").before(val( "<b>buga</b>" ));
+	equal( jQuery("#en").text(), expected, "Insert String before" );
+
+	QUnit.reset();
+	expected = "This is a normal link: Try them out:Yahoo";
+	jQuery("#yahoo").before(val( document.getElementById("first") ));
+	equal( jQuery("#en").text(), expected, "Insert element before" );
+
+	QUnit.reset();
+	expected = "This is a normal link: Try them out:diveintomarkYahoo";
+	jQuery("#yahoo").before(val( [document.getElementById("first"), document.getElementById("mark")] ));
+	equal( jQuery("#en").text(), expected, "Insert array of elements before" );
+
+	QUnit.reset();
+	expected = "This is a normal link: diveintomarkTry them out:Yahoo";
+	jQuery("#yahoo").before(val( jQuery("#mark, #first") ));
+	equal( jQuery("#en").text(), expected, "Insert jQuery before" );
+
+	var set = jQuery("<div/>").before("<span>test</span>");
+	equal( set[0].nodeName.toLowerCase(), "span", "Insert the element before the disconnected node." );
+	equal( set.length, 2, "Insert the element before the disconnected node." );
+};
+
+test("before(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	testBefore(bareObj);
+});
+
+test("before(Function)", function() {
+	testBefore(functionReturningObj);
+});
+
+test("before and after w/ empty object (#10812)", function() {
+	expect(2);
+
+	var res = jQuery( "#notInTheDocument" ).before( "(" ).after( ")" );
+	equal( res.length, 2, "didn't choke on empty object" );
+	equal( res.wrapAll("<div/>").parent().text(), "()", "correctly appended text" );
+});
+
+test("insertBefore(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	expect(4);
+	var expected = "This is a normal link: bugaYahoo";
+	jQuery("<b>buga</b>").insertBefore("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert String before" );
+
+	QUnit.reset();
+	expected = "This is a normal link: Try them out:Yahoo";
+	jQuery(document.getElementById("first")).insertBefore("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert element before" );
+
+	QUnit.reset();
+	expected = "This is a normal link: Try them out:diveintomarkYahoo";
+	jQuery([document.getElementById("first"), document.getElementById("mark")]).insertBefore("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert array of elements before" );
+
+	QUnit.reset();
+	expected = "This is a normal link: diveintomarkTry them out:Yahoo";
+	jQuery("#mark, #first").insertBefore("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert jQuery before" );
+});
+
+var testAfter = function(val) {
+	expect(6);
+	var expected = "This is a normal link: Yahoobuga";
+	jQuery("#yahoo").after(val( "<b>buga</b>" ));
+	equal( jQuery("#en").text(), expected, "Insert String after" );
+
+	QUnit.reset();
+	expected = "This is a normal link: YahooTry them out:";
+	jQuery("#yahoo").after(val( document.getElementById("first") ));
+	equal( jQuery("#en").text(), expected, "Insert element after" );
+
+	QUnit.reset();
+	expected = "This is a normal link: YahooTry them out:diveintomark";
+	jQuery("#yahoo").after(val( [document.getElementById("first"), document.getElementById("mark")] ));
+	equal( jQuery("#en").text(), expected, "Insert array of elements after" );
+
+	QUnit.reset();
+	expected = "This is a normal link: YahoodiveintomarkTry them out:";
+	jQuery("#yahoo").after(val( jQuery("#mark, #first") ));
+	equal( jQuery("#en").text(), expected, "Insert jQuery after" );
+
+	var set = jQuery("<div/>").after("<span>test</span>");
+	equal( set[1].nodeName.toLowerCase(), "span", "Insert the element after the disconnected node." );
+	equal( set.length, 2, "Insert the element after the disconnected node." );
+};
+
+test("after(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	testAfter(bareObj);
+});
+
+test("after(Function)", function() {
+	testAfter(functionReturningObj);
+});
+
+test("insertAfter(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	expect(4);
+	var expected = "This is a normal link: Yahoobuga";
+	jQuery("<b>buga</b>").insertAfter("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert String after" );
+
+	QUnit.reset();
+	expected = "This is a normal link: YahooTry them out:";
+	jQuery(document.getElementById("first")).insertAfter("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert element after" );
+
+	QUnit.reset();
+	expected = "This is a normal link: YahooTry them out:diveintomark";
+	jQuery([document.getElementById("first"), document.getElementById("mark")]).insertAfter("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert array of elements after" );
+
+	QUnit.reset();
+	expected = "This is a normal link: YahoodiveintomarkTry them out:";
+	jQuery("#mark, #first").insertAfter("#yahoo");
+	equal( jQuery("#en").text(), expected, "Insert jQuery after" );
+});
+
+var testReplaceWith = function(val) {
+	expect(21);
+	jQuery("#yahoo").replaceWith(val( "<b id='replace'>buga</b>" ));
+	ok( jQuery("#replace")[0], "Replace element with string" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after string" );
+
+	QUnit.reset();
+	jQuery("#yahoo").replaceWith(val( document.getElementById("first") ));
+	ok( jQuery("#first")[0], "Replace element with element" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after element" );
+
+	QUnit.reset();
+	jQuery("#qunit-fixture").append("<div id='bar'><div id='baz'</div></div>");
+	jQuery("#baz").replaceWith("Baz");
+	equal( jQuery("#bar").text(),"Baz", "Replace element with text" );
+	ok( !jQuery("#baz")[0], "Verify that original element is gone, after element" );
+
+	QUnit.reset();
+	jQuery("#yahoo").replaceWith(val( [document.getElementById("first"), document.getElementById("mark")] ));
+	ok( jQuery("#first")[0], "Replace element with array of elements" );
+	ok( jQuery("#mark")[0], "Replace element with array of elements" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after array of elements" );
+
+	QUnit.reset();
+	jQuery("#yahoo").replaceWith(val( jQuery("#mark, #first") ));
+	ok( jQuery("#first")[0], "Replace element with set of elements" );
+	ok( jQuery("#mark")[0], "Replace element with set of elements" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after set of elements" );
+
+	QUnit.reset();
+	var tmp = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Newly bound click run." ); });
+	var y = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Previously bound click run." ); });
+	var child = y.append("<b>test</b>").find("b").click(function(){ ok(true, "Child bound click run." ); return false; });
+
+	y.replaceWith( tmp );
+
+	tmp.click();
+	y.click(); // Shouldn't be run
+	child.click(); // Shouldn't be run
+
+	tmp.remove();
+	y.remove();
+	child.remove();
+
+	QUnit.reset();
+
+	y = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Previously bound click run." ); });
+	var child2 = y.append("<u>test</u>").find("u").click(function(){ ok(true, "Child 2 bound click run." ); return false; });
+
+	y.replaceWith( child2 );
+
+	child2.click();
+
+	y.remove();
+	child2.remove();
+
+	QUnit.reset();
+
+	var set = jQuery("<div/>").replaceWith(val("<span>test</span>"));
+	equal( set[0].nodeName.toLowerCase(), "span", "Replace the disconnected node." );
+	equal( set.length, 1, "Replace the disconnected node." );
+
+	var non_existant = jQuery("#does-not-exist").replaceWith( val("<b>should not throw an error</b>") );
+	equal( non_existant.length, 0, "Length of non existant element." );
+
+	var $div = jQuery("<div class='replacewith'></div>").appendTo("body");
+	// TODO: Work on jQuery(...) inline script execution
+	//$div.replaceWith("<div class='replacewith'></div><script>" +
+		//"equal(jQuery('.replacewith').length, 1, 'Check number of elements in page.');" +
+		//"</script>");
+	equal(jQuery(".replacewith").length, 1, "Check number of elements in page.");
+	jQuery(".replacewith").remove();
+
+	QUnit.reset();
+
+	jQuery("#qunit-fixture").append("<div id='replaceWith'></div>");
+	equal( jQuery("#qunit-fixture").find("div[id=replaceWith]").length, 1, "Make sure only one div exists." );
+
+	jQuery("#replaceWith").replaceWith( val("<div id='replaceWith'></div>") );
+	equal( jQuery("#qunit-fixture").find("div[id=replaceWith]").length, 1, "Make sure only one div exists." );
+
+	jQuery("#replaceWith").replaceWith( val("<div id='replaceWith'></div>") );
+	equal( jQuery("#qunit-fixture").find("div[id=replaceWith]").length, 1, "Make sure only one div exists." );
+}
+
+test("replaceWith(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	testReplaceWith(bareObj);
+});
+
+test("replaceWith(Function)", function() {
+	testReplaceWith(functionReturningObj);
+
+	expect(22);
+
+	var y = jQuery("#yahoo")[0];
+
+	jQuery(y).replaceWith(function(){
+		equal( this, y, "Make sure the context is coming in correctly." );
+	});
+
+	QUnit.reset();
+});
+
+test("replaceWith(string) for more than one element", function(){
+	expect(3);
+
+	equal(jQuery("#foo p").length, 3, "ensuring that test data has not changed");
+
+	jQuery("#foo p").replaceWith("<span>bar</span>");
+	equal(jQuery("#foo span").length, 3, "verify that all the three original element have been replaced");
+	equal(jQuery("#foo p").length, 0, "verify that all the three original element have been replaced");
+});
+
+test("replaceAll(String|Element|Array&lt;Element&gt;|jQuery)", function() {
+	expect(10);
+	jQuery("<b id='replace'>buga</b>").replaceAll("#yahoo");
+	ok( jQuery("#replace")[0], "Replace element with string" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after string" );
+
+	QUnit.reset();
+	jQuery(document.getElementById("first")).replaceAll("#yahoo");
+	ok( jQuery("#first")[0], "Replace element with element" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after element" );
+
+	QUnit.reset();
+	jQuery([document.getElementById("first"), document.getElementById("mark")]).replaceAll("#yahoo");
+	ok( jQuery("#first")[0], "Replace element with array of elements" );
+	ok( jQuery("#mark")[0], "Replace element with array of elements" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after array of elements" );
+
+	QUnit.reset();
+	jQuery("#mark, #first").replaceAll("#yahoo");
+	ok( jQuery("#first")[0], "Replace element with set of elements" );
+	ok( jQuery("#mark")[0], "Replace element with set of elements" );
+	ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after set of elements" );
+});
+
+test("jQuery.clone() (#8017)", function() {
+
+	expect(2);
+
+	ok( jQuery.clone && jQuery.isFunction( jQuery.clone ) , "jQuery.clone() utility exists and is a function.");
+
+	var main = jQuery("#qunit-fixture")[0],
+			clone = jQuery.clone( main );
+
+	equal( main.childNodes.length, clone.childNodes.length, "Simple child length to ensure a large dom tree copies correctly" );
+});
+
+test("clone() (#8070)", function () {
+	expect(2);
+
+	jQuery("<select class='test8070'></select><select class='test8070'></select>").appendTo("#qunit-fixture");
+	var selects = jQuery(".test8070");
+	selects.append("<OPTION>1</OPTION><OPTION>2</OPTION>");
+
+	equal( selects[0].childNodes.length, 2, "First select got two nodes" );
+	equal( selects[1].childNodes.length, 2, "Second select got two nodes" );
+
+	selects.remove();
+});
+
+test("clone()", function() {
+	expect(39);
+	equal( "This is a normal link: Yahoo", jQuery("#en").text(), "Assert text for #en" );
+	var clone = jQuery("#yahoo").clone();
+	equal( "Try them out:Yahoo", jQuery("#first").append(clone).text(), "Check for clone" );
+	equal( "This is a normal link: Yahoo", jQuery("#en").text(), "Reassert text for #en" );
+
+	var cloneTags = [
+		"<table/>", "<tr/>", "<td/>", "<div/>",
+		"<button/>", "<ul/>", "<ol/>", "<li/>",
+		"<input type='checkbox' />", "<select/>", "<option/>", "<textarea/>",
+		"<tbody/>", "<thead/>", "<tfoot/>", "<iframe/>"
+	];
+	for (var i = 0; i < cloneTags.length; i++) {
+		var j = jQuery(cloneTags[i]);
+		equal( j[0].tagName, j.clone()[0].tagName, "Clone a " + cloneTags[i]);
+	}
+
+	// using contents will get comments regular, text, and comment nodes
+	var cl = jQuery("#nonnodes").contents().clone();
+	ok( cl.length >= 2, "Check node,textnode,comment clone works (some browsers delete comments on clone)" );
+
+	var div = jQuery("<div><ul><li>test</li></ul></div>").click(function(){
+		ok( true, "Bound event still exists." );
+	});
+
+	clone = div.clone(true);
+
+	// manually clean up detached elements
+	div.remove();
+
+	div = clone.clone(true);
+
+	// manually clean up detached elements
+	clone.remove();
+
+	equal( div.length, 1, "One element cloned" );
+	equal( div[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
+	div.trigger("click");
+
+	// manually clean up detached elements
+	div.remove();
+
+	div = jQuery("<div/>").append([ document.createElement("table"), document.createElement("table") ]);
+	div.find("table").click(function(){
+		ok( true, "Bound event still exists." );
+	});
+
+	clone = div.clone(true);
+	equal( clone.length, 1, "One element cloned" );
+	equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
+	clone.find("table:last").trigger("click");
+
+	// manually clean up detached elements
+	div.remove();
+	clone.remove();
+
+	var divEvt = jQuery("<div><ul><li>test</li></ul></div>").click(function(){
+		ok( false, "Bound event still exists after .clone()." );
+	}),
+		cloneEvt = divEvt.clone();
+
+	// Make sure that doing .clone() doesn't clone events
+	cloneEvt.trigger("click");
+
+	cloneEvt.remove();
+	divEvt.remove();
+
+	// Test both html() and clone() for <embed and <object types
+	div = jQuery("<div/>").html('<embed height="355" width="425" src="http://www.youtube.com/v/3KANI2dpXLw&amp;hl=en"></embed>');
+
+	clone = div.clone(true);
+	equal( clone.length, 1, "One element cloned" );
+	equal( clone.html(), div.html(), "Element contents cloned" );
+	equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
+
+	// this is technically an invalid object, but because of the special
+	// classid instantiation it is the only kind that IE has trouble with,
+	// so let's test with it too.
+	div = jQuery("<div/>").html("<object height='355' width='425' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>  <param name='movie' value='http://www.youtube.com/v/3KANI2dpXLw&amp;hl=en'>  <param name='wmode' value='transparent'> </object>");
+
+	clone = div.clone(true);
+	equal( clone.length, 1, "One element cloned" );
+	// equal( clone.html(), div.html(), "Element contents cloned" );
+	equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
+
+	// and here's a valid one.
+	div = jQuery("<div/>").html("<object height='355' width='425' type='application/x-shockwave-flash' data='http://www.youtube.com/v/3KANI2dpXLw&amp;hl=en'>  <param name='movie' value='http://www.youtube.com/v/3KANI2dpXLw&amp;hl=en'>  <param name='wmode' value='transparent'> </object>");
+
+	clone = div.clone(true);
+	equal( clone.length, 1, "One element cloned" );
+	equal( clone.html(), div.html(), "Element contents cloned" );
+	equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" );
+
+	div = jQuery("<div/>").data({ a: true });
+	clone = div.clone(true);
+	equal( clone.data("a"), true, "Data cloned." );
+	clone.data("a", false);
+	equal( clone.data("a"), false, "Ensure cloned element data object was correctly modified" );
+	equal( div.data("a"), true, "Ensure cloned element data object is copied, not referenced" );
+
+	// manually clean up detached elements
+	div.remove();
+	clone.remove();
+
+	var form = document.createElement("form");
+	form.action = "/test/";
+	var div = document.createElement("div");
+	div.appendChild( document.createTextNode("test") );
+	form.appendChild( div );
+
+	equal( jQuery(form).clone().children().length, 1, "Make sure we just get the form back." );
+
+	equal( jQuery("body").clone().children()[0].id, "qunit-header", "Make sure cloning body works" );
+});
+
+test("clone(form element) (Bug #3879, #6655)", function() {
+	expect(5);
+	var element = jQuery("<select><option>Foo</option><option selected>Bar</option></select>");
+
+	equal( element.clone().find("option:selected").val(), element.find("option:selected").val(), "Selected option cloned correctly" );
+
+	element = jQuery("<input type='checkbox' value='foo'>").attr("checked", "checked");
+	clone = element.clone();
+
+	equal( clone.is(":checked"), element.is(":checked"), "Checked input cloned correctly" );
+	equal( clone[0].defaultValue, "foo", "Checked input defaultValue cloned correctly" );
+
+	// defaultChecked also gets set now due to setAttribute in attr, is this check still valid?
+	// equal( clone[0].defaultChecked, !jQuery.support.noCloneChecked, "Checked input defaultChecked cloned correctly" );
+
+	element = jQuery("<input type='text' value='foo'>");
+	clone = element.clone();
+	equal( clone[0].defaultValue, "foo", "Text input defaultValue cloned correctly" );
+
+	element = jQuery("<textarea>foo</textarea>");
+	clone = element.clone();
+	equal( clone[0].defaultValue, "foo", "Textarea defaultValue cloned correctly" );
+});
+
+test("clone(multiple selected options) (Bug #8129)", function() {
+	expect(1);
+	var element = jQuery("<select><option>Foo</option><option selected>Bar</option><option selected>Baz</option></select>");
+
+	equal( element.clone().find("option:selected").length, element.find("option:selected").length, "Multiple selected options cloned correctly" );
+
+});
+
+if (!isLocal) {
+test("clone() on XML nodes", function() {
+	expect(2);
+	stop();
+	jQuery.get("data/dashboard.xml", function (xml) {
+		var root = jQuery(xml.documentElement).clone();
+		var origTab = jQuery("tab", xml).eq(0);
+		var cloneTab = jQuery("tab", root).eq(0);
+		origTab.text("origval");
+		cloneTab.text("cloneval");
+		equal(origTab.text(), "origval", "Check original XML node was correctly set");
+		equal(cloneTab.text(), "cloneval", "Check cloned XML node was correctly set");
+		start();
+	});
+});
+}
+
+var testHtml = function(valueObj) {
+	expect(34);
+
+	jQuery.scriptorder = 0;
+
+	var div = jQuery("#qunit-fixture > div");
+	div.html(valueObj("<b>test</b>"));
+	var pass = true;
+	for ( var i = 0; i < div.size(); i++ ) {
+		if ( div.get(i).childNodes.length != 1 ) pass = false;
+	}
+	ok( pass, "Set HTML" );
+
+	div = jQuery("<div/>").html( valueObj("<div id='parent_1'><div id='child_1'/></div><div id='parent_2'/>") );
+
+	equal( div.children().length, 2, "Make sure two child nodes exist." );
+	equal( div.children().children().length, 1, "Make sure that a grandchild exists." );
+
+	var space = jQuery("<div/>").html(valueObj("&#160;"))[0].innerHTML;
+	ok( /^\xA0$|^&nbsp;$/.test( space ), "Make sure entities are passed through correctly." );
+	equal( jQuery("<div/>").html(valueObj("&amp;"))[0].innerHTML, "&amp;", "Make sure entities are passed through correctly." );
+
+	jQuery("#qunit-fixture").html(valueObj("<style>.foobar{color:green;}</style>"));
+
+	equal( jQuery("#qunit-fixture").children().length, 1, "Make sure there is a child element." );
+	equal( jQuery("#qunit-fixture").children()[0].nodeName.toUpperCase(), "STYLE", "And that a style element was inserted." );
+
+	QUnit.reset();
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	j.html(valueObj("<b>bold</b>"));
+
+	// this is needed, or the expando added by jQuery unique will yield a different html
+	j.find("b").removeData();
+	equal( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" );
+
+	jQuery("#qunit-fixture").html(valueObj("<select/>"));
+	jQuery("#qunit-fixture select").html(valueObj("<option>O1</option><option selected='selected'>O2</option><option>O3</option>"));
+	equal( jQuery("#qunit-fixture select").val(), "O2", "Selected option correct" );
+
+	var $div = jQuery("<div />");
+	equal( $div.html(valueObj( 5 )).html(), "5", "Setting a number as html" );
+	equal( $div.html(valueObj( 0 )).html(), "0", "Setting a zero as html" );
+
+	var $div2 = jQuery("<div/>"), insert = "&lt;div&gt;hello1&lt;/div&gt;";
+	equal( $div2.html(insert).html().replace(/>/g, "&gt;"), insert, "Verify escaped insertion." );
+	equal( $div2.html("x" + insert).html().replace(/>/g, "&gt;"), "x" + insert, "Verify escaped insertion." );
+	equal( $div2.html(" " + insert).html().replace(/>/g, "&gt;"), " " + insert, "Verify escaped insertion." );
+
+	var map = jQuery("<map/>").html(valueObj("<area id='map01' shape='rect' coords='50,50,150,150' href='http://www.jquery.com/' alt='jQuery'>"));
+
+	equal( map[0].childNodes.length, 1, "The area was inserted." );
+	equal( map[0].firstChild.nodeName.toLowerCase(), "area", "The area was inserted." );
+
+	QUnit.reset();
+
+	jQuery("#qunit-fixture").html(valueObj("<script type='something/else'>ok( false, 'Non-script evaluated.' );</script><script type='text/javascript'>ok( true, 'text/javascript is evaluated.' );</script><script>ok( true, 'No type is evaluated.' );</script><div><script type='text/javascript'>ok( true, 'Inner text/javascript is evaluated.' );</script><script>ok( true, 'Inner No type is evaluated.' );</script><script type='something/else'>ok( false, 'Non-script evaluated.' );</script></div>"));
+
+	var child = jQuery("#qunit-fixture").find("script");
+
+	equal( child.length, 2, "Make sure that two non-JavaScript script tags are left." );
+	equal( child[0].type, "something/else", "Verify type of script tag." );
+	equal( child[1].type, "something/else", "Verify type of script tag." );
+
+	jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
+	jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
+	jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
+
+	jQuery("#qunit-fixture").html(valueObj("<script type='text/javascript'>ok( true, 'jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (1)' );</script>"));
+
+	jQuery("#qunit-fixture").html(valueObj("foo <form><script type='text/javascript'>ok( true, 'jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (2)' );</script></form>"));
+
+	jQuery("#qunit-fixture").html(valueObj("<script>equal(jQuery.scriptorder++, 0, 'Script is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html (even though appears before)')<\/script><span id='scriptorder'><script>equal(jQuery.scriptorder++, 1, 'Script (nested) is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html')<\/script></span><script>equal(jQuery.scriptorder++, 2, 'Script (unnested) is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html')<\/script>"));
+}
+
+test("html(String)", function() {
+	testHtml(bareObj);
+});
+
+test("html(Function)", function() {
+	testHtml(functionReturningObj);
+
+	expect(36);
+
+	QUnit.reset();
+
+	jQuery("#qunit-fixture").html(function(){
+		return jQuery(this).text();
+	});
+
+	ok( !/</.test( jQuery("#qunit-fixture").html() ), "Replace html with text." );
+	ok( jQuery("#qunit-fixture").html().length > 0, "Make sure text exists." );
+});
+
+test("html(Function) with incoming value", function() {
+	expect(20);
+
+	var div = jQuery("#qunit-fixture > div"), old = div.map(function(){ return jQuery(this).html() });
+
+	div.html(function(i, val) {
+		equal( val, old[i], "Make sure the incoming value is correct." );
+		return "<b>test</b>";
+	});
+
+	var pass = true;
+	div.each(function(){
+		if ( this.childNodes.length !== 1 ) {
+			pass = false;
+		}
+	})
+	ok( pass, "Set HTML" );
+
+	QUnit.reset();
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	old = j.map(function(){ return jQuery(this).html(); });
+
+	j.html(function(i, val) {
+		equal( val, old[i], "Make sure the incoming value is correct." );
+		return "<b>bold</b>";
+	});
+
+	// Handle the case where no comment is in the document
+	if ( j.length === 2 ) {
+		equal( null, null, "Make sure the incoming value is correct." );
+	}
+
+	j.find("b").removeData();
+	equal( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" );
+
+	var $div = jQuery("<div />");
+
+	equal( $div.html(function(i, val) {
+		equal( val, "", "Make sure the incoming value is correct." );
+		return 5;
+	}).html(), "5", "Setting a number as html" );
+
+	equal( $div.html(function(i, val) {
+		equal( val, "5", "Make sure the incoming value is correct." );
+		return 0;
+	}).html(), "0", "Setting a zero as html" );
+
+	var $div2 = jQuery("<div/>"), insert = "&lt;div&gt;hello1&lt;/div&gt;";
+	equal( $div2.html(function(i, val) {
+		equal( val, "", "Make sure the incoming value is correct." );
+		return insert;
+	}).html().replace(/>/g, "&gt;"), insert, "Verify escaped insertion." );
+
+	equal( $div2.html(function(i, val) {
+		equal( val.replace(/>/g, "&gt;"), insert, "Make sure the incoming value is correct." );
+		return "x" + insert;
+	}).html().replace(/>/g, "&gt;"), "x" + insert, "Verify escaped insertion." );
+
+	equal( $div2.html(function(i, val) {
+		equal( val.replace(/>/g, "&gt;"), "x" + insert, "Make sure the incoming value is correct." );
+		return " " + insert;
+	}).html().replace(/>/g, "&gt;"), " " + insert, "Verify escaped insertion." );
+});
+
+var testRemove = function(method) {
+	expect(9);
+
+	var first = jQuery("#ap").children(":first");
+	first.data("foo", "bar");
+
+	jQuery("#ap").children()[method]();
+	ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
+	equal( jQuery("#ap").children().length, 0, "Check remove" );
+
+	equal( first.data("foo"), method == "remove" ? null : "bar" );
+
+	QUnit.reset();
+	jQuery("#ap").children()[method]("a");
+	ok( jQuery("#ap").text().length > 10, "Check text is not removed" );
+	equal( jQuery("#ap").children().length, 1, "Check filtered remove" );
+
+	jQuery("#ap").children()[method]("a, code");
+	equal( jQuery("#ap").children().length, 0, "Check multi-filtered remove" );
+
+	// using contents will get comments regular, text, and comment nodes
+	// Handle the case where no comment is in the document
+	ok( jQuery("#nonnodes").contents().length >= 2, "Check node,textnode,comment remove works" );
+	jQuery("#nonnodes").contents()[method]();
+	equal( jQuery("#nonnodes").contents().length, 0, "Check node,textnode,comment remove works" );
+
+	// manually clean up detached elements
+	if (method === "detach") {
+		first.remove();
+	}
+
+	QUnit.reset();
+
+	var count = 0;
+	var first = jQuery("#ap").children(":first");
+	var cleanUp = first.click(function() { count++ })[method]().appendTo("#qunit-fixture").click();
+
+	equal( method == "remove" ? 0 : 1, count );
+
+	// manually clean up detached elements
+	cleanUp.remove();
+};
+
+test("remove()", function() {
+	testRemove("remove");
+});
+
+test("detach()", function() {
+	testRemove("detach");
+});
+
+test("empty()", function() {
+	expect(3);
+	equal( jQuery("#ap").children().empty().text().length, 0, "Check text is removed" );
+	equal( jQuery("#ap").children().length, 4, "Check elements are not removed" );
+
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	j.empty();
+	equal( j.html(), "", "Check node,textnode,comment empty works" );
+});
+
+test("jQuery.cleanData", function() {
+	expect(14);
+
+	var type, pos, div, child;
+
+	type = "remove";
+
+	// Should trigger 4 remove event
+	div = getDiv().remove();
+
+	// Should both do nothing
+	pos = "Outer";
+	div.trigger("click");
+
+	pos = "Inner";
+	div.children().trigger("click");
+
+	type = "empty";
+	div = getDiv();
+	child = div.children();
+
+	// Should trigger 2 remove event
+	div.empty();
+
+	// Should trigger 1
+	pos = "Outer";
+	div.trigger("click");
+
+	// Should do nothing
+	pos = "Inner";
+	child.trigger("click");
+
+	// Should trigger 2
+	div.remove();
+
+	type = "html";
+
+	div = getDiv();
+	child = div.children();
+
+	// Should trigger 2 remove event
+	div.html("<div></div>");
+
+	// Should trigger 1
+	pos = "Outer";
+	div.trigger("click");
+
+	// Should do nothing
+	pos = "Inner";
+	child.trigger("click");
+
+	// Should trigger 2
+	div.remove();
+
+	function getDiv() {
+		var div = jQuery("<div class='outer'><div class='inner'></div></div>").click(function(){
+			ok( true, type + " " + pos + " Click event fired." );
+		}).focus(function(){
+			ok( true, type + " " + pos + " Focus event fired." );
+		}).find("div").click(function(){
+			ok( false, type + " " + pos + " Click event fired." );
+		}).focus(function(){
+			ok( false, type + " " + pos + " Focus event fired." );
+		}).end().appendTo("body");
+
+		div[0].detachEvent = div[0].removeEventListener = function(t){
+			ok( true, type + " Outer " + t + " event unbound" );
+		};
+
+		div[0].firstChild.detachEvent = div[0].firstChild.removeEventListener = function(t){
+			ok( true, type + " Inner " + t + " event unbound" );
+		};
+
+		return div;
+	}
+});
+
+test("jQuery.buildFragment - no plain-text caching (Bug #6779)", function() {
+	expect(1);
+
+	// DOM manipulation fails if added text matches an Object method
+	var $f = jQuery( "<div />" ).appendTo( "#qunit-fixture" ),
+		bad = [ "start-", "toString", "hasOwnProperty", "append", "here&there!", "-end" ];
+
+	for ( var i=0; i < bad.length; i++ ) {
+		try {
+			$f.append( bad[i] );
+		}
+		catch(e) {}
+	}
+	equal($f.text(), bad.join(""), "Cached strings that match Object properties");
+	$f.remove();
+});
+
+test( "jQuery.html - execute scripts escaped with html comment or CDATA (#9221)", function() {
+	expect( 3 );
+	jQuery( [
+	         '<script type="text/javascript">',
+	         '<!--',
+	         'ok( true, "<!-- handled" );',
+	         '//-->',
+	         '</script>'
+	     ].join ( "\n" ) ).appendTo( "#qunit-fixture" );
+	jQuery( [
+	         '<script type="text/javascript">',
+	         '<![CDATA[',
+	         'ok( true, "<![CDATA[ handled" );',
+	         '//]]>',
+	         '</script>'
+	     ].join ( "\n" ) ).appendTo( "#qunit-fixture" );
+	jQuery( [
+	         '<script type="text/javascript">',
+	         '<!--//--><![CDATA[//><!--',
+	         'ok( true, "<!--//--><![CDATA[//><!-- (Drupal case) handled" );',
+	         '//--><!]]>',
+	         '</script>'
+	     ].join ( "\n" ) ).appendTo( "#qunit-fixture" );
+});
+
+test("jQuery.buildFragment - plain objects are not a document #8950", function() {
+	expect(1);
+
+	try {
+		jQuery('<input type="hidden">', {});
+		ok( true, "Does not allow attribute object to be treated like a doc object");
+	} catch (e) {}
+
+});
+
+test("jQuery.clone - no exceptions for object elements #9587", function() {
+	expect(1);
+
+	try {
+		jQuery("#no-clone-exception").clone();
+		ok( true, "cloned with no exceptions" );
+	} catch( e ) {
+		ok( false, e.message );
+	}
+});
+
+test("jQuery(<tag>) & wrap[Inner/All]() handle unknown elems (#10667)", function() {
+	expect(2);
+
+	var $wraptarget = jQuery( "<div id='wrap-target'>Target</div>" ).appendTo( "#qunit-fixture" ),
+			$section = jQuery( "<section>" ).appendTo( "#qunit-fixture" );
+
+	$wraptarget.wrapAll("<aside style='background-color:green'></aside>");
+
+	notEqual( $wraptarget.parent("aside").css("background-color"), "transparent", "HTML5 elements created with wrapAll inherit styles" );
+	notEqual( $section.css("background-color"), "transparent", "HTML5 elements create with jQuery( string ) inherit styles" );
+});
+
+test("Cloned, detached HTML5 elems (#10667,10670)", function() {
+	expect(7);
+
+	var $section = jQuery( "<section>" ).appendTo( "#qunit-fixture" ),
+			$clone;
+
+	// First clone
+	$clone = $section.clone();
+
+	// Infer that the test is being run in IE<=8
+	if ( $clone[0].outerHTML && !jQuery.support.opacity ) {
+		// This branch tests cloning nodes by reading the outerHTML, used only in IE<=8
+		equal( $clone[0].outerHTML, "<section></section>", "detached clone outerHTML matches '<section></section>'" );
+	} else {
+		// This branch tests a known behaviour in modern browsers that should never fail.
+		// Included for expected test count symmetry (expecting 1)
+		equal( $clone[0].nodeName, "SECTION", "detached clone nodeName matches 'SECTION' in modern browsers" );
+	}
+
+	// Bind an event
+	$section.bind( "click", function( event ) {
+		ok( true, "clone fired event" );
+	});
+
+	// Second clone (will have an event bound)
+	$clone = $section.clone( true );
+
+	// Trigger an event from the first clone
+	$clone.trigger( "click" );
+	$clone.unbind( "click" );
+
+	// Add a child node with text to the original
+	$section.append( "<p>Hello</p>" );
+
+	// Third clone (will have child node and text)
+	$clone = $section.clone( true );
+
+	equal( $clone.find("p").text(), "Hello", "Assert text in child of clone" );
+
+	// Trigger an event from the third clone
+	$clone.trigger( "click" );
+	$clone.unbind( "click" );
+
+	// Add attributes to copy
+	$section.attr({
+		"class": "foo bar baz",
+		"title": "This is a title"
+	});
+
+	// Fourth clone (will have newly added attributes)
+	$clone = $section.clone( true );
+
+	equal( $clone.attr("class"), $section.attr("class"), "clone and element have same class attribute" );
+	equal( $clone.attr("title"), $section.attr("title"), "clone and element have same title attribute" );
+
+	// Remove the original
+	$section.remove();
+
+	// Clone the clone
+	$section = $clone.clone( true );
+
+	// Remove the clone
+	$clone.remove();
+
+	// Trigger an event from the clone of the clone
+	$section.trigger( "click" );
+
+	// Unbind any remaining events
+	$section.unbind( "click" );
+	$clone.unbind( "click" );
+});
+
+test("jQuery.fragments cache expectations", function() {
+
+	expect( 10 );
+
+	jQuery.fragments = {};
+
+	function fragmentCacheSize() {
+		var n = 0, c;
+
+		for ( c in jQuery.fragments ) {
+			n++;
+		}
+		return n;
+	}
+
+	jQuery("<li></li>");
+	jQuery("<li>?</li>");
+	jQuery("<li>whip</li>");
+	jQuery("<li>it</li>");
+	jQuery("<li>good</li>");
+	jQuery("<div></div>");
+	jQuery("<div><div><span></span></div></div>");
+	jQuery("<tr><td></td></tr>");
+	jQuery("<tr><td></tr>");
+	jQuery("<li>aaa</li>");
+	jQuery("<ul><li>?</li></ul>");
+	jQuery("<div><p>arf</p>nnn</div>");
+	jQuery("<div><p>dog</p>?</div>");
+	jQuery("<span><span>");
+
+	equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 1" );
+
+	jQuery.each( [
+		"<tr><td></td></tr>",
+		"<ul><li>?</li></ul>",
+		"<div><p>dog</p>?</div>",
+		"<span><span>"
+	], function( i, frag ) {
+
+		jQuery( frag );
+
+		equal( jQuery.fragments[ frag ].nodeType, 11, "Second call with " + frag + " creates a cached DocumentFragment, has nodeType 11" );
+		ok( jQuery.fragments[ frag ].childNodes.length, "Second call with " + frag + " creates a cached DocumentFragment, has childNodes with length" );
+	});
+
+	equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 2" );
+});

+ 642 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/jquery-1.7.1/unit/traversing.js

@@ -0,0 +1,642 @@
+module("traversing", { teardown: moduleTeardown });
+
+test("find(String)", function() {
+	expect(5);
+	equal( "Yahoo", jQuery("#foo").find(".blogTest").text(), "Check for find" );
+
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	equal( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" );
+
+	deepEqual( jQuery("#qunit-fixture").find("> div").get(), q("foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest"), "find child elements" );
+	deepEqual( jQuery("#qunit-fixture").find("> #foo, > #moretests").get(), q("foo", "moretests"), "find child elements" );
+	deepEqual( jQuery("#qunit-fixture").find("> #foo > p").get(), q("sndp", "en", "sap"), "find child elements" );
+});
+
+test("find(node|jQuery object)", function() {
+	expect( 11 );
+
+	var $foo = jQuery("#foo"),
+		$blog = jQuery(".blogTest"),
+		$first = jQuery("#first"),
+		$two = $blog.add( $first ),
+		$fooTwo = $foo.add( $blog );
+
+	equal( $foo.find( $blog ).text(), "Yahoo", "Find with blog jQuery object" );
+	equal( $foo.find( $blog[0] ).text(), "Yahoo", "Find with blog node" );
+	equal( $foo.find( $first ).length, 0, "#first is not in #foo" );
+	equal( $foo.find( $first[0]).length, 0, "#first not in #foo (node)" );
+	ok( $foo.find( $two ).is(".blogTest"), "Find returns only nodes within #foo" );
+	ok( $fooTwo.find( $blog ).is(".blogTest"), "Blog is part of the collection, but also within foo" );
+	ok( $fooTwo.find( $blog[0] ).is(".blogTest"), "Blog is part of the collection, but also within foo(node)" );
+
+	equal( $two.find( $foo ).length, 0, "Foo is not in two elements" );
+	equal( $two.find( $foo[0] ).length, 0, "Foo is not in two elements(node)" );
+	equal( $two.find( $first ).length, 0, "first is in the collection and not within two" );
+	equal( $two.find( $first ).length, 0, "first is in the collection and not within two(node)" );
+
+});
+
+test("is(String|undefined)", function() {
+	expect(29);
+	ok( jQuery("#form").is("form"), "Check for element: A form must be a form" );
+	ok( !jQuery("#form").is("div"), "Check for element: A form is not a div" );
+	ok( jQuery("#mark").is(".blog"), "Check for class: Expected class 'blog'" );
+	ok( !jQuery("#mark").is(".link"), "Check for class: Did not expect class 'link'" );
+	ok( jQuery("#simon").is(".blog.link"), "Check for multiple classes: Expected classes 'blog' and 'link'" );
+	ok( !jQuery("#simon").is(".blogTest"), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" );
+	ok( jQuery("#en").is("[lang=\"en\"]"), "Check for attribute: Expected attribute lang to be 'en'" );
+	ok( !jQuery("#en").is("[lang=\"de\"]"), "Check for attribute: Expected attribute lang to be 'en', not 'de'" );
+	ok( jQuery("#text1").is("[type=\"text\"]"), "Check for attribute: Expected attribute type to be 'text'" );
+	ok( !jQuery("#text1").is("[type=\"radio\"]"), "Check for attribute: Expected attribute type to be 'text', not 'radio'" );
+	ok( jQuery("#text2").is(":disabled"), "Check for pseudoclass: Expected to be disabled" );
+	ok( !jQuery("#text1").is(":disabled"), "Check for pseudoclass: Expected not disabled" );
+	ok( jQuery("#radio2").is(":checked"), "Check for pseudoclass: Expected to be checked" );
+	ok( !jQuery("#radio1").is(":checked"), "Check for pseudoclass: Expected not checked" );
+	ok( jQuery("#foo").is(":has(p)"), "Check for child: Expected a child 'p' element" );
+	ok( !jQuery("#foo").is(":has(ul)"), "Check for child: Did not expect 'ul' element" );
+	ok( jQuery("#foo").is(":has(p):has(a):has(code)"), "Check for childs: Expected 'p', 'a' and 'code' child elements" );
+	ok( !jQuery("#foo").is(":has(p):has(a):has(code):has(ol)"), "Check for childs: Expected 'p', 'a' and 'code' child elements, but no 'ol'" );
+
+	ok( !jQuery("#foo").is(0), "Expected false for an invalid expression - 0" );
+	ok( !jQuery("#foo").is(null), "Expected false for an invalid expression - null" );
+	ok( !jQuery("#foo").is(""), "Expected false for an invalid expression - \"\"" );
+	ok( !jQuery("#foo").is(undefined), "Expected false for an invalid expression - undefined" );
+	ok( !jQuery("#foo").is({ plain: "object" }), "Check passing invalid object" );
+
+	// test is() with comma-seperated expressions
+	ok( jQuery("#en").is("[lang=\"en\"],[lang=\"de\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
+	ok( jQuery("#en").is("[lang=\"de\"],[lang=\"en\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
+	ok( jQuery("#en").is("[lang=\"en\"] , [lang=\"de\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
+	ok( jQuery("#en").is("[lang=\"de\"] , [lang=\"en\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" );
+
+	ok( !jQuery(window).is('a'), "Checking is on a window does not throw an exception(#10178)" );
+	ok( !jQuery(document).is('a'), "Checking is on a document does not throw an exception(#10178)" );
+});
+
+test("is(jQuery)", function() {
+	expect(21);
+	ok( jQuery("#form").is( jQuery("form") ), "Check for element: A form is a form" );
+	ok( !jQuery("#form").is( jQuery("div") ), "Check for element: A form is not a div" );
+	ok( jQuery("#mark").is( jQuery(".blog") ), "Check for class: Expected class 'blog'" );
+	ok( !jQuery("#mark").is( jQuery(".link") ), "Check for class: Did not expect class 'link'" );
+	ok( jQuery("#simon").is( jQuery(".blog.link") ), "Check for multiple classes: Expected classes 'blog' and 'link'" );
+	ok( !jQuery("#simon").is( jQuery(".blogTest") ), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" );
+	ok( jQuery("#en").is( jQuery("[lang=\"en\"]") ), "Check for attribute: Expected attribute lang to be 'en'" );
+	ok( !jQuery("#en").is( jQuery("[lang=\"de\"]") ), "Check for attribute: Expected attribute lang to be 'en', not 'de'" );
+	ok( jQuery("#text1").is( jQuery("[type=\"text\"]") ), "Check for attribute: Expected attribute type to be 'text'" );
+	ok( !jQuery("#text1").is( jQuery("[type=\"radio\"]") ), "Check for attribute: Expected attribute type to be 'text', not 'radio'" );
+	ok( !jQuery("#text1").is( jQuery("input:disabled") ), "Check for pseudoclass: Expected not disabled" );
+	ok( jQuery("#radio2").is( jQuery("input:checked") ), "Check for pseudoclass: Expected to be checked" );
+	ok( !jQuery("#radio1").is( jQuery("input:checked") ), "Check for pseudoclass: Expected not checked" );
+	ok( jQuery("#foo").is( jQuery("div:has(p)") ), "Check for child: Expected a child 'p' element" );
+	ok( !jQuery("#foo").is( jQuery("div:has(ul)") ), "Check for child: Did not expect 'ul' element" );
+
+	// Some raw elements
+	ok( jQuery("#form").is( jQuery("form")[0] ), "Check for element: A form is a form" );
+	ok( !jQuery("#form").is( jQuery("div")[0] ), "Check for element: A form is not a div" );
+	ok( jQuery("#mark").is( jQuery(".blog")[0] ), "Check for class: Expected class 'blog'" );
+	ok( !jQuery("#mark").is( jQuery(".link")[0] ), "Check for class: Did not expect class 'link'" );
+	ok( jQuery("#simon").is( jQuery(".blog.link")[0] ), "Check for multiple classes: Expected classes 'blog' and 'link'" );
+	ok( !jQuery("#simon").is( jQuery(".blogTest")[0] ), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" );
+});
+
+test("is() with positional selectors", function() {
+	expect(23);
+
+	var html = jQuery(
+				'<p id="posp"><a class="firsta" href="#"><em>first</em></a><a class="seconda" href="#"><b>test</b></a><em></em></p>'
+			).appendTo( "body" ),
+		isit = function(sel, match, expect) {
+			equal( jQuery( sel ).is( match ), expect, "jQuery( " + sel + " ).is( " + match + " )" );
+		};
+
+	isit( "#posp", "#posp:first", true );
+	isit( "#posp", "#posp:eq(2)", false );
+	isit( "#posp", "#posp a:first", false );
+
+	isit( "#posp .firsta", "#posp a:first", true );
+	isit( "#posp .firsta", "#posp a:last", false );
+	isit( "#posp .firsta", "#posp a:even", true );
+	isit( "#posp .firsta", "#posp a:odd", false );
+	isit( "#posp .firsta", "#posp a:eq(0)", true );
+	isit( "#posp .firsta", "#posp a:eq(9)", false );
+	isit( "#posp .firsta", "#posp em:eq(0)", false );
+	isit( "#posp .firsta", "#posp em:first", false );
+	isit( "#posp .firsta", "#posp:first", false );
+
+	isit( "#posp .seconda", "#posp a:first", false );
+	isit( "#posp .seconda", "#posp a:last", true );
+	isit( "#posp .seconda", "#posp a:gt(0)", true );
+	isit( "#posp .seconda", "#posp a:lt(5)", true );
+	isit( "#posp .seconda", "#posp a:lt(1)", false );
+
+	isit( "#posp em", "#posp a:eq(0) em", true );
+	isit( "#posp em", "#posp a:lt(1) em", true );
+	isit( "#posp em", "#posp a:gt(1) em", false );
+	isit( "#posp em", "#posp a:first em", true );
+	isit( "#posp em", "#posp a em:last", true );
+	isit( "#posp em", "#posp a em:eq(2)", false );
+
+	html.remove();
+});
+
+test("index()", function() {
+	expect( 2 );
+
+	equal( jQuery("#text2").index(), 2, "Returns the index of a child amongst its siblings" );
+
+	equal( jQuery("<div/>").index(), -1, "Node without parent returns -1" );
+});
+
+test("index(Object|String|undefined)", function() {
+	expect(16);
+
+	var elements = jQuery([window, document]),
+		inputElements = jQuery("#radio1,#radio2,#check1,#check2");
+
+	// Passing a node
+	equal( elements.index(window), 0, "Check for index of elements" );
+	equal( elements.index(document), 1, "Check for index of elements" );
+	equal( inputElements.index(document.getElementById("radio1")), 0, "Check for index of elements" );
+	equal( inputElements.index(document.getElementById("radio2")), 1, "Check for index of elements" );
+	equal( inputElements.index(document.getElementById("check1")), 2, "Check for index of elements" );
+	equal( inputElements.index(document.getElementById("check2")), 3, "Check for index of elements" );
+	equal( inputElements.index(window), -1, "Check for not found index" );
+	equal( inputElements.index(document), -1, "Check for not found index" );
+
+	// Passing a jQuery object
+	// enabled since [5500]
+	equal( elements.index( elements ), 0, "Pass in a jQuery object" );
+	equal( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" );
+	equal( jQuery("#form :radio").index( jQuery("#radio2") ), 1, "Pass in a jQuery object" );
+
+	// Passing a selector or nothing
+	// enabled since [6330]
+	equal( jQuery("#text2").index(), 2, "Check for index amongst siblings" );
+	equal( jQuery("#form").children().eq(4).index(), 4, "Check for index amongst siblings" );
+	equal( jQuery("#radio2").index("#form :radio") , 1, "Check for index within a selector" );
+	equal( jQuery("#form :radio").index( jQuery("#radio2") ), 1, "Check for index within a selector" );
+	equal( jQuery("#radio2").index("#form :text") , -1, "Check for index not found within a selector" );
+});
+
+test("filter(Selector|undefined)", function() {
+	expect(9);
+	deepEqual( jQuery("#form input").filter(":checked").get(), q("radio2", "check1"), "filter(String)" );
+	deepEqual( jQuery("p").filter("#ap, #sndp").get(), q("ap", "sndp"), "filter('String, String')" );
+	deepEqual( jQuery("p").filter("#ap,#sndp").get(), q("ap", "sndp"), "filter('String,String')" );
+
+	deepEqual( jQuery("p").filter(null).get(),      [], "filter(null) should return an empty jQuery object");
+	deepEqual( jQuery("p").filter(undefined).get(), [], "filter(undefined) should return an empty jQuery object");
+	deepEqual( jQuery("p").filter(0).get(),         [], "filter(0) should return an empty jQuery object");
+	deepEqual( jQuery("p").filter("").get(),        [], "filter('') should return an empty jQuery object");
+
+	// using contents will get comments regular, text, and comment nodes
+	var j = jQuery("#nonnodes").contents();
+	equal( j.filter("span").length, 1, "Check node,textnode,comment to filter the one span" );
+	equal( j.filter("[name]").length, 0, "Check node,textnode,comment to filter the one span" );
+});
+
+test("filter(Function)", function() {
+	expect(2);
+
+	deepEqual( jQuery("#qunit-fixture p").filter(function() { return !jQuery("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );
+
+	deepEqual( jQuery("#qunit-fixture p").filter(function(i, elem) { return !jQuery("a", elem).length }).get(), q("sndp", "first"), "filter(Function) using arg" );
+});
+
+test("filter(Element)", function() {
+	expect(1);
+
+	var element = document.getElementById("text1");
+	deepEqual( jQuery("#form input").filter(element).get(), q("text1"), "filter(Element)" );
+});
+
+test("filter(Array)", function() {
+	expect(1);
+
+	var elements = [ document.getElementById("text1") ];
+	deepEqual( jQuery("#form input").filter(elements).get(), q("text1"), "filter(Element)" );
+});
+
+test("filter(jQuery)", function() {
+	expect(1);
+
+	var elements = jQuery("#text1");
+	deepEqual( jQuery("#form input").filter(elements).get(), q("text1"), "filter(Element)" );
+});
+
+
+test("filter() with positional selectors", function() {
+	expect(19);
+
+	var html = jQuery('' +
+		'<p id="posp">' +
+			'<a class="firsta" href="#">' +
+				'<em>first</em>' +
+			'</a>' +
+			'<a class="seconda" href="#">' +
+				'<b>test</b>' +
+			'</a>' +
+			'<em></em>' +
+		'</p>').appendTo( "body" ),
+		filterit = function(sel, filter, length) {
+			equal( jQuery( sel ).filter( filter ).length, length, "jQuery( " + sel + " ).filter( " + filter + " )" );
+		};
+
+	filterit( "#posp", "#posp:first", 1);
+	filterit( "#posp", "#posp:eq(2)", 0 );
+	filterit( "#posp", "#posp a:first", 0 );
+
+	// Keep in mind this is within the selection and
+	// not in relation to other elements (.is() is a different story)
+	filterit( "#posp .firsta", "#posp a:first", 1 );
+	filterit( "#posp .firsta", "#posp a:last", 1 );
+	filterit( "#posp .firsta", "#posp a:last-child", 0 );
+	filterit( "#posp .firsta", "#posp a:even", 1 );
+	filterit( "#posp .firsta", "#posp a:odd", 0 );
+	filterit( "#posp .firsta", "#posp a:eq(0)", 1 );
+	filterit( "#posp .firsta", "#posp a:eq(9)", 0 );
+	filterit( "#posp .firsta", "#posp em:eq(0)", 0 );
+	filterit( "#posp .firsta", "#posp em:first", 0 );
+	filterit( "#posp .firsta", "#posp:first", 0 );
+
+	filterit( "#posp .seconda", "#posp a:first", 1 );
+	filterit( "#posp .seconda", "#posp em:first", 0 );
+	filterit( "#posp .seconda", "#posp a:last", 1 );
+	filterit( "#posp .seconda", "#posp a:gt(0)", 0 );
+	filterit( "#posp .seconda", "#posp a:lt(5)", 1 );
+	filterit( "#posp .seconda", "#posp a:lt(1)", 1 );
+	html.remove();
+});
+
+test("closest()", function() {
+	expect(13);
+	deepEqual( jQuery("body").closest("body").get(), q("body"), "closest(body)" );
+	deepEqual( jQuery("body").closest("html").get(), q("html"), "closest(html)" );
+	deepEqual( jQuery("body").closest("div").get(), [], "closest(div)" );
+	deepEqual( jQuery("#qunit-fixture").closest("span,#html").get(), q("html"), "closest(span,#html)" );
+
+	deepEqual( jQuery("div:eq(1)").closest("div:first").get(), [], "closest(div:first)" );
+	deepEqual( jQuery("div").closest("body:first div:last").get(), q("fx-tests"), "closest(body:first div:last)" );
+
+	// Test .closest() limited by the context
+	var jq = jQuery("#nothiddendivchild");
+	deepEqual( jq.closest("html", document.body).get(), [], "Context limited." );
+	deepEqual( jq.closest("body", document.body).get(), [], "Context limited." );
+	deepEqual( jq.closest("#nothiddendiv", document.body).get(), q("nothiddendiv"), "Context not reached." );
+
+	//Test that .closest() returns unique'd set
+	equal( jQuery("#qunit-fixture p").closest("#qunit-fixture").length, 1, "Closest should return a unique set" );
+
+	// Test on disconnected node
+	equal( jQuery("<div><p></p></div>").find("p").closest("table").length, 0, "Make sure disconnected closest work." );
+
+	// Bug #7369
+	equal( jQuery("<div foo='bar'></div>").closest("[foo]").length, 1, "Disconnected nodes with attribute selector" );
+	equal( jQuery("<div>text</div>").closest("[lang]").length, 0, "Disconnected nodes with text and non-existent attribute selector" );
+});
+
+test("closest(Array)", function() {
+	expect(7);
+	deepEqual( jQuery("body").closest(["body"]), [{selector:"body", elem:document.body, level:1}], "closest([body])" );
+	deepEqual( jQuery("body").closest(["html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([html])" );
+	deepEqual( jQuery("body").closest(["div"]), [], "closest([div])" );
+	deepEqual( jQuery("#yahoo").closest(["div"]), [{"selector":"div", "elem": document.getElementById("foo"), "level": 3}, { "selector": "div", "elem": document.getElementById("qunit-fixture"), "level": 4 }], "closest([div])" );
+	deepEqual( jQuery("#qunit-fixture").closest(["span,#html"]), [{selector:"span,#html", elem:document.documentElement, level:4}], "closest([span,#html])" );
+
+	deepEqual( jQuery("body").closest(["body","html"]), [{selector:"body", elem:document.body, level:1}, {selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" );
+	deepEqual( jQuery("body").closest(["span","html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" );
+});
+
+test("closest(jQuery)", function() {
+	expect(8);
+	var $child = jQuery("#nothiddendivchild"),
+		$parent = jQuery("#nothiddendiv"),
+		$main = jQuery("#qunit-fixture"),
+		$body = jQuery("body");
+	ok( $child.closest( $parent ).is("#nothiddendiv"), "closest( jQuery('#nothiddendiv') )" );
+	ok( $child.closest( $parent[0] ).is("#nothiddendiv"), "closest( jQuery('#nothiddendiv') ) :: node" );
+	ok( $child.closest( $child ).is("#nothiddendivchild"), "child is included" );
+	ok( $child.closest( $child[0] ).is("#nothiddendivchild"), "child is included  :: node" );
+	equal( $child.closest( document.createElement("div") ).length, 0, "created element is not related" );
+	equal( $child.closest( $main ).length, 0, "Main not a parent of child" );
+	equal( $child.closest( $main[0] ).length, 0, "Main not a parent of child :: node" );
+	ok( $child.closest( $body.add($parent) ).is("#nothiddendiv"), "Closest ancestor retrieved." );
+});
+
+test("not(Selector|undefined)", function() {
+	expect(11);
+	equal( jQuery("#qunit-fixture > p#ap > a").not("#google").length, 2, "not('selector')" );
+	deepEqual( jQuery("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" );
+	deepEqual( jQuery("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" );
+	deepEqual( jQuery("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d", "option3e", "option4e","option5b"), "not('complex selector')");
+
+	deepEqual( jQuery("#ap *").not("code").get(), q("google", "groups", "anchor1", "mark"), "not('tag selector')" );
+	deepEqual( jQuery("#ap *").not("code, #mark").get(), q("google", "groups", "anchor1"), "not('tag, ID selector')" );
+	deepEqual( jQuery("#ap *").not("#mark, code").get(), q("google", "groups", "anchor1"), "not('ID, tag selector')");
+
+	var all = jQuery("p").get();
+	deepEqual( jQuery("p").not(null).get(),      all, "not(null) should have no effect");
+	deepEqual( jQuery("p").not(undefined).get(), all, "not(undefined) should have no effect");
+	deepEqual( jQuery("p").not(0).get(),         all, "not(0) should have no effect");
+	deepEqual( jQuery("p").not("").get(),        all, "not('') should have no effect");
+});
+
+test("not(Element)", function() {
+	expect(1);
+
+	var selects = jQuery("#form select");
+	deepEqual( selects.not( selects[1] ).get(), q("select1", "select3", "select4", "select5"), "filter out DOM element");
+});
+
+test("not(Function)", function() {
+	deepEqual( jQuery("#qunit-fixture p").not(function() { return jQuery("a", this).length }).get(), q("sndp", "first"), "not(Function)" );
+});
+
+test("not(Array)", function() {
+	expect(2);
+
+	equal( jQuery("#qunit-fixture > p#ap > a").not(document.getElementById("google")).length, 2, "not(DOMElement)" );
+	equal( jQuery("p").not(document.getElementsByTagName("p")).length, 0, "not(Array-like DOM collection)" );
+});
+
+test("not(jQuery)", function() {
+	expect(1);
+
+	deepEqual( jQuery("p").not(jQuery("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" );
+});
+
+test("has(Element)", function() {
+	expect(2);
+
+	var obj = jQuery("#qunit-fixture").has(jQuery("#sndp")[0]);
+	deepEqual( obj.get(), q("qunit-fixture"), "Keeps elements that have the element as a descendant" );
+
+	var multipleParent = jQuery("#qunit-fixture, #header").has(jQuery("#sndp")[0]);
+	deepEqual( obj.get(), q("qunit-fixture"), "Does not include elements that do not have the element as a descendant" );
+});
+
+test("has(Selector)", function() {
+	expect(3);
+
+	var obj = jQuery("#qunit-fixture").has("#sndp");
+	deepEqual( obj.get(), q("qunit-fixture"), "Keeps elements that have any element matching the selector as a descendant" );
+
+	var multipleParent = jQuery("#qunit-fixture, #header").has("#sndp");
+	deepEqual( obj.get(), q("qunit-fixture"), "Does not include elements that do not have the element as a descendant" );
+
+	var multipleHas = jQuery("#qunit-fixture").has("#sndp, #first");
+	deepEqual( multipleHas.get(), q("qunit-fixture"), "Only adds elements once" );
+});
+
+test("has(Arrayish)", function() {
+	expect(3);
+
+	var simple = jQuery("#qunit-fixture").has(jQuery("#sndp"));
+	deepEqual( simple.get(), q("qunit-fixture"), "Keeps elements that have any element in the jQuery list as a descendant" );
+
+	var multipleParent = jQuery("#qunit-fixture, #header").has(jQuery("#sndp"));
+	deepEqual( multipleParent.get(), q("qunit-fixture"), "Does not include elements that do not have an element in the jQuery list as a descendant" );
+
+	var multipleHas = jQuery("#qunit-fixture").has(jQuery("#sndp, #first"));
+	deepEqual( simple.get(), q("qunit-fixture"), "Only adds elements once" );
+});
+
+test("andSelf()", function() {
+	expect(4);
+	deepEqual( jQuery("#en").siblings().andSelf().get(), q("sndp", "en", "sap"), "Check for siblings and self" );
+	deepEqual( jQuery("#foo").children().andSelf().get(), q("foo", "sndp", "en", "sap"), "Check for children and self" );
+	deepEqual( jQuery("#sndp, #en").parent().andSelf().get(), q("foo","sndp","en"), "Check for parent and self" );
+	deepEqual( jQuery("#groups").parents("p, div").andSelf().get(), q("qunit-fixture", "ap", "groups"), "Check for parents and self" );
+});
+
+test("siblings([String])", function() {
+	expect(6);
+	deepEqual( jQuery("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" );
+	deepEqual( jQuery("#sndp").siblings(":has(code)").get(), q("sap"), "Check for filtered siblings (has code child element)" );
+	deepEqual( jQuery("#sndp").siblings(":has(a)").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" );
+	deepEqual( jQuery("#foo").siblings("form, b").get(), q("form", "floatTest", "lengthtest", "name-tests", "testForm"), "Check for multiple filters" );
+	var set = q("sndp", "en", "sap");
+	deepEqual( jQuery("#en, #sndp").siblings().get(), set, "Check for unique results from siblings" );
+	deepEqual( jQuery("#option5a").siblings("option[data-attr]").get(), q("option5c"), "Has attribute selector in siblings (#9261)" );
+});
+
+test("children([String])", function() {
+	expect(3);
+	deepEqual( jQuery("#foo").children().get(), q("sndp", "en", "sap"), "Check for children" );
+	deepEqual( jQuery("#foo").children(":has(code)").get(), q("sndp", "sap"), "Check for filtered children" );
+	deepEqual( jQuery("#foo").children("#en, #sap").get(), q("en", "sap"), "Check for multiple filters" );
+});
+
+test("parent([String])", function() {
+	expect(5);
+	equal( jQuery("#groups").parent()[0].id, "ap", "Simple parent check" );
+	equal( jQuery("#groups").parent("p")[0].id, "ap", "Filtered parent check" );
+	equal( jQuery("#groups").parent("div").length, 0, "Filtered parent check, no match" );
+	equal( jQuery("#groups").parent("div, p")[0].id, "ap", "Check for multiple filters" );
+	deepEqual( jQuery("#en, #sndp").parent().get(), q("foo"), "Check for unique results from parent" );
+});
+
+test("parents([String])", function() {
+	expect(5);
+	equal( jQuery("#groups").parents()[0].id, "ap", "Simple parents check" );
+	equal( jQuery("#groups").parents("p")[0].id, "ap", "Filtered parents check" );
+	equal( jQuery("#groups").parents("div")[0].id, "qunit-fixture", "Filtered parents check2" );
+	deepEqual( jQuery("#groups").parents("p, div").get(), q("ap", "qunit-fixture"), "Check for multiple filters" );
+	deepEqual( jQuery("#en, #sndp").parents().get(), q("foo", "qunit-fixture", "dl", "body", "html"), "Check for unique results from parents" );
+});
+
+test("parentsUntil([String])", function() {
+	expect(9);
+
+	var parents = jQuery("#groups").parents();
+
+	deepEqual( jQuery("#groups").parentsUntil().get(), parents.get(), "parentsUntil with no selector (nextAll)" );
+	deepEqual( jQuery("#groups").parentsUntil(".foo").get(), parents.get(), "parentsUntil with invalid selector (nextAll)" );
+	deepEqual( jQuery("#groups").parentsUntil("#html").get(), parents.not(":last").get(), "Simple parentsUntil check" );
+	equal( jQuery("#groups").parentsUntil("#ap").length, 0, "Simple parentsUntil check" );
+	deepEqual( jQuery("#groups").parentsUntil("#html, #body").get(), parents.slice( 0, 3 ).get(), "Less simple parentsUntil check" );
+	deepEqual( jQuery("#groups").parentsUntil("#html", "div").get(), jQuery("#qunit-fixture").get(), "Filtered parentsUntil check" );
+	deepEqual( jQuery("#groups").parentsUntil("#html", "p,div,dl").get(), parents.slice( 0, 3 ).get(), "Multiple-filtered parentsUntil check" );
+	equal( jQuery("#groups").parentsUntil("#html", "span").length, 0, "Filtered parentsUntil check, no match" );
+	deepEqual( jQuery("#groups, #ap").parentsUntil("#html", "p,div,dl").get(), parents.slice( 0, 3 ).get(), "Multi-source, multiple-filtered parentsUntil check" );
+});
+
+test("next([String])", function() {
+	expect(4);
+	equal( jQuery("#ap").next()[0].id, "foo", "Simple next check" );
+	equal( jQuery("#ap").next("div")[0].id, "foo", "Filtered next check" );
+	equal( jQuery("#ap").next("p").length, 0, "Filtered next check, no match" );
+	equal( jQuery("#ap").next("div, p")[0].id, "foo", "Multiple filters" );
+});
+
+test("prev([String])", function() {
+	expect(4);
+	equal( jQuery("#foo").prev()[0].id, "ap", "Simple prev check" );
+	equal( jQuery("#foo").prev("p")[0].id, "ap", "Filtered prev check" );
+	equal( jQuery("#foo").prev("div").length, 0, "Filtered prev check, no match" );
+	equal( jQuery("#foo").prev("p, div")[0].id, "ap", "Multiple filters" );
+});
+
+test("nextAll([String])", function() {
+	expect(4);
+
+	var elems = jQuery("#form").children();
+
+	deepEqual( jQuery("#label-for").nextAll().get(), elems.not(":first").get(), "Simple nextAll check" );
+	deepEqual( jQuery("#label-for").nextAll("input").get(), elems.not(":first").filter("input").get(), "Filtered nextAll check" );
+	deepEqual( jQuery("#label-for").nextAll("input,select").get(), elems.not(":first").filter("input,select").get(), "Multiple-filtered nextAll check" );
+	deepEqual( jQuery("#label-for, #hidden1").nextAll("input,select").get(), elems.not(":first").filter("input,select").get(), "Multi-source, multiple-filtered nextAll check" );
+});
+
+test("prevAll([String])", function() {
+	expect(4);
+
+	var elems = jQuery( jQuery("#form").children().slice(0, 12).get().reverse() );
+
+	deepEqual( jQuery("#area1").prevAll().get(), elems.get(), "Simple prevAll check" );
+	deepEqual( jQuery("#area1").prevAll("input").get(), elems.filter("input").get(), "Filtered prevAll check" );
+	deepEqual( jQuery("#area1").prevAll("input,select").get(), elems.filter("input,select").get(), "Multiple-filtered prevAll check" );
+	deepEqual( jQuery("#area1, #hidden1").prevAll("input,select").get(), elems.filter("input,select").get(), "Multi-source, multiple-filtered prevAll check" );
+});
+
+test("nextUntil([String])", function() {
+	expect(11);
+
+	var elems = jQuery("#form").children().slice( 2, 12 );
+
+	deepEqual( jQuery("#text1").nextUntil().get(), jQuery("#text1").nextAll().get(), "nextUntil with no selector (nextAll)" );
+	deepEqual( jQuery("#text1").nextUntil(".foo").get(), jQuery("#text1").nextAll().get(), "nextUntil with invalid selector (nextAll)" );
+	deepEqual( jQuery("#text1").nextUntil("#area1").get(), elems.get(), "Simple nextUntil check" );
+	equal( jQuery("#text1").nextUntil("#text2").length, 0, "Simple nextUntil check" );
+	deepEqual( jQuery("#text1").nextUntil("#area1, #radio1").get(), jQuery("#text1").next().get(), "Less simple nextUntil check" );
+	deepEqual( jQuery("#text1").nextUntil("#area1", "input").get(), elems.not("button").get(), "Filtered nextUntil check" );
+	deepEqual( jQuery("#text1").nextUntil("#area1", "button").get(), elems.not("input").get(), "Filtered nextUntil check" );
+	deepEqual( jQuery("#text1").nextUntil("#area1", "button,input").get(), elems.get(), "Multiple-filtered nextUntil check" );
+	equal( jQuery("#text1").nextUntil("#area1", "div").length, 0, "Filtered nextUntil check, no match" );
+	deepEqual( jQuery("#text1, #hidden1").nextUntil("#area1", "button,input").get(), elems.get(), "Multi-source, multiple-filtered nextUntil check" );
+
+	deepEqual( jQuery("#text1").nextUntil("[class=foo]").get(), jQuery("#text1").nextAll().get(), "Non-element nodes must be skipped, since they have no attributes" );
+});
+
+test("prevUntil([String])", function() {
+	expect(10);
+
+	var elems = jQuery("#area1").prevAll();
+
+	deepEqual( jQuery("#area1").prevUntil().get(), elems.get(), "prevUntil with no selector (prevAll)" );
+	deepEqual( jQuery("#area1").prevUntil(".foo").get(), elems.get(), "prevUntil with invalid selector (prevAll)" );
+	deepEqual( jQuery("#area1").prevUntil("label").get(), elems.not(":last").get(), "Simple prevUntil check" );
+	equal( jQuery("#area1").prevUntil("#button").length, 0, "Simple prevUntil check" );
+	deepEqual( jQuery("#area1").prevUntil("label, #search").get(), jQuery("#area1").prev().get(), "Less simple prevUntil check" );
+	deepEqual( jQuery("#area1").prevUntil("label", "input").get(), elems.not(":last").not("button").get(), "Filtered prevUntil check" );
+	deepEqual( jQuery("#area1").prevUntil("label", "button").get(), elems.not(":last").not("input").get(), "Filtered prevUntil check" );
+	deepEqual( jQuery("#area1").prevUntil("label", "button,input").get(), elems.not(":last").get(), "Multiple-filtered prevUntil check" );
+	equal( jQuery("#area1").prevUntil("label", "div").length, 0, "Filtered prevUntil check, no match" );
+	deepEqual( jQuery("#area1, #hidden1").prevUntil("label", "button,input").get(), elems.not(":last").get(), "Multi-source, multiple-filtered prevUntil check" );
+});
+
+test("contents()", function() {
+	expect(12);
+	equal( jQuery("#ap").contents().length, 9, "Check element contents" );
+	ok( jQuery("#iframe").contents()[0], "Check existance of IFrame document" );
+	var ibody = jQuery("#loadediframe").contents()[0].body;
+	ok( ibody, "Check existance of IFrame body" );
+
+	equal( jQuery("span", ibody).text(), "span text", "Find span in IFrame and check its text" );
+
+	jQuery(ibody).append("<div>init text</div>");
+	equal( jQuery("div", ibody).length, 2, "Check the original div and the new div are in IFrame" );
+
+	equal( jQuery("div:last", ibody).text(), "init text", "Add text to div in IFrame" );
+
+	jQuery("div:last", ibody).text("div text");
+	equal( jQuery("div:last", ibody).text(), "div text", "Add text to div in IFrame" );
+
+	jQuery("div:last", ibody).remove();
+	equal( jQuery("div", ibody).length, 1, "Delete the div and check only one div left in IFrame" );
+
+	equal( jQuery("div", ibody).text(), "span text", "Make sure the correct div is still left after deletion in IFrame" );
+
+	jQuery("<table/>", ibody).append("<tr><td>cell</td></tr>").appendTo(ibody);
+	jQuery("table", ibody).remove();
+	equal( jQuery("div", ibody).length, 1, "Check for JS error on add and delete of a table in IFrame" );
+
+	// using contents will get comments regular, text, and comment nodes
+	var c = jQuery("#nonnodes").contents().contents();
+	equal( c.length, 1, "Check node,textnode,comment contents is just one" );
+	equal( c[0].nodeValue, "hi", "Check node,textnode,comment contents is just the one from span" );
+});
+
+test("add(String|Element|Array|undefined)", function() {
+	expect(16);
+	deepEqual( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );
+	deepEqual( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
+
+	// We no longer support .add(form.elements), unfortunately.
+	// There is no way, in browsers, to reliably determine the difference
+	// between form.elements and form - and doing .add(form) and having it
+	// add the form elements is way to unexpected, so this gets the boot.
+	// ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" );
+
+	// For the time being, we're discontinuing support for jQuery(form.elements) since it's ambiguous in IE
+	// use jQuery([]).add(form.elements) instead.
+	//equal( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" );
+
+	var divs = jQuery("<div/>").add("#sndp");
+	ok( !divs[0].parentNode, "Make sure the first element is still the disconnected node." );
+
+	divs = jQuery("<div>test</div>").add("#sndp");
+	equal( divs[0].parentNode.nodeType, 11, "Make sure the first element is still the disconnected node." );
+
+	divs = jQuery("#sndp").add("<div/>");
+	ok( !divs[1].parentNode, "Make sure the first element is still the disconnected node." );
+
+	var tmp = jQuery("<div/>");
+
+	var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>").appendTo(tmp)).add(jQuery("<p id='x2'>xxx</p>").appendTo(tmp));
+	equal( x[0].id, "x1", "Check on-the-fly element1" );
+	equal( x[1].id, "x2", "Check on-the-fly element2" );
+
+	var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>").appendTo(tmp)[0]).add(jQuery("<p id='x2'>xxx</p>").appendTo(tmp)[0]);
+	equal( x[0].id, "x1", "Check on-the-fly element1" );
+	equal( x[1].id, "x2", "Check on-the-fly element2" );
+
+	var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>")).add(jQuery("<p id='x2'>xxx</p>"));
+	equal( x[0].id, "x1", "Check on-the-fly element1" );
+	equal( x[1].id, "x2", "Check on-the-fly element2" );
+
+	var x = jQuery([]).add("<p id='x1'>xxx</p>").add("<p id='x2'>xxx</p>");
+	equal( x[0].id, "x1", "Check on-the-fly element1" );
+	equal( x[1].id, "x2", "Check on-the-fly element2" );
+
+	var notDefined;
+	equal( jQuery([]).add(notDefined).length, 0, "Check that undefined adds nothing" );
+
+	equal( jQuery([]).add( document.getElementById("form") ).length, 1, "Add a form" );
+	equal( jQuery([]).add( document.getElementById("select1") ).length, 1, "Add a select" );
+});
+
+test("add(String, Context)", function() {
+	expect(6);
+
+	deepEqual( jQuery( "#firstp" ).add( "#ap" ).get(), q( "firstp", "ap" ), "Add selector to selector " );
+	deepEqual( jQuery( document.getElementById("firstp") ).add( "#ap" ).get(), q( "firstp", "ap" ), "Add gEBId to selector" );
+	deepEqual( jQuery( document.getElementById("firstp") ).add( document.getElementById("ap") ).get(), q( "firstp", "ap" ), "Add gEBId to gEBId" );
+
+	var ctx = document.getElementById("firstp");
+	deepEqual( jQuery( "#firstp" ).add( "#ap", ctx ).get(), q( "firstp" ), "Add selector to selector " );
+	deepEqual( jQuery( document.getElementById("firstp") ).add( "#ap", ctx ).get(), q( "firstp" ), "Add gEBId to selector, not in context" );
+	deepEqual( jQuery( document.getElementById("firstp") ).add( "#ap", document.getElementsByTagName("body")[0] ).get(), q( "firstp", "ap" ), "Add gEBId to selector, in context" );
+});
+
+test("eq('-1') #10616", function() {
+	expect(3);
+	var $divs = jQuery( "div" );
+
+	equal( $divs.eq( -1 ).length, 1, "The number -1 returns a selection that has length 1" );
+	equal( $divs.eq( "-1" ).length, 1, "The string '-1' returns a selection that has length 1" );
+	deepEqual( $divs.eq( "-1" ), $divs.eq( -1 ), "String and number -1 match" );
+});
+

+ 99 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/mixed-test.html

@@ -0,0 +1,99 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>IEPP Test Suite</title>
+		<link rel="stylesheet" href="data/inline-mixed-media.css">
+		<link rel="stylesheet" href="data/inline-print-media.css">
+		<link rel="stylesheet" href="data/print.css" media="print">
+		<link rel="stylesheet" href="data/screen.css" media="screen, projection">
+		<link rel="stylesheet" href="data/print-styles.css" media="print">
+		<style>
+			body {
+				background: url(data/body-crash.jpg) no-repeat;
+			}
+		</style>
+		<style>
+			form {
+				margin: 0;
+			}
+			article#inline-print {
+				border: 5px solid #000;
+			}
+			section div article {
+				border: 5px solid #000;
+			}
+			section[data-article="article"] {
+				border: 5px solid #000;
+			}
+		</style>
+		<style media="print">
+			article#inline-print {
+				border: 5px dotted #000;
+			}
+			section div article {
+				border: 5px dotted #000;
+			}
+			section[data-article="article"] {
+				border: 5px dotted #000;
+			}
+			p+article {
+				text-decoration: underline;
+			}
+		</style>
+		<script src="../src/html5shiv-printshiv.js"></script>
+		
+		<script src="//use.typekit.com/fbz1vwc.js"></script>
+		<script>
+			Typekit.load();
+		</script>
+	</head>
+	<body id="print-body-id" class="print-body-class">
+		<h1>
+			Print Me in IE!
+		</h1>
+		<p>You should see dotted broders in print.</p>
+		<article class="inline-mixed-media">
+			<p>
+				1. This text should be underlined in IE7+.
+			</p>
+		</article>
+		<article class="inline-print-media">
+			<form action="/test/ test">
+				<div class="inside-of-form">2. inside print</div>
+			</form>
+		</article>
+		<article class="print">
+			<p>
+				3. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam non
+			</p>
+		</article>
+		<div class="print-styles">
+			<article>
+				<p>
+					4. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam non
+				</p>
+			</article>
+		</div>
+		<article class="print-styles-print">
+			<p>
+				5. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam non
+			</p>
+		</article>
+		<section>
+			<div data-article="article">
+				<article>
+					<p>
+						6. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam non
+					</p>
+
+					<section data-article="article">
+						<p>
+							7. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,  sed diam non
+						</p>
+					</section>
+				</article>
+			</div>
+		</section>
+	</body>
+</html>

+ 78 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/object-test.html

@@ -0,0 +1,78 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>HTML5 Shiv</title>
+		<link rel="stylesheet" href="style.css">
+		<style>
+			.box {
+				position: relative;
+				zoom: 1;
+			}
+			.swf-overlay {
+				position: absolute;
+				top: 0;
+				left: 0;
+				width: 200px;
+				height: 100px;
+				border: 1px solid #000;
+			}
+		</style>
+		<script src="../src/html5shiv.js"></script>
+		<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
+		<script>
+			swfobject.registerObject('static-id', '6.0.0');
+			swfobject.embedSWF('data/paramtracer.swf', 'dynamic-id', '480', '420', '6.0.0', null, { 'aFlashVar': 'aFlashVarValue' }, { 'wmode': 'transparent' });
+		</script>
+	</head>
+	<body>
+		<section>This sentence has 3px solid border <mark>with these words highlighted</mark>.</section>
+		<h1>static swfobject</h1>
+		<div class="box">
+			<object id="static-id" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="420">
+				<param name="movie" value="data/paramtracer.swf">
+				<!--[if !IE]>-->
+					<object type="application/x-shockwave-flash" data="data/paramtracer.swf" width="480" height="420">
+					<!--<![endif]-->
+						<param name="flashvars" value="aFlashVar=aFlashVarValue">
+						<param name="wmode" value="transparent">
+					<!--[if !IE]>-->
+					</object>
+				<!--<![endif]-->
+			</object>
+			<div class="swf-overlay"></div>
+		</div>
+
+		<h1>dynamic swfobject</h1>
+		<div class="box">
+			<div id="dynamic-id">
+			</div>
+			<div class="swf-overlay"></div>
+		</div>
+
+		<h1>innerHTML object</h1>
+		<div class="box" id="checkinner">
+			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="420">
+				<param name="movie" value="data/paramtracer.swf">
+				<!--[if !IE]>-->
+					<object type="application/x-shockwave-flash" data="data/paramtracer.swf" width="480" height="420">
+					<!--<![endif]-->
+						<param name="flashvars" value="aFlashVar=aFlashVarValue">
+						<param name="wmode" value="transparent">
+					<!--[if !IE]>-->
+					</object>
+				<!--<![endif]-->
+			</object>
+			<div class="swf-overlay"></div>
+		</div>
+		<script>
+			(function(){
+				var box = document.getElementById('checkinner');
+				var box2 = document.createElement('div');
+				box2.innerHTML = box.innerHTML;
+				box.innerHTML = '';
+				box.appendChild(box2);
+			})();
+		</script>
+	<body>
+</html>

+ 41 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/perf.1.html

@@ -0,0 +1,41 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>HTML5 Shiv</title>
+		<link rel="stylesheet" href="style.css">
+		<script src="../src/html5shiv-printshiv.js"></script>
+		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
+	</head>
+	<body>
+		<div id="time"></div>
+		<section>This sentence is in a green box <mark>with these words highlighted</mark>.</section>
+		<script>
+			function addDom(){
+				var div, frag, fragDiv, divFrag, divFragDiv;
+				div = document.createElement('div');
+				div.innerHTML = '<section>This native javascript sentence is in a green box <mark>with these words highlighted</mark>?</section>';
+
+				frag = document.createDocumentFragment();
+				frag.appendChild(div);
+				div.innerHTML += '<section>This native javascript sentence is also in a green box <mark>with these words highlighted</mark>?</section>';
+				document.body.appendChild(frag);
+
+				frag = document.createDocumentFragment();
+				fragDiv = frag.appendChild(document.createElement('div'));
+				fragDiv.innerHTML = '<section>This native javascript sentence is in a green box <mark>with these words highlighted</mark>?</section>';
+				document.body.appendChild(fragDiv);
+
+				jQuery(document.body).append('<section>This jQuery 1.6.4 sentence is in a green box <mark>with these words highlighted</mark>?</section><section>This jQuery 1.6.4 sentence is in a green box <mark>with these words highlighted</mark>?</section>');
+			}
+
+			var time = document.getElementById('time');
+			var cur = new Date().getTime();
+
+			for(var i = 0; i < 1000; i++){
+				addDom();
+			}
+			time.innerHTML = new Date().getTime() - cur;
+		</script>
+	<body>
+</html>

+ 28 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/perf.2.html

@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title>HTML5 Shiv</title>
+		<link rel="stylesheet" href="style.css">
+		<script src="../src/html5shiv-printshiv.js"></script>
+		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
+	</head>
+	<body>
+		<div id="time"></div>
+		<section>This sentence is in a green box <mark>with these words highlighted</mark>.</section>
+		<script>
+			function addDom(){
+				document.createElement('div');
+				document.createDocumentFragment();
+			}
+
+			var time = document.getElementById('time');
+			var cur = new Date().getTime();
+
+			for(var i = 0; i < 10000; i++){
+				addDom();
+			}
+			time.innerHTML = new Date().getTime() - cur;
+		</script>
+	<body>
+</html>

+ 226 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/qunit/qunit.css

@@ -0,0 +1,226 @@
+/**
+ * QUnit v1.2.0 - A JavaScript Unit Testing Framework
+ *
+ * http://docs.jquery.com/QUnit
+ *
+ * Copyright (c) 2011 John Resig, Jörn Zaefferer
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * or GPL (GPL-LICENSE.txt) licenses.
+ */
+
+/** Font Family and Sizes */
+
+#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
+	font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
+}
+
+#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
+#qunit-tests { font-size: smaller; }
+
+
+/** Resets */
+
+#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
+	margin: 0;
+	padding: 0;
+}
+
+
+/** Header */
+
+#qunit-header {
+	padding: 0.5em 0 0.5em 1em;
+
+	color: #8699a4;
+	background-color: #0d3349;
+
+	font-size: 1.5em;
+	line-height: 1em;
+	font-weight: normal;
+
+	border-radius: 15px 15px 0 0;
+	-moz-border-radius: 15px 15px 0 0;
+	-webkit-border-top-right-radius: 15px;
+	-webkit-border-top-left-radius: 15px;
+}
+
+#qunit-header a {
+	text-decoration: none;
+	color: #c2ccd1;
+}
+
+#qunit-header a:hover,
+#qunit-header a:focus {
+	color: #fff;
+}
+
+#qunit-banner {
+	height: 5px;
+}
+
+#qunit-testrunner-toolbar {
+	padding: 0.5em 0 0.5em 2em;
+	color: #5E740B;
+	background-color: #eee;
+}
+
+#qunit-userAgent {
+	padding: 0.5em 0 0.5em 2.5em;
+	background-color: #2b81af;
+	color: #fff;
+	text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
+}
+
+
+/** Tests: Pass/Fail */
+
+#qunit-tests {
+	list-style-position: inside;
+}
+
+#qunit-tests li {
+	padding: 0.4em 0.5em 0.4em 2.5em;
+	border-bottom: 1px solid #fff;
+	list-style-position: inside;
+}
+
+#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running  {
+	display: none;
+}
+
+#qunit-tests li strong {
+	cursor: pointer;
+}
+
+#qunit-tests li a {
+	padding: 0.5em;
+	color: #c2ccd1;
+	text-decoration: none;
+}
+#qunit-tests li a:hover,
+#qunit-tests li a:focus {
+	color: #000;
+}
+
+#qunit-tests ol {
+	margin-top: 0.5em;
+	padding: 0.5em;
+
+	background-color: #fff;
+
+	border-radius: 15px;
+	-moz-border-radius: 15px;
+	-webkit-border-radius: 15px;
+
+	box-shadow: inset 0px 2px 13px #999;
+	-moz-box-shadow: inset 0px 2px 13px #999;
+	-webkit-box-shadow: inset 0px 2px 13px #999;
+}
+
+#qunit-tests table {
+	border-collapse: collapse;
+	margin-top: .2em;
+}
+
+#qunit-tests th {
+	text-align: right;
+	vertical-align: top;
+	padding: 0 .5em 0 0;
+}
+
+#qunit-tests td {
+	vertical-align: top;
+}
+
+#qunit-tests pre {
+	margin: 0;
+	white-space: pre-wrap;
+	word-wrap: break-word;
+}
+
+#qunit-tests del {
+	background-color: #e0f2be;
+	color: #374e0c;
+	text-decoration: none;
+}
+
+#qunit-tests ins {
+	background-color: #ffcaca;
+	color: #500;
+	text-decoration: none;
+}
+
+/*** Test Counts */
+
+#qunit-tests b.counts                       { color: black; }
+#qunit-tests b.passed                       { color: #5E740B; }
+#qunit-tests b.failed                       { color: #710909; }
+
+#qunit-tests li li {
+	margin: 0.5em;
+	padding: 0.4em 0.5em 0.4em 0.5em;
+	background-color: #fff;
+	border-bottom: none;
+	list-style-position: inside;
+}
+
+/*** Passing Styles */
+
+#qunit-tests li li.pass {
+	color: #5E740B;
+	background-color: #fff;
+	border-left: 26px solid #C6E746;
+}
+
+#qunit-tests .pass                          { color: #528CE0; background-color: #D2E0E6; }
+#qunit-tests .pass .test-name               { color: #366097; }
+
+#qunit-tests .pass .test-actual,
+#qunit-tests .pass .test-expected           { color: #999999; }
+
+#qunit-banner.qunit-pass                    { background-color: #C6E746; }
+
+/*** Failing Styles */
+
+#qunit-tests li li.fail {
+	color: #710909;
+	background-color: #fff;
+	border-left: 26px solid #EE5757;
+	white-space: pre;
+}
+
+#qunit-tests > li:last-child {
+	border-radius: 0 0 15px 15px;
+	-moz-border-radius: 0 0 15px 15px;
+	-webkit-border-bottom-right-radius: 15px;
+	-webkit-border-bottom-left-radius: 15px;
+}
+
+#qunit-tests .fail                          { color: #000000; background-color: #EE5757; }
+#qunit-tests .fail .test-name,
+#qunit-tests .fail .module-name             { color: #000000; }
+
+#qunit-tests .fail .test-actual             { color: #EE5757; }
+#qunit-tests .fail .test-expected           { color: green;   }
+
+#qunit-banner.qunit-fail                    { background-color: #EE5757; }
+
+
+/** Result */
+
+#qunit-testresult {
+	padding: 0.5em 0.5em 0.5em 2.5em;
+
+	color: #2b81af;
+	background-color: #D2E0E6;
+
+	border-bottom: 1px solid white;
+}
+
+/** Fixture */
+
+#qunit-fixture {
+	position: absolute;
+	top: -10000px;
+	left: -10000px;
+}

+ 1597 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/qunit/qunit.js

@@ -0,0 +1,1597 @@
+/**
+ * QUnit v1.2.0 - A JavaScript Unit Testing Framework
+ *
+ * http://docs.jquery.com/QUnit
+ *
+ * Copyright (c) 2011 John Resig, Jörn Zaefferer
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * or GPL (GPL-LICENSE.txt) licenses.
+ */
+
+(function(window) {
+
+var defined = {
+	setTimeout: typeof window.setTimeout !== "undefined",
+	sessionStorage: (function() {
+		try {
+			return !!sessionStorage.getItem;
+		} catch(e) {
+			return false;
+		}
+	})()
+};
+
+var	testId = 0,
+	toString = Object.prototype.toString,
+	hasOwn = Object.prototype.hasOwnProperty;
+
+var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
+	this.name = name;
+	this.testName = testName;
+	this.expected = expected;
+	this.testEnvironmentArg = testEnvironmentArg;
+	this.async = async;
+	this.callback = callback;
+	this.assertions = [];
+};
+Test.prototype = {
+	init: function() {
+		var tests = id("qunit-tests");
+		if (tests) {
+			var b = document.createElement("strong");
+				b.innerHTML = "Running " + this.name;
+			var li = document.createElement("li");
+				li.appendChild( b );
+				li.className = "running";
+				li.id = this.id = "test-output" + testId++;
+			tests.appendChild( li );
+		}
+	},
+	setup: function() {
+		if (this.module != config.previousModule) {
+			if ( config.previousModule ) {
+				runLoggingCallbacks('moduleDone', QUnit, {
+					name: config.previousModule,
+					failed: config.moduleStats.bad,
+					passed: config.moduleStats.all - config.moduleStats.bad,
+					total: config.moduleStats.all
+				} );
+			}
+			config.previousModule = this.module;
+			config.moduleStats = { all: 0, bad: 0 };
+			runLoggingCallbacks( 'moduleStart', QUnit, {
+				name: this.module
+			} );
+		}
+
+		config.current = this;
+		this.testEnvironment = extend({
+			setup: function() {},
+			teardown: function() {}
+		}, this.moduleTestEnvironment);
+		if (this.testEnvironmentArg) {
+			extend(this.testEnvironment, this.testEnvironmentArg);
+		}
+
+		runLoggingCallbacks( 'testStart', QUnit, {
+			name: this.testName,
+			module: this.module
+		});
+
+		// allow utility functions to access the current test environment
+		// TODO why??
+		QUnit.current_testEnvironment = this.testEnvironment;
+
+		try {
+			if ( !config.pollution ) {
+				saveGlobal();
+			}
+
+			this.testEnvironment.setup.call(this.testEnvironment);
+		} catch(e) {
+			QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message );
+		}
+	},
+	run: function() {
+		config.current = this;
+		if ( this.async ) {
+			QUnit.stop();
+		}
+
+		if ( config.notrycatch ) {
+			this.callback.call(this.testEnvironment);
+			return;
+		}
+		try {
+			this.callback.call(this.testEnvironment);
+		} catch(e) {
+			fail("Test " + this.testName + " died, exception and test follows", e, this.callback);
+			QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) );
+			// else next test will carry the responsibility
+			saveGlobal();
+
+			// Restart the tests if they're blocking
+			if ( config.blocking ) {
+				QUnit.start();
+			}
+		}
+	},
+	teardown: function() {
+		config.current = this;
+		try {
+			this.testEnvironment.teardown.call(this.testEnvironment);
+			checkPollution();
+		} catch(e) {
+			QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
+		}
+	},
+	finish: function() {
+		config.current = this;
+		if ( this.expected != null && this.expected != this.assertions.length ) {
+			QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
+		}
+
+		var good = 0, bad = 0,
+			tests = id("qunit-tests");
+
+		config.stats.all += this.assertions.length;
+		config.moduleStats.all += this.assertions.length;
+
+		if ( tests ) {
+			var ol = document.createElement("ol");
+
+			for ( var i = 0; i < this.assertions.length; i++ ) {
+				var assertion = this.assertions[i];
+
+				var li = document.createElement("li");
+				li.className = assertion.result ? "pass" : "fail";
+				li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
+				ol.appendChild( li );
+
+				if ( assertion.result ) {
+					good++;
+				} else {
+					bad++;
+					config.stats.bad++;
+					config.moduleStats.bad++;
+				}
+			}
+
+			// store result when possible
+			if ( QUnit.config.reorder && defined.sessionStorage ) {
+				if (bad) {
+					sessionStorage.setItem("qunit-" + this.module + "-" + this.testName, bad);
+				} else {
+					sessionStorage.removeItem("qunit-" + this.module + "-" + this.testName);
+				}
+			}
+
+			if (bad == 0) {
+				ol.style.display = "none";
+			}
+
+			var b = document.createElement("strong");
+			b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
+
+			var a = document.createElement("a");
+			a.innerHTML = "Rerun";
+			a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
+
+			addEvent(b, "click", function() {
+				var next = b.nextSibling.nextSibling,
+					display = next.style.display;
+				next.style.display = display === "none" ? "block" : "none";
+			});
+
+			addEvent(b, "dblclick", function(e) {
+				var target = e && e.target ? e.target : window.event.srcElement;
+				if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
+					target = target.parentNode;
+				}
+				if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
+					window.location = QUnit.url({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
+				}
+			});
+
+			var li = id(this.id);
+			li.className = bad ? "fail" : "pass";
+			li.removeChild( li.firstChild );
+			li.appendChild( b );
+			li.appendChild( a );
+			li.appendChild( ol );
+
+		} else {
+			for ( var i = 0; i < this.assertions.length; i++ ) {
+				if ( !this.assertions[i].result ) {
+					bad++;
+					config.stats.bad++;
+					config.moduleStats.bad++;
+				}
+			}
+		}
+
+		try {
+			QUnit.reset();
+		} catch(e) {
+			fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset);
+		}
+
+		runLoggingCallbacks( 'testDone', QUnit, {
+			name: this.testName,
+			module: this.module,
+			failed: bad,
+			passed: this.assertions.length - bad,
+			total: this.assertions.length
+		} );
+	},
+
+	queue: function() {
+		var test = this;
+		synchronize(function() {
+			test.init();
+		});
+		function run() {
+			// each of these can by async
+			synchronize(function() {
+				test.setup();
+			});
+			synchronize(function() {
+				test.run();
+			});
+			synchronize(function() {
+				test.teardown();
+			});
+			synchronize(function() {
+				test.finish();
+			});
+		}
+		// defer when previous test run passed, if storage is available
+		var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.module + "-" + this.testName);
+		if (bad) {
+			run();
+		} else {
+			synchronize(run, true);
+		};
+	}
+
+};
+
+var QUnit = {
+
+	// call on start of module test to prepend name to all tests
+	module: function(name, testEnvironment) {
+		config.currentModule = name;
+		config.currentModuleTestEnviroment = testEnvironment;
+	},
+
+	asyncTest: function(testName, expected, callback) {
+		if ( arguments.length === 2 ) {
+			callback = expected;
+			expected = null;
+		}
+
+		QUnit.test(testName, expected, callback, true);
+	},
+
+	test: function(testName, expected, callback, async) {
+		var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
+
+		if ( arguments.length === 2 ) {
+			callback = expected;
+			expected = null;
+		}
+		// is 2nd argument a testEnvironment?
+		if ( expected && typeof expected === 'object') {
+			testEnvironmentArg = expected;
+			expected = null;
+		}
+
+		if ( config.currentModule ) {
+			name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
+		}
+
+		if ( !validTest(config.currentModule + ": " + testName) ) {
+			return;
+		}
+
+		var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
+		test.module = config.currentModule;
+		test.moduleTestEnvironment = config.currentModuleTestEnviroment;
+		test.queue();
+	},
+
+	/**
+	 * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
+	 */
+	expect: function(asserts) {
+		config.current.expected = asserts;
+	},
+
+	/**
+	 * Asserts true.
+	 * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
+	 */
+	ok: function(a, msg) {
+		a = !!a;
+		var details = {
+			result: a,
+			message: msg
+		};
+		msg = escapeInnerText(msg);
+		runLoggingCallbacks( 'log', QUnit, details );
+		config.current.assertions.push({
+			result: a,
+			message: msg
+		});
+	},
+
+	/**
+	 * Checks that the first two arguments are equal, with an optional message.
+	 * Prints out both actual and expected values.
+	 *
+	 * Prefered to ok( actual == expected, message )
+	 *
+	 * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
+	 *
+	 * @param Object actual
+	 * @param Object expected
+	 * @param String message (optional)
+	 */
+	equal: function(actual, expected, message) {
+		QUnit.push(expected == actual, actual, expected, message);
+	},
+
+	notEqual: function(actual, expected, message) {
+		QUnit.push(expected != actual, actual, expected, message);
+	},
+
+	deepEqual: function(actual, expected, message) {
+		QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
+	},
+
+	notDeepEqual: function(actual, expected, message) {
+		QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message);
+	},
+
+	strictEqual: function(actual, expected, message) {
+		QUnit.push(expected === actual, actual, expected, message);
+	},
+
+	notStrictEqual: function(actual, expected, message) {
+		QUnit.push(expected !== actual, actual, expected, message);
+	},
+
+	raises: function(block, expected, message) {
+		var actual, ok = false;
+
+		if (typeof expected === 'string') {
+			message = expected;
+			expected = null;
+		}
+
+		try {
+			block();
+		} catch (e) {
+			actual = e;
+		}
+
+		if (actual) {
+			// we don't want to validate thrown error
+			if (!expected) {
+				ok = true;
+			// expected is a regexp
+			} else if (QUnit.objectType(expected) === "regexp") {
+				ok = expected.test(actual);
+			// expected is a constructor
+			} else if (actual instanceof expected) {
+				ok = true;
+			// expected is a validation function which returns true is validation passed
+			} else if (expected.call({}, actual) === true) {
+				ok = true;
+			}
+		}
+
+		QUnit.ok(ok, message);
+	},
+
+	start: function(count) {
+		config.semaphore -= count || 1;
+		if (config.semaphore > 0) {
+			// don't start until equal number of stop-calls
+			return;
+		}
+		if (config.semaphore < 0) {
+			// ignore if start is called more often then stop
+			config.semaphore = 0;
+		}
+		// A slight delay, to avoid any current callbacks
+		if ( defined.setTimeout ) {
+			window.setTimeout(function() {
+				if (config.semaphore > 0) {
+					return;
+				}
+				if ( config.timeout ) {
+					clearTimeout(config.timeout);
+				}
+
+				config.blocking = false;
+				process(true);
+			}, 13);
+		} else {
+			config.blocking = false;
+			process(true);
+		}
+	},
+
+	stop: function(count) {
+		config.semaphore += count || 1;
+		config.blocking = true;
+
+		if ( config.testTimeout && defined.setTimeout ) {
+			clearTimeout(config.timeout);
+			config.timeout = window.setTimeout(function() {
+				QUnit.ok( false, "Test timed out" );
+				config.semaphore = 1;
+				QUnit.start();
+			}, config.testTimeout);
+		}
+	}
+};
+
+//We want access to the constructor's prototype
+(function() {
+	function F(){};
+	F.prototype = QUnit;
+	QUnit = new F();
+	//Make F QUnit's constructor so that we can add to the prototype later
+	QUnit.constructor = F;
+})();
+
+// Backwards compatibility, deprecated
+QUnit.equals = QUnit.equal;
+QUnit.same = QUnit.deepEqual;
+
+// Maintain internal state
+var config = {
+	// The queue of tests to run
+	queue: [],
+
+	// block until document ready
+	blocking: true,
+
+	// when enabled, show only failing tests
+	// gets persisted through sessionStorage and can be changed in UI via checkbox
+	hidepassed: false,
+
+	// by default, run previously failed tests first
+	// very useful in combination with "Hide passed tests" checked
+	reorder: true,
+
+	// by default, modify document.title when suite is done
+	altertitle: true,
+
+	urlConfig: ['noglobals', 'notrycatch'],
+
+	//logging callback queues
+	begin: [],
+	done: [],
+	log: [],
+	testStart: [],
+	testDone: [],
+	moduleStart: [],
+	moduleDone: []
+};
+
+// Load paramaters
+(function() {
+	var location = window.location || { search: "", protocol: "file:" },
+		params = location.search.slice( 1 ).split( "&" ),
+		length = params.length,
+		urlParams = {},
+		current;
+
+	if ( params[ 0 ] ) {
+		for ( var i = 0; i < length; i++ ) {
+			current = params[ i ].split( "=" );
+			current[ 0 ] = decodeURIComponent( current[ 0 ] );
+			// allow just a key to turn on a flag, e.g., test.html?noglobals
+			current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true;
+			urlParams[ current[ 0 ] ] = current[ 1 ];
+		}
+	}
+
+	QUnit.urlParams = urlParams;
+	config.filter = urlParams.filter;
+
+	// Figure out if we're running the tests from a server or not
+	QUnit.isLocal = !!(location.protocol === 'file:');
+})();
+
+// Expose the API as global variables, unless an 'exports'
+// object exists, in that case we assume we're in CommonJS
+if ( typeof exports === "undefined" || typeof require === "undefined" ) {
+	extend(window, QUnit);
+	window.QUnit = QUnit;
+} else {
+	extend(exports, QUnit);
+	exports.QUnit = QUnit;
+}
+
+// define these after exposing globals to keep them in these QUnit namespace only
+extend(QUnit, {
+	config: config,
+
+	// Initialize the configuration options
+	init: function() {
+		extend(config, {
+			stats: { all: 0, bad: 0 },
+			moduleStats: { all: 0, bad: 0 },
+			started: +new Date,
+			updateRate: 1000,
+			blocking: false,
+			autostart: true,
+			autorun: false,
+			filter: "",
+			queue: [],
+			semaphore: 0
+		});
+
+		var tests = id( "qunit-tests" ),
+			banner = id( "qunit-banner" ),
+			result = id( "qunit-testresult" );
+
+		if ( tests ) {
+			tests.innerHTML = "";
+		}
+
+		if ( banner ) {
+			banner.className = "";
+		}
+
+		if ( result ) {
+			result.parentNode.removeChild( result );
+		}
+
+		if ( tests ) {
+			result = document.createElement( "p" );
+			result.id = "qunit-testresult";
+			result.className = "result";
+			tests.parentNode.insertBefore( result, tests );
+			result.innerHTML = 'Running...<br/>&nbsp;';
+		}
+	},
+
+	/**
+	 * Resets the test setup. Useful for tests that modify the DOM.
+	 *
+	 * If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
+	 */
+	reset: function() {
+		if ( window.jQuery ) {
+			jQuery( "#qunit-fixture" ).html( config.fixture );
+		} else {
+			var main = id( 'qunit-fixture' );
+			if ( main ) {
+				main.innerHTML = config.fixture;
+			}
+		}
+	},
+
+	/**
+	 * Trigger an event on an element.
+	 *
+	 * @example triggerEvent( document.body, "click" );
+	 *
+	 * @param DOMElement elem
+	 * @param String type
+	 */
+	triggerEvent: function( elem, type, event ) {
+		if ( document.createEvent ) {
+			event = document.createEvent("MouseEvents");
+			event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
+				0, 0, 0, 0, 0, false, false, false, false, 0, null);
+			elem.dispatchEvent( event );
+
+		} else if ( elem.fireEvent ) {
+			elem.fireEvent("on"+type);
+		}
+	},
+
+	// Safe object type checking
+	is: function( type, obj ) {
+		return QUnit.objectType( obj ) == type;
+	},
+
+	objectType: function( obj ) {
+		if (typeof obj === "undefined") {
+				return "undefined";
+
+		// consider: typeof null === object
+		}
+		if (obj === null) {
+				return "null";
+		}
+
+		var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || '';
+
+		switch (type) {
+				case 'Number':
+						if (isNaN(obj)) {
+								return "nan";
+						} else {
+								return "number";
+						}
+				case 'String':
+				case 'Boolean':
+				case 'Array':
+				case 'Date':
+				case 'RegExp':
+				case 'Function':
+						return type.toLowerCase();
+		}
+		if (typeof obj === "object") {
+				return "object";
+		}
+		return undefined;
+	},
+
+	push: function(result, actual, expected, message) {
+		var details = {
+			result: result,
+			message: message,
+			actual: actual,
+			expected: expected
+		};
+
+		message = escapeInnerText(message) || (result ? "okay" : "failed");
+		message = '<span class="test-message">' + message + "</span>";
+		expected = escapeInnerText(QUnit.jsDump.parse(expected));
+		actual = escapeInnerText(QUnit.jsDump.parse(actual));
+		var output = message + '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
+		if (actual != expected) {
+			output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
+			output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
+		}
+		if (!result) {
+			var source = sourceFromStacktrace();
+			if (source) {
+				details.source = source;
+				output += '<tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr>';
+			}
+		}
+		output += "</table>";
+
+		runLoggingCallbacks( 'log', QUnit, details );
+
+		config.current.assertions.push({
+			result: !!result,
+			message: output
+		});
+	},
+
+	url: function( params ) {
+		params = extend( extend( {}, QUnit.urlParams ), params );
+		var querystring = "?",
+			key;
+		for ( key in params ) {
+			if ( !hasOwn.call( params, key ) ) {
+				continue;
+			}
+			querystring += encodeURIComponent( key ) + "=" +
+				encodeURIComponent( params[ key ] ) + "&";
+		}
+		return window.location.pathname + querystring.slice( 0, -1 );
+	},
+
+	extend: extend,
+	id: id,
+	addEvent: addEvent
+});
+
+//QUnit.constructor is set to the empty F() above so that we can add to it's prototype later
+//Doing this allows us to tell if the following methods have been overwritten on the actual
+//QUnit object, which is a deprecated way of using the callbacks.
+extend(QUnit.constructor.prototype, {
+	// Logging callbacks; all receive a single argument with the listed properties
+	// run test/logs.html for any related changes
+	begin: registerLoggingCallback('begin'),
+	// done: { failed, passed, total, runtime }
+	done: registerLoggingCallback('done'),
+	// log: { result, actual, expected, message }
+	log: registerLoggingCallback('log'),
+	// testStart: { name }
+	testStart: registerLoggingCallback('testStart'),
+	// testDone: { name, failed, passed, total }
+	testDone: registerLoggingCallback('testDone'),
+	// moduleStart: { name }
+	moduleStart: registerLoggingCallback('moduleStart'),
+	// moduleDone: { name, failed, passed, total }
+	moduleDone: registerLoggingCallback('moduleDone')
+});
+
+if ( typeof document === "undefined" || document.readyState === "complete" ) {
+	config.autorun = true;
+}
+
+QUnit.load = function() {
+	runLoggingCallbacks( 'begin', QUnit, {} );
+
+	// Initialize the config, saving the execution queue
+	var oldconfig = extend({}, config);
+	QUnit.init();
+	extend(config, oldconfig);
+
+	config.blocking = false;
+
+	var urlConfigHtml = '', len = config.urlConfig.length;
+	for ( var i = 0, val; i < len, val = config.urlConfig[i]; i++ ) {
+		config[val] = QUnit.urlParams[val];
+		urlConfigHtml += '<label><input name="' + val + '" type="checkbox"' + ( config[val] ? ' checked="checked"' : '' ) + '>' + val + '</label>';
+	}
+
+	var userAgent = id("qunit-userAgent");
+	if ( userAgent ) {
+		userAgent.innerHTML = navigator.userAgent;
+	}
+	var banner = id("qunit-header");
+	if ( banner ) {
+		banner.innerHTML = '<a href="' + QUnit.url({ filter: undefined }) + '"> ' + banner.innerHTML + '</a> ' + urlConfigHtml;
+		addEvent( banner, "change", function( event ) {
+			var params = {};
+			params[ event.target.name ] = event.target.checked ? true : undefined;
+			window.location = QUnit.url( params );
+		});
+	}
+
+	var toolbar = id("qunit-testrunner-toolbar");
+	if ( toolbar ) {
+		var filter = document.createElement("input");
+		filter.type = "checkbox";
+		filter.id = "qunit-filter-pass";
+		addEvent( filter, "click", function() {
+			var ol = document.getElementById("qunit-tests");
+			if ( filter.checked ) {
+				ol.className = ol.className + " hidepass";
+			} else {
+				var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " ";
+				ol.className = tmp.replace(/ hidepass /, " ");
+			}
+			if ( defined.sessionStorage ) {
+				if (filter.checked) {
+					sessionStorage.setItem("qunit-filter-passed-tests", "true");
+				} else {
+					sessionStorage.removeItem("qunit-filter-passed-tests");
+				}
+			}
+		});
+		if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
+			filter.checked = true;
+			var ol = document.getElementById("qunit-tests");
+			ol.className = ol.className + " hidepass";
+		}
+		toolbar.appendChild( filter );
+
+		var label = document.createElement("label");
+		label.setAttribute("for", "qunit-filter-pass");
+		label.innerHTML = "Hide passed tests";
+		toolbar.appendChild( label );
+	}
+
+	var main = id('qunit-fixture');
+	if ( main ) {
+		config.fixture = main.innerHTML;
+	}
+
+	if (config.autostart) {
+		QUnit.start();
+	}
+};
+
+addEvent(window, "load", QUnit.load);
+
+// addEvent(window, "error") gives us a useless event object
+window.onerror = function( message, file, line ) {
+	if ( QUnit.config.current ) {
+		ok( false, message + ", " + file + ":" + line );
+	} else {
+		test( "global failure", function() {
+			ok( false, message + ", " + file + ":" + line );
+		});
+	}
+};
+
+function done() {
+	config.autorun = true;
+
+	// Log the last module results
+	if ( config.currentModule ) {
+		runLoggingCallbacks( 'moduleDone', QUnit, {
+			name: config.currentModule,
+			failed: config.moduleStats.bad,
+			passed: config.moduleStats.all - config.moduleStats.bad,
+			total: config.moduleStats.all
+		} );
+	}
+
+	var banner = id("qunit-banner"),
+		tests = id("qunit-tests"),
+		runtime = +new Date - config.started,
+		passed = config.stats.all - config.stats.bad,
+		html = [
+			'Tests completed in ',
+			runtime,
+			' milliseconds.<br/>',
+			'<span class="passed">',
+			passed,
+			'</span> tests of <span class="total">',
+			config.stats.all,
+			'</span> passed, <span class="failed">',
+			config.stats.bad,
+			'</span> failed.'
+		].join('');
+
+	if ( banner ) {
+		banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
+	}
+
+	if ( tests ) {
+		id( "qunit-testresult" ).innerHTML = html;
+	}
+
+	if ( config.altertitle && typeof document !== "undefined" && document.title ) {
+		// show ✖ for good, ✔ for bad suite result in title
+		// use escape sequences in case file gets loaded with non-utf-8-charset
+		document.title = [
+			(config.stats.bad ? "\u2716" : "\u2714"),
+			document.title.replace(/^[\u2714\u2716] /i, "")
+		].join(" ");
+	}
+
+	runLoggingCallbacks( 'done', QUnit, {
+		failed: config.stats.bad,
+		passed: passed,
+		total: config.stats.all,
+		runtime: runtime
+	} );
+}
+
+function validTest( name ) {
+	var filter = config.filter,
+		run = false;
+
+	if ( !filter ) {
+		return true;
+	}
+
+	var not = filter.charAt( 0 ) === "!";
+	if ( not ) {
+		filter = filter.slice( 1 );
+	}
+
+	if ( name.indexOf( filter ) !== -1 ) {
+		return !not;
+	}
+
+	if ( not ) {
+		run = true;
+	}
+
+	return run;
+}
+
+// so far supports only Firefox, Chrome and Opera (buggy)
+// could be extended in the future to use something like https://github.com/csnover/TraceKit
+function sourceFromStacktrace() {
+	try {
+		throw new Error();
+	} catch ( e ) {
+		if (e.stacktrace) {
+			// Opera
+			return e.stacktrace.split("\n")[6];
+		} else if (e.stack) {
+			// Firefox, Chrome
+			return e.stack.split("\n")[4];
+		} else if (e.sourceURL) {
+			// Safari, PhantomJS
+			// TODO sourceURL points at the 'throw new Error' line above, useless
+			//return e.sourceURL + ":" + e.line;
+		}
+	}
+}
+
+function escapeInnerText(s) {
+	if (!s) {
+		return "";
+	}
+	s = s + "";
+	return s.replace(/[\&<>]/g, function(s) {
+		switch(s) {
+			case "&": return "&amp;";
+			case "<": return "&lt;";
+			case ">": return "&gt;";
+			default: return s;
+		}
+	});
+}
+
+function synchronize( callback, last ) {
+	config.queue.push( callback );
+
+	if ( config.autorun && !config.blocking ) {
+		process(last);
+	}
+}
+
+function process( last ) {
+	var start = new Date().getTime();
+	config.depth = config.depth ? config.depth + 1 : 1;
+
+	while ( config.queue.length && !config.blocking ) {
+		if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) {
+			config.queue.shift()();
+		} else {
+			window.setTimeout( function(){
+				process( last );
+			}, 13 );
+			break;
+		}
+	}
+	config.depth--;
+	if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) {
+		done();
+	}
+}
+
+function saveGlobal() {
+	config.pollution = [];
+
+	if ( config.noglobals ) {
+		for ( var key in window ) {
+			if ( !hasOwn.call( window, key ) ) {
+				continue;
+			}
+			config.pollution.push( key );
+		}
+	}
+}
+
+function checkPollution( name ) {
+	var old = config.pollution;
+	saveGlobal();
+
+	var newGlobals = diff( config.pollution, old );
+	if ( newGlobals.length > 0 ) {
+		ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
+	}
+
+	var deletedGlobals = diff( old, config.pollution );
+	if ( deletedGlobals.length > 0 ) {
+		ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
+	}
+}
+
+// returns a new Array with the elements that are in a but not in b
+function diff( a, b ) {
+	var result = a.slice();
+	for ( var i = 0; i < result.length; i++ ) {
+		for ( var j = 0; j < b.length; j++ ) {
+			if ( result[i] === b[j] ) {
+				result.splice(i, 1);
+				i--;
+				break;
+			}
+		}
+	}
+	return result;
+}
+
+function fail(message, exception, callback) {
+	if ( typeof console !== "undefined" && console.error && console.warn ) {
+		console.error(message);
+		console.error(exception);
+		console.warn(callback.toString());
+
+	} else if ( window.opera && opera.postError ) {
+		opera.postError(message, exception, callback.toString);
+	}
+}
+
+function extend(a, b) {
+	for ( var prop in b ) {
+		if ( b[prop] === undefined ) {
+			delete a[prop];
+
+		// Avoid "Member not found" error in IE8 caused by setting window.constructor
+		} else if ( prop !== "constructor" || a !== window ) {
+			a[prop] = b[prop];
+		}
+	}
+
+	return a;
+}
+
+function addEvent(elem, type, fn) {
+	if ( elem.addEventListener ) {
+		elem.addEventListener( type, fn, false );
+	} else if ( elem.attachEvent ) {
+		elem.attachEvent( "on" + type, fn );
+	} else {
+		fn();
+	}
+}
+
+function id(name) {
+	return !!(typeof document !== "undefined" && document && document.getElementById) &&
+		document.getElementById( name );
+}
+
+function registerLoggingCallback(key){
+	return function(callback){
+		config[key].push( callback );
+	};
+}
+
+// Supports deprecated method of completely overwriting logging callbacks
+function runLoggingCallbacks(key, scope, args) {
+	//debugger;
+	var callbacks;
+	if ( QUnit.hasOwnProperty(key) ) {
+		QUnit[key].call(scope, args);
+	} else {
+		callbacks = config[key];
+		for( var i = 0; i < callbacks.length; i++ ) {
+			callbacks[i].call( scope, args );
+		}
+	}
+}
+
+// Test for equality any JavaScript type.
+// Author: Philippe Rathé <[email protected]>
+QUnit.equiv = function () {
+
+	var innerEquiv; // the real equiv function
+	var callers = []; // stack to decide between skip/abort functions
+	var parents = []; // stack to avoiding loops from circular referencing
+
+	// Call the o related callback with the given arguments.
+	function bindCallbacks(o, callbacks, args) {
+		var prop = QUnit.objectType(o);
+		if (prop) {
+			if (QUnit.objectType(callbacks[prop]) === "function") {
+				return callbacks[prop].apply(callbacks, args);
+			} else {
+				return callbacks[prop]; // or undefined
+			}
+		}
+	}
+
+	var getProto = Object.getPrototypeOf || function (obj) {
+		return obj.__proto__;
+	};
+
+	var callbacks = function () {
+
+		// for string, boolean, number and null
+		function useStrictEquality(b, a) {
+			if (b instanceof a.constructor || a instanceof b.constructor) {
+				// to catch short annotaion VS 'new' annotation of a
+				// declaration
+				// e.g. var i = 1;
+				// var j = new Number(1);
+				return a == b;
+			} else {
+				return a === b;
+			}
+		}
+
+		return {
+			"string" : useStrictEquality,
+			"boolean" : useStrictEquality,
+			"number" : useStrictEquality,
+			"null" : useStrictEquality,
+			"undefined" : useStrictEquality,
+
+			"nan" : function(b) {
+				return isNaN(b);
+			},
+
+			"date" : function(b, a) {
+				return QUnit.objectType(b) === "date"
+						&& a.valueOf() === b.valueOf();
+			},
+
+			"regexp" : function(b, a) {
+				return QUnit.objectType(b) === "regexp"
+						&& a.source === b.source && // the regex itself
+						a.global === b.global && // and its modifers
+													// (gmi) ...
+						a.ignoreCase === b.ignoreCase
+						&& a.multiline === b.multiline;
+			},
+
+			// - skip when the property is a method of an instance (OOP)
+			// - abort otherwise,
+			// initial === would have catch identical references anyway
+			"function" : function() {
+				var caller = callers[callers.length - 1];
+				return caller !== Object && typeof caller !== "undefined";
+			},
+
+			"array" : function(b, a) {
+				var i, j, loop;
+				var len;
+
+				// b could be an object literal here
+				if (!(QUnit.objectType(b) === "array")) {
+					return false;
+				}
+
+				len = a.length;
+				if (len !== b.length) { // safe and faster
+					return false;
+				}
+
+				// track reference to avoid circular references
+				parents.push(a);
+				for (i = 0; i < len; i++) {
+					loop = false;
+					for (j = 0; j < parents.length; j++) {
+						if (parents[j] === a[i]) {
+							loop = true;// dont rewalk array
+						}
+					}
+					if (!loop && !innerEquiv(a[i], b[i])) {
+						parents.pop();
+						return false;
+					}
+				}
+				parents.pop();
+				return true;
+			},
+
+			"object" : function(b, a) {
+				var i, j, loop;
+				var eq = true; // unless we can proove it
+				var aProperties = [], bProperties = []; // collection of
+														// strings
+
+				// comparing constructors is more strict than using
+				// instanceof
+				if (a.constructor !== b.constructor) {
+					// Allow objects with no prototype to be equivalent to
+					// objects with Object as their constructor.
+					if (!((getProto(a) === null && getProto(b) === Object.prototype) ||
+						  (getProto(b) === null && getProto(a) === Object.prototype)))
+					{
+						return false;
+					}
+				}
+
+				// stack constructor before traversing properties
+				callers.push(a.constructor);
+				// track reference to avoid circular references
+				parents.push(a);
+
+				for (i in a) { // be strict: don't ensures hasOwnProperty
+								// and go deep
+					loop = false;
+					for (j = 0; j < parents.length; j++) {
+						if (parents[j] === a[i])
+							loop = true; // don't go down the same path
+											// twice
+					}
+					aProperties.push(i); // collect a's properties
+
+					if (!loop && !innerEquiv(a[i], b[i])) {
+						eq = false;
+						break;
+					}
+				}
+
+				callers.pop(); // unstack, we are done
+				parents.pop();
+
+				for (i in b) {
+					bProperties.push(i); // collect b's properties
+				}
+
+				// Ensures identical properties name
+				return eq
+						&& innerEquiv(aProperties.sort(), bProperties
+								.sort());
+			}
+		};
+	}();
+
+	innerEquiv = function() { // can take multiple arguments
+		var args = Array.prototype.slice.apply(arguments);
+		if (args.length < 2) {
+			return true; // end transition
+		}
+
+		return (function(a, b) {
+			if (a === b) {
+				return true; // catch the most you can
+			} else if (a === null || b === null || typeof a === "undefined"
+					|| typeof b === "undefined"
+					|| QUnit.objectType(a) !== QUnit.objectType(b)) {
+				return false; // don't lose time with error prone cases
+			} else {
+				return bindCallbacks(a, callbacks, [ b, a ]);
+			}
+
+			// apply transition with (1..n) arguments
+		})(args[0], args[1])
+				&& arguments.callee.apply(this, args.splice(1,
+						args.length - 1));
+	};
+
+	return innerEquiv;
+
+}();
+
+/**
+ * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com |
+ * http://flesler.blogspot.com Licensed under BSD
+ * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008
+ *
+ * @projectDescription Advanced and extensible data dumping for Javascript.
+ * @version 1.0.0
+ * @author Ariel Flesler
+ * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
+ */
+QUnit.jsDump = (function() {
+	function quote( str ) {
+		return '"' + str.toString().replace(/"/g, '\\"') + '"';
+	};
+	function literal( o ) {
+		return o + '';
+	};
+	function join( pre, arr, post ) {
+		var s = jsDump.separator(),
+			base = jsDump.indent(),
+			inner = jsDump.indent(1);
+		if ( arr.join )
+			arr = arr.join( ',' + s + inner );
+		if ( !arr )
+			return pre + post;
+		return [ pre, inner + arr, base + post ].join(s);
+	};
+	function array( arr, stack ) {
+		var i = arr.length, ret = Array(i);
+		this.up();
+		while ( i-- )
+			ret[i] = this.parse( arr[i] , undefined , stack);
+		this.down();
+		return join( '[', ret, ']' );
+	};
+
+	var reName = /^function (\w+)/;
+
+	var jsDump = {
+		parse:function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance
+			stack = stack || [ ];
+			var parser = this.parsers[ type || this.typeOf(obj) ];
+			type = typeof parser;
+			var inStack = inArray(obj, stack);
+			if (inStack != -1) {
+				return 'recursion('+(inStack - stack.length)+')';
+			}
+			//else
+			if (type == 'function')  {
+					stack.push(obj);
+					var res = parser.call( this, obj, stack );
+					stack.pop();
+					return res;
+			}
+			// else
+			return (type == 'string') ? parser : this.parsers.error;
+		},
+		typeOf:function( obj ) {
+			var type;
+			if ( obj === null ) {
+				type = "null";
+			} else if (typeof obj === "undefined") {
+				type = "undefined";
+			} else if (QUnit.is("RegExp", obj)) {
+				type = "regexp";
+			} else if (QUnit.is("Date", obj)) {
+				type = "date";
+			} else if (QUnit.is("Function", obj)) {
+				type = "function";
+			} else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") {
+				type = "window";
+			} else if (obj.nodeType === 9) {
+				type = "document";
+			} else if (obj.nodeType) {
+				type = "node";
+			} else if (
+				// native arrays
+				toString.call( obj ) === "[object Array]" ||
+				// NodeList objects
+				( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) )
+			) {
+				type = "array";
+			} else {
+				type = typeof obj;
+			}
+			return type;
+		},
+		separator:function() {
+			return this.multiline ?	this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
+		},
+		indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
+			if ( !this.multiline )
+				return '';
+			var chr = this.indentChar;
+			if ( this.HTML )
+				chr = chr.replace(/\t/g,'   ').replace(/ /g,'&nbsp;');
+			return Array( this._depth_ + (extra||0) ).join(chr);
+		},
+		up:function( a ) {
+			this._depth_ += a || 1;
+		},
+		down:function( a ) {
+			this._depth_ -= a || 1;
+		},
+		setParser:function( name, parser ) {
+			this.parsers[name] = parser;
+		},
+		// The next 3 are exposed so you can use them
+		quote:quote,
+		literal:literal,
+		join:join,
+		//
+		_depth_: 1,
+		// This is the list of parsers, to modify them, use jsDump.setParser
+		parsers:{
+			window: '[Window]',
+			document: '[Document]',
+			error:'[ERROR]', //when no parser is found, shouldn't happen
+			unknown: '[Unknown]',
+			'null':'null',
+			'undefined':'undefined',
+			'function':function( fn ) {
+				var ret = 'function',
+					name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
+				if ( name )
+					ret += ' ' + name;
+				ret += '(';
+
+				ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
+				return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
+			},
+			array: array,
+			nodelist: array,
+			arguments: array,
+			object:function( map, stack ) {
+				var ret = [ ];
+				QUnit.jsDump.up();
+				for ( var key in map ) {
+				    var val = map[key];
+					ret.push( QUnit.jsDump.parse(key,'key') + ': ' + QUnit.jsDump.parse(val, undefined, stack));
+                }
+				QUnit.jsDump.down();
+				return join( '{', ret, '}' );
+			},
+			node:function( node ) {
+				var open = QUnit.jsDump.HTML ? '&lt;' : '<',
+					close = QUnit.jsDump.HTML ? '&gt;' : '>';
+
+				var tag = node.nodeName.toLowerCase(),
+					ret = open + tag;
+
+				for ( var a in QUnit.jsDump.DOMAttrs ) {
+					var val = node[QUnit.jsDump.DOMAttrs[a]];
+					if ( val )
+						ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' );
+				}
+				return ret + close + open + '/' + tag + close;
+			},
+			functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
+				var l = fn.length;
+				if ( !l ) return '';
+
+				var args = Array(l);
+				while ( l-- )
+					args[l] = String.fromCharCode(97+l);//97 is 'a'
+				return ' ' + args.join(', ') + ' ';
+			},
+			key:quote, //object calls it internally, the key part of an item in a map
+			functionCode:'[code]', //function calls it internally, it's the content of the function
+			attribute:quote, //node calls it internally, it's an html attribute value
+			string:quote,
+			date:quote,
+			regexp:literal, //regex
+			number:literal,
+			'boolean':literal
+		},
+		DOMAttrs:{//attributes to dump from nodes, name=>realName
+			id:'id',
+			name:'name',
+			'class':'className'
+		},
+		HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
+		indentChar:'  ',//indentation unit
+		multiline:true //if true, items in a collection, are separated by a \n, else just a space.
+	};
+
+	return jsDump;
+})();
+
+// from Sizzle.js
+function getText( elems ) {
+	var ret = "", elem;
+
+	for ( var i = 0; elems[i]; i++ ) {
+		elem = elems[i];
+
+		// Get the text from text nodes and CDATA nodes
+		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
+			ret += elem.nodeValue;
+
+		// Traverse everything else, except comment nodes
+		} else if ( elem.nodeType !== 8 ) {
+			ret += getText( elem.childNodes );
+		}
+	}
+
+	return ret;
+};
+
+//from jquery.js
+function inArray( elem, array ) {
+	if ( array.indexOf ) {
+		return array.indexOf( elem );
+	}
+
+	for ( var i = 0, length = array.length; i < length; i++ ) {
+		if ( array[ i ] === elem ) {
+			return i;
+		}
+	}
+
+	return -1;
+}
+
+/*
+ * Javascript Diff Algorithm
+ *  By John Resig (http://ejohn.org/)
+ *  Modified by Chu Alan "sprite"
+ *
+ * Released under the MIT license.
+ *
+ * More Info:
+ *  http://ejohn.org/projects/javascript-diff-algorithm/
+ *
+ * Usage: QUnit.diff(expected, actual)
+ *
+ * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the  quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
+ */
+QUnit.diff = (function() {
+	function diff(o, n) {
+		var ns = {};
+		var os = {};
+
+		for (var i = 0; i < n.length; i++) {
+			if (ns[n[i]] == null)
+				ns[n[i]] = {
+					rows: [],
+					o: null
+				};
+			ns[n[i]].rows.push(i);
+		}
+
+		for (var i = 0; i < o.length; i++) {
+			if (os[o[i]] == null)
+				os[o[i]] = {
+					rows: [],
+					n: null
+				};
+			os[o[i]].rows.push(i);
+		}
+
+		for (var i in ns) {
+			if ( !hasOwn.call( ns, i ) ) {
+				continue;
+			}
+			if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
+				n[ns[i].rows[0]] = {
+					text: n[ns[i].rows[0]],
+					row: os[i].rows[0]
+				};
+				o[os[i].rows[0]] = {
+					text: o[os[i].rows[0]],
+					row: ns[i].rows[0]
+				};
+			}
+		}
+
+		for (var i = 0; i < n.length - 1; i++) {
+			if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
+			n[i + 1] == o[n[i].row + 1]) {
+				n[i + 1] = {
+					text: n[i + 1],
+					row: n[i].row + 1
+				};
+				o[n[i].row + 1] = {
+					text: o[n[i].row + 1],
+					row: i + 1
+				};
+			}
+		}
+
+		for (var i = n.length - 1; i > 0; i--) {
+			if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
+			n[i - 1] == o[n[i].row - 1]) {
+				n[i - 1] = {
+					text: n[i - 1],
+					row: n[i].row - 1
+				};
+				o[n[i].row - 1] = {
+					text: o[n[i].row - 1],
+					row: i - 1
+				};
+			}
+		}
+
+		return {
+			o: o,
+			n: n
+		};
+	}
+
+	return function(o, n) {
+		o = o.replace(/\s+$/, '');
+		n = n.replace(/\s+$/, '');
+		var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/));
+
+		var str = "";
+
+		var oSpace = o.match(/\s+/g);
+		if (oSpace == null) {
+			oSpace = [" "];
+		}
+		else {
+			oSpace.push(" ");
+		}
+		var nSpace = n.match(/\s+/g);
+		if (nSpace == null) {
+			nSpace = [" "];
+		}
+		else {
+			nSpace.push(" ");
+		}
+
+		if (out.n.length == 0) {
+			for (var i = 0; i < out.o.length; i++) {
+				str += '<del>' + out.o[i] + oSpace[i] + "</del>";
+			}
+		}
+		else {
+			if (out.n[0].text == null) {
+				for (n = 0; n < out.o.length && out.o[n].text == null; n++) {
+					str += '<del>' + out.o[n] + oSpace[n] + "</del>";
+				}
+			}
+
+			for (var i = 0; i < out.n.length; i++) {
+				if (out.n[i].text == null) {
+					str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
+				}
+				else {
+					var pre = "";
+
+					for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
+						pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
+					}
+					str += " " + out.n[i].text + nSpace[i] + pre;
+				}
+			}
+		}
+
+		return str;
+	};
+})();
+
+})(this);

+ 11 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/style.all.css

@@ -0,0 +1,11 @@
+html { font: 75% sans-serif; overflow-y: scroll; }
+body { margin: 0; }
+pre { margin: 0; padding: 1em 0; }
+section { border: 0.5em solid #8C8; margin: 1em; padding: 1em; }
+h1 { margin: 1em 2em; }
+ul { font: bold 1.5em sans-serif; margin: 1em; padding: 0 0 0 1.5em; }
+li { margin: 1em; }
+a { color: #66C; text-decoration: none; }
+
+.pass { color: #090; }
+.fail { color: #F00; }

+ 2 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/style.css

@@ -0,0 +1,2 @@
+@import url(style.all.css);
+@import url(style.print.css);

+ 5 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/style.print.css

@@ -0,0 +1,5 @@
+@media print {
+	section {
+		border-style: dotted;
+	}
+}

+ 281 - 0
omnomirc_www/aFarkas-html5shiv-4525162/test/unit/tests.js

@@ -0,0 +1,281 @@
+(function(){
+
+module("html5shiv tests");
+var blockElements  = "article,aside,figcaption,figure,footer,header,hgroup,nav,section".split(',');
+
+var testEnv = [
+	{
+		doc: document,
+		initialShivMethods: html5.shivMethods,
+		html5: html5,
+		name: 'default'
+	}
+];
+
+
+var shivTests = function(fn, env){
+	if(!env){
+		env = testEnv[0];
+	}
+	env.html5.shivMethods = true;
+	fn();
+	env.html5.shivMethods = env.initialShivMethods;
+};
+
+var envTest = function(name, fn, frames){
+	if(!frames){
+		frames = ['default'];
+	}
+	asyncTest(name, function(){
+		$.each(testEnv, function(i, env){
+			if($.inArray(env.name, frames) != -1){
+				fn(env);
+			}
+		});
+		if(testEnv.length > 1){
+			start();
+		} else {
+			initIframes();
+		}
+	});
+	
+};
+
+QUnit.reset = function() {
+	$.each(testEnv, function(i, env){
+		$('#qunit-fixture', env.doc).html(env.fixture);
+	});
+};
+
+
+var initIframes = function(){
+	if(testEnv.length > 1){return;}
+	testEnv[0].fixture = $('#qunit-fixture').html();
+	
+	$('iframe.test-frame').each(function(){
+		var win = this.contentWindow;
+		if($('#qunit-fixture', win.document).length){
+			testEnv.push({
+				doc: win.document,
+				html5: win.html5,
+				initialShivMethods: (win.html5 || {}).shivMethods,
+				fixture: $('#qunit-fixture', win.document).html(),
+				name: this.src.split('?')[1]
+			});
+		}
+	});
+	if(testEnv.length > 1){
+		start();
+	} else {
+		setTimeout(initIframes, 30);
+	}
+};
+
+
+$(initIframes);
+
+
+envTest("display block tests", function(env){
+	$.each(blockElements, function(i, elem){
+		equals($(elem, env.doc).css('display'), 'block', elem +" has display: block");
+	});
+
+}, ['default', 'disableMethodsBefore']);
+
+envTest("test html5.createElement/html5.createDocumentFragment", function(env){
+	var doc5 = html5;
+	if(env.html5){
+		doc5 = env.html5;
+		env.html5.shivMethods = false;
+	}
+	html5.shivMethods = false;
+	
+	var fragDiv =  doc5.createElement('div', env.doc);
+	var frag = doc5.createDocumentFragment(env.doc);
+	var markText = "with these words highlighted";
+	var div = $( doc5.createElement('div', env.doc) ).html('<section><article><mark>s</mark></article>?</section>').appendTo(env.doc.getElementById('qunit-fixture'));
+	
+	fragDiv.innerHTML = '<section>This native javascript sentence is in a green box <mark>'+markText+'</mark>?</section>';
+	
+	frag.appendChild(fragDiv);
+	fragDiv.innerHTML += '<article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article>';
+	
+	env.doc.getElementById('qunit-fixture').appendChild(frag);
+	
+	equals($('section article > mark', div).length, 1, "found mark in section > article");
+	equals($('section > mark', fragDiv).html(), markText, "innerHTML getter equals innerHTML setter");
+	equals($('article', fragDiv).css('borderTopWidth'), '2px', "article has a 2px border");
+	
+	if(env.html5){
+		env.html5.shivMethods = env.initialShivMethods;
+	}
+	html5.shivMethods = true;
+}, ['disableMethodsBefore', 'disableMethodsAfter']);
+
+
+if(!html5.supportsUnknownElements){
+
+	envTest("config shivMethods test", function(env){
+		var div = $('<div/>', env.doc).html('<section><article><mark></mark></article>?</section>').appendTo(env.doc.getElementById('qunit-fixture'));
+		equals($('section article > mark', div).length, (env.html5.shivMethods) ? 1 : 0, "found/no found mark in section > article");
+	}, ['default', 'disableMethodsBefore', 'disableMethodsAfter']);
+	
+	envTest("config shivCSS test", function(env){
+		$.each(blockElements, function(i, elem){
+			equals($(elem, env.doc).css('display'), 'inline', elem +" has display: inline if unshived");
+		});
+		env.html5.shivCSS = true;
+		env.html5.shivDocument();
+		$.each(blockElements, function(i, elem){
+			equals($(elem, env.doc).css('display'), 'block', elem +" has display: block. after reshiving");
+		});
+	}, ['disableCSS']);
+}
+
+envTest("config add elements test", function(env){
+	var value = $.trim($('abcxyz', env.doc).html());
+	ok((html5.supportsUnknownElements || env.html5.elements.indexOf('abcxyz') !== -1) ? value : !value, "unknownelement has one/none div inside: "+ value);
+}, ['default', 'disableMethodsBefore', 'addUnknownBefore', 'addUnknownAfter']);
+
+envTest("parsing tests", function(env){
+	$.each(blockElements, function(i, elem){
+		equals($(elem +' div.inside', env.doc).length, 1, elem +" has a div inside");
+	});	
+}, ['default', 'disableMethodsBefore']);
+
+envTest("style test", function(env){
+	var article = $('article', env.doc);
+	equals(article.css('borderTopWidth'), '2px', "article has a 2px border");
+}, ['default', 'disableMethodsBefore']);
+
+if (!html5.supportsUnknownElements) {
+	envTest("shiv different document", function(env){
+		var markText = "with these words highlighted3";
+		var markup = '<section><article>This jQuery 1.6.4 sentence is in a green box <mark>' + markText + '</mark></article>?</section>';
+		
+		var div = $('<div/>', env.doc).html(markup).appendTo(env.doc.getElementById('qunit-fixture'));
+		equals($('section article > mark', div).length, 0, "document is not shived");
+		
+		html5.shivDocument(env.doc);
+		
+		div = $('<div/>', env.doc).html(markup).appendTo(env.doc.getElementById('qunit-fixture'));
+		equals($('section article > mark', div).length, 1, "document is shived");
+		equals($('article', div).css('borderTopWidth'), '2px', "article has a 2px border");
+		
+	}, ['noEmbed']);
+}
+	
+envTest("createElement/innerHTML test", function(env){
+	shivTests(
+		function(){
+			var div = env.doc.createElement('div');
+			var text = "This native javascript sentence is in a green box <mark>with these words highlighted</mark>?";
+			div.innerHTML = '<section id="section">'+ text +'</section>';
+			env.doc.getElementById('qunit-fixture').appendChild(div);
+			equals($('#section', env.doc).html(), text, "innerHTML getter equals innerHTML setter");
+			equals($('#section mark', env.doc).length, 1, "section has a mark element inside");
+		},
+		env
+	);
+}, ['default', 'disableMethodsBefore']);
+
+envTest("createElement/createDocumentFragment/innerHTML test", function(env){
+	shivTests(
+		function(){
+			var div = env.doc.createElement('div');
+			var frag = env.doc.createDocumentFragment();
+			var markText = "with these words highlighted";
+			div.innerHTML = '<section>This native javascript sentence is in a green box <mark>'+markText+'</mark>?</section>';
+			frag.appendChild(div);
+			div.innerHTML += '<article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article>';
+			env.doc.getElementById('qunit-fixture').appendChild(frag);
+			equals($('section > mark', div).html(), markText, "innerHTML getter equals innerHTML setter");
+			equals($('article', div).css('borderTopWidth'), '2px', "article has a 2px border");
+		},
+		env
+	);
+}, ['default', 'disableMethodsBefore']);
+
+
+envTest("createDocumentFragment/cloneNode/innerHTML test", function(env){
+	shivTests(
+		function(){
+			var frag = env.doc.createDocumentFragment();
+			var fragDiv = env.doc.createElement('div');
+			
+			var markText = "with these words highlighted2";
+			var fragDivClone;
+			frag.appendChild(fragDiv);
+			
+			fragDiv.innerHTML = '<div><article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article></div>';
+			
+			fragDivClone = fragDiv.cloneNode(true);
+			
+			env.doc.getElementById('qunit-fixture').appendChild(fragDivClone);
+			equals($('mark', env.doc).html(), markText, "innerHTML getter equals innerHTML setter");
+		},
+		env
+	);
+}, ['default', 'addUnknownAfter']);
+
+test("form test", function() {
+	shivTests(
+		function(){
+			var form = document.createElement('form');
+			var select = document.createElement('select');
+			var input = document.createElement('input');
+			var button = document.createElement('button');
+			var option = document.createElement('option');
+			var markText = "with these words highlighted2";
+			
+			form.setAttribute('action', 'some/path');
+			form.setAttribute('name', 'formName');
+			form.target = '_blank';
+			select.name = 'selectName';
+			option.value = '1.value';
+			button.setAttribute('type', 'submit');
+			input.type = 'submit';
+			
+			form.innerHTML = '<article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article>';
+			
+			
+			form.appendChild(select);
+			form.appendChild(button);
+			form.appendChild(input);
+			
+			
+			
+			if(select.add){
+				try {
+					select.add(option);
+				} catch(er){
+					select.appendChild(option);
+				}
+			} else {
+				select.appendChild(option);
+			}
+			document.getElementById('qunit-fixture').appendChild(form);
+			
+			equals($('select option', form).val(), '1.value', "select has one option with value");
+			equals($('article > mark', form).html(), markText, "innerHTML getter equals innerHTML setter");
+			equals($('article', form).css('borderTopWidth'), '2px', "article has a 2px border");
+		}
+	);
+});
+
+envTest("jQuery test", function(env){
+	shivTests(
+		function(){
+			var markText = "with these words highlighted3";
+			var div = $('<div/>', env.doc).html('<section><article>This jQuery 1.6.4 sentence is in a green box <mark>'+markText+'</mark></article>?</section>').appendTo(env.doc.getElementById('qunit-fixture'));
+			equals($('article > mark', div).html(), markText, "innerHTML getter equals innerHTML setter");
+			equals($('article', div).css('borderTopWidth'), '2px', "article has a 2px border");
+		},
+		env
+	);
+});
+
+
+
+
+})();

BIN
omnomirc_www/beep.wav


+ 5 - 0
omnomirc_www/brokenphp.php

@@ -0,0 +1,5 @@
+<?php
+// Broken PHP file for 500.html testing
+faij39t04jgqewovdsml
+dsve]g!R#*T*()E)G)#I(@*$()!%*#!(%()$@*^()*(
+?>

+ 348 - 0
omnomirc_www/btoa.js

@@ -0,0 +1,348 @@
+/*
+	This file is part of OmnomIRC. It is not created by OmnomIRC authors. It is believed that this is in agreement with
+	all applicable licenses and restrictions.
+*/
+/*
+ * Text replace stuff
+ * 
+ * found in omnimaga themes js
+ */
+function replaceText(text,textarea)
+{if(typeof(textarea.caretPos)!="undefined"&&textarea.createTextRange)
+{var caretPos=textarea.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length- 1)==' '?text+' ':text;caretPos.select();}
+else if(typeof(textarea.selectionStart)!="undefined")
+{var begin=textarea.value.substr(0,textarea.selectionStart);var end=textarea.value.substr(textarea.selectionEnd);var scrollPos=textarea.scrollTop;textarea.value=begin+ text+ end;if(textarea.setSelectionRange)
+{textarea.focus();textarea.setSelectionRange(begin.length+ text.length,begin.length+ text.length);}
+textarea.scrollTop=scrollPos;}
+else
+{textarea.value+=text;textarea.focus(textarea.value.length- 1);}}
+function surroundText(text1,text2,textarea)
+{if(typeof(textarea.caretPos)!="undefined"&&textarea.createTextRange)
+{var caretPos=textarea.caretPos,temp_length=caretPos.text.length;caretPos.text=caretPos.text.charAt(caretPos.text.length- 1)==' '?text1+ caretPos.text+ text2+' ':text1+ caretPos.text+ text2;if(temp_length==0)
+{caretPos.moveStart("character",-text2.length);caretPos.moveEnd("character",-text2.length);caretPos.select();}
+else
+textarea.focus(caretPos);}
+else if(typeof(textarea.selectionStart)!="undefined")
+{var begin=textarea.value.substr(0,textarea.selectionStart);var selection=textarea.value.substr(textarea.selectionStart,textarea.selectionEnd- textarea.selectionStart);var end=textarea.value.substr(textarea.selectionEnd);var newCursorPos=textarea.selectionStart;var scrollPos=textarea.scrollTop;textarea.value=begin+ text1+ selection+ text2+ end;if(textarea.setSelectionRange)
+{if(selection.length==0)
+textarea.setSelectionRange(newCursorPos+ text1.length,newCursorPos+ text1.length);else
+textarea.setSelectionRange(newCursorPos,newCursorPos+ text1.length+ selection.length+ text2.length);textarea.focus();}
+textarea.scrollTop=scrollPos;}
+else
+{textarea.value+=text1+ text2;textarea.focus(textarea.value.length- 1);}}
+/* Cookie functions
+ * Copyright (c) by w3schools.com
+ * yeah, i am a loser that i look there >.<
+ * 
+ * 
+ */
+function setCookie(c_name,value,exdays) {
+	var exdate=new Date();
+	exdate.setDate(exdate.getDate() + exdays);
+	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
+	document.cookie=c_name + "=" + c_value;
+}
+function getCookie(c_name) {
+	var i,x,y,ARRcookies=document.cookie.split(";");
+	for (i=0;i<ARRcookies.length;i++) {
+		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
+		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
+		x=x.replace(/^\s+|\s+$/g,"");
+		if (x==c_name) {
+			return unescape(y);
+			}
+	}
+}
+
+/* UTF8 encoding/decoding functions
+ * Copyright (c) 2006 by Ali Farhadi.
+ * released under the terms of the Gnu Public License.
+ * see the GPL for details.
+ *
+ * Email: ali[at]farhadi[dot]ir
+ * Website: http://farhadi.ir/
+ */
+
+
+//an alias of String.fromCharCode
+function chr(code)
+{
+	return String.fromCharCode(code);
+}
+
+//returns utf8 encoded charachter of a unicode value.
+//code must be a number indicating the Unicode value.
+//returned value is a string between 1 and 4 charachters.
+function code2utf(code)
+{
+	if (code < 128) return chr(code);
+	if (code < 2048) return chr(192+(code>>6)) + chr(128+(code&63));
+	if (code < 65536) return chr(224+(code>>12)) + chr(128+((code>>6)&63)) + chr(128+(code&63));
+	if (code < 2097152) return chr(240+(code>>18)) + chr(128+((code>>12)&63)) + chr(128+((code>>6)&63)) + chr(128+(code&63));
+}
+
+//it is a private function for internal use in utf8Encode function 
+function _utf8Encode(str)
+{	
+	var utf8str = new Array();
+	for (var i=0; i<str.length; i++) {
+		utf8str[i] = code2utf(str.charCodeAt(i));
+	}
+	return utf8str.join('');
+}
+
+//Encodes a unicode string to UTF8 format.
+function utf8Encode(str)
+{	
+	var utf8str = new Array();
+	var pos,j = 0;
+	var tmpStr = '';
+	
+	while ((pos = str.search(/[^\x00-\x7F]/)) != -1) {
+		tmpStr = str.match(/([^\x00-\x7F]+[\x00-\x7F]{0,10})+/)[0];
+		utf8str[j++] = str.substr(0, pos);
+		utf8str[j++] = _utf8Encode(tmpStr);
+		str = str.substr(pos + tmpStr.length);
+	}
+	
+	utf8str[j++] = str;
+	return utf8str.join('');
+}
+
+//it is a private function for internal use in utf8Decode function 
+function _utf8Decode(utf8str)
+{	
+	var str = new Array();
+	var code,code2,code3,code4,j = 0;
+	for (var i=0; i<utf8str.length; ) {
+		code = utf8str.charCodeAt(i++);
+		if (code > 127) code2 = utf8str.charCodeAt(i++);
+		if (code > 223) code3 = utf8str.charCodeAt(i++);
+		if (code > 239) code4 = utf8str.charCodeAt(i++);
+		
+		if (code < 128) str[j++]= chr(code);
+		else if (code < 224) str[j++] = chr(((code-192)<<6) + (code2-128));
+		else if (code < 240) str[j++] = chr(((code-224)<<12) + ((code2-128)<<6) + (code3-128));
+		else str[j++] = chr(((code-240)<<18) + ((code2-128)<<12) + ((code3-128)<<6) + (code4-128));
+	}
+	return str.join('');
+}
+
+//Decodes a UTF8 formated string
+function utf8Decode(utf8str)
+{
+	var str = new Array();
+	var pos = 0;
+	var tmpStr = '';
+	var j=0;
+	while ((pos = utf8str.search(/[^\x00-\x7F]/)) != -1) {
+		tmpStr = utf8str.match(/([^\x00-\x7F]+[\x00-\x7F]{0,10})+/)[0];
+		str[j++]= utf8str.substr(0, pos) + _utf8Decode(tmpStr);
+		utf8str = utf8str.substr(pos + tmpStr.length);
+	}
+	
+	str[j++] = utf8str;
+	return str.join('');
+}
+
+/*
+ * Copyright (c) 2010 Nick Galbreath
+ * http://code.google.com/p/stringencoders/source/browse/#svn/trunk/javascript
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/* base64 encode/decode compatible with window.btoa/atob
+ *
+ * window.atob/btoa is a Firefox extension to convert binary data (the "b")
+ * to base64 (ascii, the "a").
+ *
+ * It is also found in Safari and Chrome.  It is not available in IE.
+ *
+ * if (!window.btoa) window.btoa = base64.encode
+ * if (!window.atob) window.atob = base64.decode
+ *
+ * The original spec's for atob/btoa are a bit lacking
+ * https://developer.mozilla.org/en/DOM/window.atob
+ * https://developer.mozilla.org/en/DOM/window.btoa
+ *
+ * window.btoa and base64.encode takes a string where charCodeAt is [0,255]
+ * If any character is not [0,255], then an DOMException(5) is thrown.
+ *
+ * window.atob and base64.decode take a base64-encoded string
+ * If the input length is not a multiple of 4, or contains invalid characters
+ *   then an DOMException(5) is thrown.
+ */
+var base64 = {};
+base64.PADCHAR = ',';
+base64.ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
+
+base64.makeDOMException = function() {
+    // sadly in FF,Safari,Chrome you can't make a DOMException
+    var e, tmp;
+
+
+    try {
+        return new DOMException(DOMException.INVALID_CHARACTER_ERR);
+    } catch (tmp) {
+        // not available, just passback a duck-typed equiv
+        // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error
+        // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Error/prototype
+        var ex = new Error("DOM Exception 5");
+
+
+        // ex.number and ex.description is IE-specific.
+        ex.code = ex.number = 5;
+        ex.name = ex.description = "INVALID_CHARACTER_ERR";
+
+
+        // Safari/Chrome output format
+        ex.toString = function() { return 'Error: ' + ex.name + ': ' + ex.message; };
+        return ex;
+    }
+}
+
+
+base64.getbyte64 = function(s,i) {
+    // This is oddly fast, except on Chrome/V8.
+    //  Minimal or no improvement in performance by using a
+    //   object with properties mapping chars to value (eg. 'A': 0)
+    var idx = base64.ALPHA.indexOf(s.charAt(i));
+    if (idx === -1) {
+        //throw base64.makeDOMException();
+    }
+    return idx;
+}
+
+
+base64.decode = function(s) {
+	
+    // convert to string
+    s = '' + s;
+	s = s.replace("+","-");
+	s = s.replace("/","_");
+	s = s.replace("=",",");
+    var getbyte64 = base64.getbyte64;
+    var pads, i, b10;
+    var imax = s.length
+    if (imax === 0) {
+        return s;
+    }
+
+
+    if (imax % 4 !== 0) {
+        //throw base64.makeDOMException();
+    }
+
+
+    pads = 0
+    if (s.charAt(imax - 1) === base64.PADCHAR) {
+        pads = 1;
+        if (s.charAt(imax - 2) === base64.PADCHAR) {
+            pads = 2;
+        }
+        // either way, we want to ignore this last block
+        imax -= 4;
+    }
+
+
+    var x = [];
+    for (i = 0; i < imax; i += 4) {
+        b10 = (getbyte64(s,i) << 18) | (getbyte64(s,i+1) << 12) |
+            (getbyte64(s,i+2) << 6) | getbyte64(s,i+3);
+        x.push(String.fromCharCode(b10 >> 16, (b10 >> 8) & 0xff, b10 & 0xff));
+    }
+
+
+    switch (pads) {
+    case 1:
+        b10 = (getbyte64(s,i) << 18) | (getbyte64(s,i+1) << 12) | (getbyte64(s,i+2) << 6);
+        x.push(String.fromCharCode(b10 >> 16, (b10 >> 8) & 0xff));
+        break;
+    case 2:
+        b10 = (getbyte64(s,i) << 18) | (getbyte64(s,i+1) << 12);
+        x.push(String.fromCharCode(b10 >> 16));
+        break;
+    }
+    return s=utf8Decode(x.join(''));
+}
+
+
+base64.getbyte = function(s,i) {
+    var x = s.charCodeAt(i);
+    if (x > 255) {
+        //throw base64.makeDOMException();
+    }
+    return x;
+}
+
+
+base64.encode = function(s) {
+	s=unescape(encodeURIComponent(s));
+    if (arguments.length !== 1) {
+        throw new SyntaxError("Not enough arguments");
+    }
+    var padchar = base64.PADCHAR;
+    var alpha   = base64.ALPHA;
+    var getbyte = base64.getbyte;
+
+
+    var i, b10;
+    var x = [];
+
+
+    // convert to string
+    s = '' + s;
+
+
+    var imax = s.length - s.length % 3;
+
+
+    if (s.length === 0) {
+        return s;
+    }
+    for (i = 0; i < imax; i += 3) {
+        b10 = (getbyte(s,i) << 16) | (getbyte(s,i+1) << 8) | getbyte(s,i+2);
+        x.push(alpha.charAt(b10 >> 18));
+        x.push(alpha.charAt((b10 >> 12) & 0x3F));
+        x.push(alpha.charAt((b10 >> 6) & 0x3f));
+        x.push(alpha.charAt(b10 & 0x3f));
+    }
+    switch (s.length - imax) {
+    case 1:
+        b10 = getbyte(s,i) << 16;
+        x.push(alpha.charAt(b10 >> 18) + alpha.charAt((b10 >> 12) & 0x3F) +
+               padchar + padchar);
+        break;
+    case 2:
+        b10 = (getbyte(s,i) << 16) | (getbyte(s,i+1) << 8);
+        x.push(alpha.charAt(b10 >> 18) + alpha.charAt((b10 >> 12) & 0x3F) +
+               alpha.charAt((b10 >> 6) & 0x3f) + padchar);
+        break;
+    }
+	s = x.join('');
+	s = s.replace("+","-");
+	s = s.replace("/","_");
+	s = s.replace("=",",");
+    return s;
+}

+ 4 - 0
omnomirc_www/callback.php

@@ -0,0 +1,4 @@
+<?PHP
+header('Content-type: text/javascript');
+echo "parent.signCallback('".base64_url_decode($_GET['signature'])."','".base64_url_decode($_GET['nick'])."');"
+?>

+ 12 - 0
omnomirc_www/dbinfo.sql

@@ -0,0 +1,12 @@
+DROP TABLE IF EXISTS `irc_users`;
+CREATE TABLE `irc_users` (  `usernum` int(11) NOT NULL AUTO_INCREMENT,  `username` varchar(45) NOT NULL,  `channel` varchar(45) NOT NULL,  `online` int(50) NOT NULL DEFAULT '0', `time` varchar(45) NOT NULL, PRIMARY KEY (`usernum`)) ENGINE=InnoDB AUTO_INCREMENT=210612849 DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS `irc_permissions`;
+CREATE TABLE `irc_permissions` (  `generic_autoincrementing_prikey` int(11) NOT NULL AUTO_INCREMENT,  `username` varchar(120) DEFAULT NULL,  `channel` varchar(120) NOT NULL,  `modes` varchar(120) NOT NULL,  `isChanModes` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`generic_autoincrementing_prikey`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+DROP TABLE IF EXISTS `irc_outgoing_messages`;
+CREATE TABLE `irc_outgoing_messages` (  `prikey` int(11) NOT NULL AUTO_INCREMENT,  `message` varchar(1024) NOT NULL,  `nick` varchar(45) NOT NULL,  `channel` varchar(45) NOT NULL,  `action` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`prikey`)) ENGINE=InnoDB AUTO_INCREMENT=6069 DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS `irc_lines`;
+CREATE TABLE `irc_lines` (`line_number` int(10) unsigned NOT NULL AUTO_INCREMENT,  `name1` varchar(45) NOT NULL,  `name2` varchar(45) DEFAULT NULL,  `message` varchar(1024) DEFAULT NULL,  `type` varchar(45) NOT NULL,  `channel` varchar(45) NOT NULL,  `time` varchar(45) NOT NULL,  `Online` tinyint(1) NOT NULL DEFAULT '0',  PRIMARY KEY (`line_number`)) ENGINE=InnoDB AUTO_INCREMENT=126652 DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS `irc_ignorelist`;
+CREATE TABLE `irc_ignorelist` (  `usernum` int(11) NOT NULL AUTO_INCREMENT,  `name` varchar(45) NOT NULL,  `ignores` varchar(1024) NOT NULL,  PRIMARY KEY (`usernum`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+DROP TABLE IF EXISTS `irc_topics`;
+CREATE TABLE `irc_topics` (  `channum` int(11) NOT NULL AUTO_INCREMENT,  `chan` varchar(45) NOT NULL,  `topic` varchar(1024) NOT NULL,  PRIMARY KEY (`channum`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

BIN
omnomirc_www/error.png


+ 11 - 0
omnomirc_www/html5shiv-printshiv.js

@@ -0,0 +1,11 @@
+/*
+ HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+(function(j,f){function s(a,b){var c=a.createElement("p"),m=a.getElementsByTagName("head")[0]||a.documentElement;c.innerHTML="x<style>"+b+"</style>";return m.insertBefore(c.lastChild,m.firstChild)}function o(){var a=d.elements;return"string"==typeof a?a.split(" "):a}function n(a){var b=t[a[u]];b||(b={},p++,a[u]=p,t[p]=b);return b}function v(a,b,c){b||(b=f);if(e)return b.createElement(a);c||(c=n(b));b=c.cache[a]?c.cache[a].cloneNode():y.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);
+return b.canHaveChildren&&!z.test(a)?c.frag.appendChild(b):b}function A(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();a.createElement=function(c){return!d.shivMethods?b.createElem(c):v(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+o().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(d,b.frag)}
+function w(a){a||(a=f);var b=n(a);if(d.shivCSS&&!q&&!b.hasCSS)b.hasCSS=!!s(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}");e||A(a,b);return a}function B(a){for(var b,c=a.attributes,m=c.length,f=a.ownerDocument.createElement(l+":"+a.nodeName);m--;)b=c[m],b.specified&&f.setAttribute(b.nodeName,b.nodeValue);f.style.cssText=a.style.cssText;return f}function x(a){function b(){clearTimeout(d._removeSheetTimer);c&&c.removeNode(!0);c=null}
+var c,f,d=n(a),e=a.namespaces,j=a.parentWindow;if(!C||a.printShived)return a;"undefined"==typeof e[l]&&e.add(l);j.attachEvent("onbeforeprint",function(){b();var g,i,d;d=a.styleSheets;for(var e=[],h=d.length,k=Array(h);h--;)k[h]=d[h];for(;d=k.pop();)if(!d.disabled&&D.test(d.media)){try{g=d.imports,i=g.length}catch(j){i=0}for(h=0;h<i;h++)k.push(g[h]);try{e.push(d.cssText)}catch(n){}}g=e.reverse().join("").split("{");i=g.length;h=RegExp("(^|[\\s,>+~])("+o().join("|")+")(?=[[\\s,>+~#.:]|$)","gi");for(k=
+"$1"+l+"\\:$2";i--;)e=g[i]=g[i].split("}"),e[e.length-1]=e[e.length-1].replace(h,k),g[i]=e.join("}");e=g.join("{");i=a.getElementsByTagName("*");h=i.length;k=RegExp("^(?:"+o().join("|")+")$","i");for(d=[];h--;)g=i[h],k.test(g.nodeName)&&d.push(g.applyElement(B(g)));f=d;c=s(a,e)});j.attachEvent("onafterprint",function(){for(var a=f,c=a.length;c--;)a[c].removeNode();clearTimeout(d._removeSheetTimer);d._removeSheetTimer=setTimeout(b,500)});a.printShived=!0;return a}var r=j.html5||{},z=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
+y=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q,u="_html5shiv",p=0,t={},e;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";q="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}e=b}catch(d){e=q=!0}})();var d={elements:r.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
+version:"3.6.2pre",shivCSS:!1!==r.shivCSS,supportsUnknownElements:e,shivMethods:!1!==r.shivMethods,type:"default",shivDocument:w,createElement:v,createDocumentFragment:function(a,b){a||(a=f);if(e)return a.createDocumentFragment();for(var b=b||n(a),c=b.frag.cloneNode(),d=0,j=o(),l=j.length;d<l;d++)c.createElement(j[d]);return c}};j.html5=d;w(f);var D=/^$|\b(?:all|print)\b/,l="html5shiv",C=!e&&function(){var a=f.documentElement;return!("undefined"==typeof f.namespaces||"undefined"==typeof f.parentWindow||
+"undefined"==typeof a.applyElement||"undefined"==typeof a.removeNode||"undefined"==typeof j.attachEvent)}();d.type+=" print";d.shivPrint=x;x(f)})(this,document);

+ 8 - 0
omnomirc_www/html5shiv.js

@@ -0,0 +1,8 @@
+/*
+ HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
+a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
+c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||
+"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment();
+for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

+ 185 - 0
omnomirc_www/index.php

@@ -0,0 +1,185 @@
+<?php
+if (strpos($_SERVER['HTTP_USER_AGENT'],"textmode;")===false) {?>
+<!--
+/*
+    OmnomIRC COPYRIGHT 2010,2011 Netham45
+
+    This file is part of OmnomIRC.
+
+    OmnomIRC 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 3 of the License, or
+    (at your option) any later version.
+
+    OmnomIRC 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 OmnomIRC.  If not, see <http://www.gnu.org/licenses/>.
+*/
+!-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>OmnomIRC V2</title>
+<link rel="stylesheet" type="text/css" href="style.css" />
+<script src="config.js"></script>
+<script src="btoa.js"></script>
+<script type="text/javascript">
+	document.domain=HOSTNAME;
+	
+	function AJAXSend() {
+		Message = document.getElementById("message").value;
+		sendAJAXMessage(userName,Signature,Message,"#Omnimaga");
+		oldMessages.push(Message);
+		document.getElementById("message").value = "";
+		document.getElementById("message").focus();
+		if (oldMessages.length>20)
+			oldMessages.shift();
+		messageCounter = oldMessages.length;
+		setCookie("oldMessages-"+getChannelEn(),oldMessages.join("\n"),30);
+	}
+	
+	function resize()
+	{
+		var offset = 42;
+		if ("\v" != "v")
+		{
+			winbg2=document.getElementById("windowbg2");
+			msg = document.getElementById("message");
+			send = document.getElementById("send");
+			newHeight = window.innerHeight - (msg.clientHeight + 14) + "px";
+			winbg2.style.height = newHeight;
+
+			messageBox.style.height = winbg2.clientHeight - offset + "px";
+			mBoxCont.style.height = winbg2.clientHeight - offset + "px";
+			mBoxCont.scrollTop = mBoxCont.scrollHeight;
+			msg.style.width = mBoxCont.clientWidth - send.clientWidth - "39" + "px";
+			msg.style.left = "0px";
+		}
+		else
+		{
+			page = document.getElementsByTagName("html")[0];
+			winbg2=document.getElementById("windowbg2");
+			msg = document.getElementById("message");
+			send = document.getElementById("send");
+			winbg2.style.height = page.clientHeight - msg.clientHeight - offset + "px";
+			messageBox.style.height = winbg2.clientHeight - offset + "px";
+			mBoxCont.style.height = winbg2.clientHeight - offset + "px";
+			mBoxCont.scrollTop = mBoxCont.scrollHeight;
+			msg.style.width = mBoxCont.clientWidth - send.clientWidth - "39" + "px";
+			msg.style.left = "0px";
+		}
+	}
+	window.onresize = resize;
+</script>
+</head>
+<body style="overflow:hidden;margin:0px;padding:0px;*height:100%">
+<div class="windowbg2" id="windowbg2" style="width:100%;height:100%;overflow:hidden;">
+<div id="Channels" style="width:90%;overflow:hidden;position:absolute;overflow-x:hidden;overflow-y:hidden;">
+<div id="ChanListButtons" style="width:98%;overflow:hidden;display:inline;position:relative;left:0px;top:4px;">
+	<span style="font-size:10pt;" class="arrowButton" onmousedown="menul=setInterval('document.getElementById(\'ChanListCont\').scrollLeft -= 9',50)" onmouseup="clearInterval(menul)" onmouseout="clearInterval(menul)">&#9668;</span>
+	<span style="font-size:10pt;" class="arrowButton" onmousedown="menur=setInterval('document.getElementById(\'ChanListCont\').scrollLeft += 9',50)" onmouseup="clearInterval(menur)" onmouseout="clearInterval(menur)">&#9658;</span>
+</div>
+
+<div id="ChanListCont" style="width:96%;overflow-x:hidden;display:block;position:relative;left:23px;top:-16px;">
+	<div id="ChanList" style="width:500%"></div>
+</div>
+</div>
+<div id="topicbox" style="width:90%;overflow:hidden;position:absolute;overflow-x:hidden;overflow-y:hidden;left:0px;top:26px;margin:0;padding:0;">
+	<div id="TopicButtons" style="width:98%;overflow:hidden;display:inline;position:relative;left:0px;top:-2px;margin:0;padding:0;">
+		<span style="font-size:8pt;" class="arrowButton" onmousedown="menul=setInterval('document.getElementById(\'topicCont\').scrollLeft -= 9',50)" onmouseup="clearInterval(menul)" onmouseout="clearInterval(menul)">&#9668;</span>
+		<span style="font-size:8pt;" class="arrowButton" onmousedown="menur=setInterval('document.getElementById(\'topicCont\').scrollLeft += 9',50)" onmouseup="clearInterval(menur)" onmouseout="clearInterval(menur)">&#9658;</span>
+	</div>
+	<div id="topicCont" style="width:96%;overflow-x:hidden;display:block;position:relative;left:23px;top:-16px;margin:0;padding:0;">
+		<div id="topic" style="white-space:nowrap;"></div>
+	</div>
+</div>
+<br/>
+<br/>
+<br/>
+<div id="mboxCont" style="width:90%;height:100%;overflow:hidden;position:relative;overflow-x:hidden;overflow-y:hidden;"></div>
+	<span class="arrowButtonHoriz3"><div style="font-size:12pt;width:12%;height:9pt;top:0;left:90%;position:absolute;font-weight:bolder;margin-top:10pt;margin-left:-10pt;" class="arrowButtonHoriz2">&#9650;</div>
+	<div style="font-size:12pt;width:12%;height:9pt;top:0;left:90%;position:absolute;margin-top:10pt;margin-left:-10pt;" onmousedown="downIntM = setInterval('document.getElementById(\'mboxCont\').scrollTop -= 9;scrolledDown=false;',50);" onmouseout="clearInterval(downIntM);" onmouseup="clearInterval(downIntM);"></div></span>
+	<span class="arrowButtonHoriz3"><div style="font-size:12pt;width:12%;height:9pt;top:100%;left:90%;position:absolute;margin-top:-10pt;margin-left:-10pt;font-weight:bolder;" class="arrowButtonHoriz2">&#9660;</div>
+	<div style="font-size:12pt;width:12%;height:9pt;top:100%;left:90%;position:absolute;margin-top:-10pt;margin-left:-10pt;" onmousedown="upIntM = setInterval('document.getElementById(\'mboxCont\').scrollTop += 9;if (mBoxCont.scrollTop+mBoxCont.clientHeight==mBoxCont.scrollHeight)scrolledDown=true;',50);" onmouseout="clearInterval(upIntM);" onmouseup="clearInterval(upIntM);"></div></span>
+
+<div id="UserListContainer" style="width:10%;height:98%;left:90%;top:0;position:absolute;color:#222;border-style:dashed;border-width:1px;border-right-color:#000;overflow:hidden;">
+	<span style="left:10%;position:relative;font-size:6pt;"><!--<a href="http://omnom.omnimaga.org/irc/efnet/?channel=omnimaga#bottom" target="_TOP">Logs</a><br/>--><a href="http://www.omnimaga.org/OmnomIRC_Full.html" target="_TOP">Full View</a><br/><a id="toggle" href="#" onclick="toggleEnable();">Toggle</a><br/><a href="Options.html" accesskey="o" alt="OmnomIRC Options" title="OmnomIRC Options">Options</a></span>
+	<div id="UserList" style="position:relative;left:10%;height:88%;top:1%;width:120%;font-family:verdana,sans-serif;overflow-x:hidden;overflow-y:scroll;">
+	</div>
+	<span class="arrowButtonHoriz3"><div style="width:12%;height:9pt;top:0pt;left:78%;position:absolute;font-weight:bolder;margin-top:10pt;" class="arrowButtonHoriz2">&#9650;</div>
+	<div style="width:12%;height:9pt;top:0pt;left:78%;position:absolute;margin-top:10pt;" onmousedown="downInt = setInterval('userListDiv.scrollTop -= 9',50);" onmouseout="clearInterval(downInt);" onmouseup="clearInterval(downInt);"></div></span>
+	<span class="arrowButtonHoriz3"><div style="width:12%;height:9pt;top:100%;left:78%;position:absolute;margin-top:-10pt;font-weight:bolder;" class="arrowButtonHoriz2">&#9660;</div>
+	<div style="width:12%;height:9pt;top:100%;left:78%;position:absolute;margin-top:-10pt;" onmousedown="upInt = setInterval('userListDiv.scrollTop += 9',50);" onmouseout="clearInterval(upInt);" onmouseup="clearInterval(upInt);"></div></span>
+	</div>
+</div>
+</div><img id="smileyMenuButton" src="smileys/smiley.gif" style="cursor:pointer;margin-left:2px;margin-right:2px;" onclick="if(showSmileys){if(document.getElementById('smileyselect').style.display==''){document.getElementById('smileyselect').style.display='none';this.src='smileys/smiley.gif';}else{document.getElementById('smileyselect').style.display='';this.src='smileys/tongue.gif';}}"><form style="Display:inline;" name="irc" action="javascript:void(0)" onSubmit="AJAXSend()"><input autocomplete="off" accesskey="i" type="text" name="message" id="message" size="128" maxlength="256" alt="OmnomIRC" title="OmnomIRC"/><input type="submit" value="Send" id="send" /></form>
+
+<div id="smileyselect" style="display:none;">
+	<img src="smileys/smiley.gif" alt="Smiley" title="Smiley" onclick="replaceText(' :)', document.forms.irc.message); return false;">
+	<img src="smileys/wink.gif" alt="Wink" title="Wink" onclick="replaceText(' ;)', document.forms.irc.message); return false;">
+	<img src="smileys/cheesy.gif" alt="Cheesy" title="Cheesy" onclick="replaceText(' :D', document.forms.irc.message); return false;">
+	<img src="smileys/grin.gif" alt="Grin" title="Grin" onclick="replaceText(' ;D', document.forms.irc.message); return false;">
+	<img src="smileys/angry.gif" alt="Angry" title="Angry" onclick="replaceText(' &gt;:(', document.forms.irc.message); return false;">
+	<img src="smileys/sad.gif" alt="Sad" title="Sad" onclick="replaceText(' :(', document.forms.irc.message); return false;">
+	<img src="smileys/shocked.gif" alt="Shocked" title="Shocked" onclick="replaceText(' :o', document.forms.irc.message); return false;">
+	<img src="smileys/cool.gif" alt="Cool" title="Cool" onclick="replaceText(' 8)', document.forms.irc.message); return false;">
+	<img src="smileys/huh.gif" alt="Huh?" title="Huh?" onclick="replaceText(' ???', document.forms.irc.message); return false;">
+	<img src="smileys/rolleyes.gif" alt="Roll Eyes" title="Roll Eyes" onclick="replaceText(' ::)', document.forms.irc.message); return false;">
+	<img src="smileys/tongue.gif" alt="Tongue" title="Tongue" onclick="replaceText(' :P', document.forms.irc.message); return false;">
+	<img src="smileys/embarrassed.gif" alt="Embarrassed" title="Embarrassed" onclick="replaceText(' :-[', document.forms.irc.message); return false;">
+	<img src="smileys/lipsrsealed.gif" alt="Lips Sealed" title="Lips Sealed" onclick="replaceText(' :-X', document.forms.irc.message); return false;">
+	<img src="smileys/undecided.gif" alt="Undecided" title="Undecided" onclick="replaceText(' :-\\', document.forms.irc.message); return false;">
+	<img src="smileys/kiss.gif" alt="Kiss" title="Kiss" onclick="replaceText(' :-*', document.forms.irc.message); return false;">
+	<img src="smileys/cry.gif" alt="Cry" title="Cry" onclick="replaceText(' :\'(', document.forms.irc.message); return false;">
+	<img src="smileys/thumbsupsmiley.gif" alt="Good job" title="Good job" onclick="replaceText(' :thumbsup:', document.forms.irc.message); return false;">
+	<img src="smileys/evil.gif" alt="Evil" title="Evil" onclick="replaceText(' &gt;:D', document.forms.irc.message); return false;">
+	<img src="smileys/shocked2.gif" alt="shocked" title="shocked" onclick="replaceText(' O.O', document.forms.irc.message); return false;">
+	<img src="smileys/azn.gif" alt="Azn" title="Azn" onclick="replaceText(' ^-^', document.forms.irc.message); return false;">
+	<img src="smileys/alien2.gif" alt="Alien" title="Alien" onclick="replaceText(' &gt;B)', document.forms.irc.message); return false;">
+	<img src="smileys/banghead.gif" alt="Frustrated" title="Frustrated" onclick="replaceText(' :banghead:', document.forms.irc.message); return false;">
+	<img src="smileys/ange.gif" alt="Angel" title="Angel" onclick="replaceText(' :angel:', document.forms.irc.message); return false;">
+	<img src="smileys/blah.gif" alt="Blah" title="Blah" onclick="replaceText(' ._.', document.forms.irc.message); return false;">
+	<img src="smileys/devil.gif" alt="Devil" title="Devil" onclick="replaceText(' :devil:', document.forms.irc.message); return false;">
+	<img src="smileys/dry.gif" alt="&lt;_&lt;" title="&lt;_&lt;" onclick="replaceText(' &lt;_&lt;', document.forms.irc.message); return false;">
+	<img src="smileys/evillaugh.gif" alt="Evil Laugh" title="Evil Laugh" onclick="replaceText(' :evillaugh:', document.forms.irc.message); return false;">
+	<img src="smileys/fou.gif" alt="Crazy" title="Crazy" onclick="replaceText(' :crazy:', document.forms.irc.message); return false;">
+	<img src="smileys/happy0075.gif" alt="You just lost the game" title="You just lost the game" onclick="replaceText(' :hyper:', document.forms.irc.message); return false;">
+	<img src="smileys/love.gif" alt="Love" title="Love" onclick="replaceText(' :love:', document.forms.irc.message); return false;">
+	<img src="smileys/mad.gif" alt="Mad" title="Mad" onclick="replaceText(' :mad:', document.forms.irc.message); return false;">
+	<img src="smileys/smiley_woot.gif" alt="w00t" title="w00t" onclick="replaceText(' :w00t:', document.forms.irc.message); return false;">
+	<img src="smileys/psychedelicO_O.gif" alt="I must have had too much radiation for breakfast..." title="I must have had too much radiation for breakfast..." onclick="replaceText(' *.*', document.forms.irc.message); return false;">
+	<img src="smileys/bigfrown.gif" alt="Big frown" title="Big frown" onclick="replaceText(' D:', document.forms.irc.message); return false;">
+	<img src="smileys/XD.gif" alt="Big smile" title="Big smile" onclick="replaceText(' XD', document.forms.irc.message); return false;">
+	<img src="smileys/X_X.gif" alt="x.x" title="x.x" onclick="replaceText(' x.x', document.forms.irc.message); return false;">
+	<img src="smileys/ninja.gif" alt="Get Ninja'd" title="Get Ninja'd" onclick="replaceText(' :ninja:', document.forms.irc.message); return false;">
+</div>
+<div id="indicator" style="position:absolute;z-index:10;margin:0;padding:0;top:0;right:0;"></div>
+
+<script src="Omnom_Options.js"></script>
+<script src="Omnom_Parser.js"></script>
+<script src="Omnom_Tab.js"></script>
+<script src="Omnom_Misc.js"></script>
+
+<script type="text/javascript">
+	startIndicator();
+	
+	function signCallback(sig,nick) {
+		Signature = sig;
+		userName = nick;
+		load();
+	}
+	resize();
+</script>
+<script src="http://www.omnimaga.org/checkLogin.php"></script>
+<audio id="ding" src="beep.wav" hidden></audio>
+</body>
+</html>
+<?php
+} else {
+	header('Location: http://www.omnimaga.org/checkLogin.php?textmode');
+}
+?>

+ 150 - 0
omnomirc_www/install.php

@@ -0,0 +1,150 @@
+<?PHP
+
+	error_reporting(E_ALL);
+	ini_set('display_errors', '1');
+	date_default_timezone_set("America/Denver"); //Leave me alone.
+	if (isset($_GET['back']))
+		$back=true;
+	else
+		$back=false;
+	session_start();
+	if (!isset($_SESSION['stage']))
+		$_SESSION['stage']=0;
+	else
+		if($back)
+			$_SESSION['stage']--;
+		else
+			$_SESSION['stage']++;
+	if ($_SESSION['stage'] < 0) $_SESSION['stage']++;
+	$stage = $_SESSION['stage'];
+	if (!isset($_SESSION['server']))   $_SESSION['server']   = "";
+	if (!isset($_SESSION['database'])) $_SESSION['database'] = "";
+	if (!isset($_SESSION['username'])) $_SESSION['username'] = "";
+	if (!isset($_SESSION['password'])) $_SESSION['password'] = "";
+	if (!isset($_SESSION['hostname'])) $_SESSION['hostname'] = "";
+	
+?>
+<html>
+<head>
+<title>OmnomIRC Installer</title>
+</head>
+<body>
+OmnomIRC installer<br/>
+<form action="install.php" method="post">
+<?PHP
+	switch($stage)
+	{
+		case 0://Welcome
+			echo "Welcome to OmnomIRC! This is the installer. To use OmnomIRC, you must have a PHP install and a MySQL server.<br/>";
+			echo '<input type="submit" value="Next"/>';
+		break;
+		case 1://I am bender, please insert data
+			echo 'I need a few pieces of information from you to set up OmnomIRC.<br/>';
+			if (isset($_SESSION['error']))
+			{
+				echo ($_SESSION['error']);
+				unset($_SESSION['error']);
+			}
+			echo 'SQL Info:<br/>
+			<table>
+			<tr><td>
+				<label  for="server">Server:</label>
+				</td><td>
+				<input type="text" name="server" id="server" value="'.$_SESSION['server'].'"/><br/>
+				</td></tr><tr><td>
+				<label  for="database">Database:</label>
+				</td><td>
+				<input type="text" name="database" id="database" value="'.$_SESSION['database'].'"/><br/>
+				</td></tr><tr><td>
+				<label  for="username">Username:</label>
+				</td><td>
+				<input type="text" name="username" id="username" value="'.$_SESSION['username'].'"/><br/>
+				</td></tr><tr><td>
+				<label  for="password">Password:</label>
+				</td><td>
+				<input type="password" name="password" id="password"/>
+				</td></tr><tr><td>
+				<label  for="hostname">Hostname (the one OmnomIRC is on):</label>
+				</td><td>
+				<input type="text" name="hostname" id="hostname" value="'.$_SESSION['hostname'].'"/><br/>
+				</td></tr>
+				</table>';
+				echo '<br/><input type="button" value="Back" onclick="window.location=\'install.php?back=1\';"/>';
+				echo '<input type="submit" value="Next"/>';
+		break;
+		case 2://Confirmation
+			if ($_POST['server']=="") $_SESSION['error'] = '<span style="color:#F00">Please enter a server</span><br/>';
+			if ($_POST['database']=="") $_SESSION['error'] = $_SESSION['error'] . '<span style="color:#F00">Please enter a database</span><br/>';
+			if ($_POST['username']=="") $_SESSION['error'] = $_SESSION['error'] . '<span style="color:#F00">Please enter a username</span><br/>';
+			if ($_POST['password']=="") $_SESSION['error'] = $_SESSION['error'] . '<span style="color:#F00">Please enter a password</span><br/>';
+			if ($_POST['hostname']=="") $_SESSION['error'] = $_SESSION['error'] . '<span style="color:#F00">Please enter a hostname</dpan><br/>';
+			$_SESSION['server'] = $_POST['server'];
+			$_SESSION['database'] = $_POST['database'];
+			$_SESSION['username'] = $_POST['username'];
+			$_SESSION['password'] = $_POST['password'];
+			$_SESSION['hostname'] = $_POST['hostname'];
+			if (isset($_SESSION['error']))
+			{
+				$_SESSION['stage'] = 0;
+				echo '<script type="text/javascript">window.location.reload(true);</script>';
+				break;
+			}
+			$sql_connection=mysql_connect($_POST['server'],$_POST['username'],$_POST['password']);
+			if (!$sql_connection)
+				$_SESSION['error'] = $_SESSION['error'] . '<span style="color:#F00">Could not connect to server. Please check your input again.</span><br/>';
+			if (isset($_SESSION['error']))
+			{
+				$_SESSION['stage'] = 0;
+				echo '<script type="text/javascript">window.location.reload(true);</script>';
+			}
+			if (mysql_select_db($_POST['database'],$sql_connection))
+				echo '<span style="font-size;18pt;color:#AA0">WARNING</span><br/><span style="color:#AA0">Database ' . $_POST['database'] . ' already exists! If you continue, all data in it will be lost!<br/>Click back to enter a new database name</span><br/>';
+			echo '<span style="color:#0A0">Your data checks out! Hit next to install.</span>';
+			echo '<br/><input type="button" value="Back" onclick="window.location=\'install.php?back=1\';"/>';
+			echo '<input type="submit" value="Next"/>';
+		break;
+		case 3://Success
+			$randKey = rand(100,9999).'-'.Rand(10000,999999);
+			$randKey = md5($randKey);
+			$randKey = base64_encode($randKey);
+			$randKey = md5($randKey);
+			$config = '<?PHP
+	$sql_server="'.$_SESSION['server'].'";
+	$sql_db="'.$_SESSION['database'].'";
+	$sql_user="'.$_SESSION['username'].'";
+	$sql_password="'.$_SESSION['password'].'";
+	$signature_key="'.$randKey.'";
+?>';
+			
+			if (file_put_contents("config.php",$config))
+				echo "Config written<br/>";
+			else
+				echo "I could not write to the config file. Please check permissions and try again.<br/>";
+			$jsconfig = 'HOSTNAME="'.$_SESSION['hostname'].'";';
+			if (file_put_contents("config.js",$jsconfig))
+				echo "JS Config written<br/>";
+			else
+				echo "Could not write JS config. Please check permissions and try again.<br/>";
+			$sql_connection=mysql_connect($_SESSION['server'],$_SESSION['username'],$_SESSION['password']);
+			if (!mysql_query("DROP DATABASE IF EXISTS " . $_SESSION['database'],$sql_connection))
+				echo "I could not drop the database. Do you have permission?<br/>";
+			if (!mysql_query("CREATE DATABASE " . $_SESSION['database'],$sql_connection))
+				echo "I could not drop the database. Do you have permission?<br/>";
+			if (!mysql_select_db($_SESSION['database'],$sql_connection))
+				echo "I could not select the database. Did it create properly?<br/>";
+			$sql = file("dbinfo.sql");
+			foreach ($sql as $line)
+				if (!mysql_query($line,$sql_connection))
+					echo "I could not import the data. Has anything else failed?<br/>";
+			echo "Finished!<br/>For security purposes, it is highly reccomended that you now delete the install.php file out of the folder when done.";
+		break;
+		default://wat
+			$_SESSION['stage']=-1;
+			echo "Something went wrong. Please try again.";
+		break;
+	}
+?>
+
+</form>
+</body>
+</html>

BIN
omnomirc_www/knobs/.DS_Store


BIN
omnomirc_www/knobs/ICNS/Knob Add.icns


BIN
omnomirc_www/knobs/ICNS/Knob Attention.icns


BIN
omnomirc_www/knobs/ICNS/Knob Blue.icns


BIN
omnomirc_www/knobs/ICNS/Knob Cancel.icns


BIN
omnomirc_www/knobs/ICNS/Knob Download.icns


BIN
omnomirc_www/knobs/ICNS/Knob Fast Forward.icns


BIN
omnomirc_www/knobs/ICNS/Knob Fast Rewind.icns


BIN
omnomirc_www/knobs/ICNS/Knob Favorite.icns


BIN
omnomirc_www/knobs/ICNS/Knob Forward.icns


BIN
omnomirc_www/knobs/ICNS/Knob Graphite.icns


BIN
omnomirc_www/knobs/ICNS/Knob Green.icns


BIN
omnomirc_www/knobs/ICNS/Knob Grey.icns


BIN
omnomirc_www/knobs/ICNS/Knob Help.icns


BIN
omnomirc_www/knobs/ICNS/Knob Info.icns


BIN
omnomirc_www/knobs/ICNS/Knob Left.icns


BIN
omnomirc_www/knobs/ICNS/Knob Loop Off.icns


BIN
omnomirc_www/knobs/ICNS/Knob Loop On.icns


BIN
omnomirc_www/knobs/ICNS/Knob Message.icns


BIN
omnomirc_www/knobs/ICNS/Knob Orange.icns


Some files were not shown because too many files changed in this diff