<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
	<title>Qcodo.com Forums RSS Feed</title>
	<link>http://www.qcodo.com/forums/</link>
	<description>The Qcodo forums attempts to provide a community to post, discuss, ask, and converse about the current state of the framework, as well as provide an opportunity for members to discuss the future direction of Qcodo.</description>
	<pubDate>Sat, 04 Feb 2012 04:07:27 PST</pubDate>
	<generator>Qcodo Development Framework 0.4.22</generator>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<image>
		<url>http://www.qcodo.com/images/qcodo_smaller.png</url>
		<title>Qcodo.com Forums RSS Feed</title>
		<link>http://www.qcodo.com/forums/</link>
		<width>200</width>
		<height>84</height>
	</image>
	<item>
		<title>Re: QPM suggestions</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4457/lastpage</link>
		<description><![CDATA[<p>As Leonardo said, the key about file ubication is organization. In my opinion, if you have only one file you could put it into the folder structure as is (assets/css, assets/js, ...), but if there are some of them it should be convenient to group them under folders specific for your control (assets/css/fileupload, assets/js/fileupload, ...).</p>

<p>About configuration constants, personally I like your solution (static public properties used to initialize the class before instantiating it), as it encapsulates the control configuration into the control class itself, which seems a pretty clean solution to me. But maybe that's a matter of taste, other developer would like more using always global constants as they can be uniformly set/maintained in a centralized initialization script. Your solution, however, allows to initialize the class both from inside (by overriding a property value) and from outside (by setting its value in an initialization script), so it seems very convenient to me.</p>

<p>QPM packages are not included into the framework itself because they are intended to be optional extensions of the framework, as &ldquo;pluggable&rdquo; features. I see some reasons to not include them into the Qcodo distribution.</p>

<p>- Extensiblility.<br/>
Extensiblility is virtually infinite, more and more classes/features can be added in the future. I'm pretty sure that the framework file/folder organization and configurability would suffer if we all include our personal development/maintenance tastes into the framework distribution.</p>

<p>- Optionality.<br/>
The current implementation gives the option of including a specific package or not. Think about someone not needing your control in his application, with the current QPM implementation he has the option of not including it at all.</p>

<p>- Variety.<br/>
Maybe two controls have the same features, so there's no need to include both in the distribution. You can opt for some control made by one developer, but not for the same control made by another.</p>

<p>- Versions.<br/>
There can be a specific control that has different versions for (let's imagine) PHP 5.2 and PHP 5.3, or different versions for Windows and Linux servers, or simply different versions with different features/uses. That versions can be opted as packages when needed, instead of merging them into the framework and forcing the developer to unnecessarily deploy all them.</p>

<p>All in all, QPM packages are like software plugins. If you need or like one, you use and deploy it. But if you don't need or like another, you are not forced to use and deploy it.</p>

<p>Eventually, if one plugin turns to be necessary or a really &ldquo;must have&rdquo; feature, it can be included into the core distribution. But that's not the primary idea of plugins.</p>

]]></description>
		<author>Fernando Lordán</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4457/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4457/lastpage</guid>
		<pubDate>Thu, 02 Feb 2012 14:46:22 PST</pubDate>
	</item>
	<item>
		<title>Re: QPM suggestions</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4457/lastpage</link>
		<description><![CDATA[<p>I'm not the best person to answer you. About the organization of QPM, always put the files outside of the nucleus and orgnização make this as clean as possible.</p>

<p>And of course following the Qcodo Coding Standards<br/>
http://www.qcodo.com/wiki/qcodo/development/contribute</p>

]]></description>
		<author>Leonardo</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4457/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4457/lastpage</guid>
		<pubDate>Thu, 02 Feb 2012 03:57:31 PST</pubDate>
	</item>
	<item>
		<title>Re: Positionable qdialog box</title>
		<link>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</link>
		<description><![CDATA[<p>Cheers Mike <br/>
I'd forgoten about the whole strJavaScriptArray thing. I'd commented out the line window.onscroll = this.handleResize; in control_dialog,js and now having set the form to use the _core js files it is now working as I intended.<br/>
Mike</p>

]]></description>
		<author>Mike Cobb</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/2812/lastpage</guid>
		<pubDate>Thu, 02 Feb 2012 02:46:31 PST</pubDate>
	</item>
	<item>
		<title>Re: New DataSource in DataGrid</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4460/lastpage</link>
		<description><![CDATA[<p>Never Mind. I did what I needed too I just used 2 separate DataGrid Objects and changed the template file So they were displayed on the same HTML table. Still if there is a way to specify a new DataSource for a new column I would like to know.</p>

]]></description>
		<author>Krammitman</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4460/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4460/lastpage</guid>
		<pubDate>Wed, 01 Feb 2012 22:56:14 PST</pubDate>
	</item>
	<item>
		<title>Re: New DataSource in DataGrid</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4460/lastpage</link>
		<description><![CDATA[<p>I'm a total noob to Qcodo, I'm just looking for a simple solution to an easy problem. I have 2 separate arrays I would like to add to 2 separate columns in my DataGrid. Is there a way to change the DataSource of the grid after creating a column and then using the new data source to print a second column?</p>

<p>I don't have a problem creating a column using the first array but when I try to change the DataSource to the second array it just overwrites everything in the first column.</p>

<p>I've tried doing it as a 2 Dim array but can't get it to call a specific array inside my 2D array, instead it only uses the information from both arrays from the specified index.(I.E Array ( [0] =&gt; Array ( [0] =&gt; stuff [1] =&gt; Other [2] =&gt; last ) [0] =&gt; Array ( [0] =&gt; 2 [1] =&gt; 1 [2] =&gt; 1 ) ) When I specify Index 0 i presumed it would give me the array from index 0 and print the three indexes from that array, instead it gives me Stuff, and 2 the index 0 for both arrays inside the parent array. moreover it only creates a column with 2 rows despite me having multiple indices I presume that has to do with my DataSource only having to $_ITEM's inside it.</p>

<p>I apologize for the uber noob question but could really use some help.</p>

]]></description>
		<author>Krammitman</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4460/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4460/lastpage</guid>
		<pubDate>Wed, 01 Feb 2012 17:04:45 PST</pubDate>
	</item>
	<item>
		<title>Re: QPM suggestions</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4457/lastpage</link>
		<description><![CDATA[<p>Anyone?</p>

]]></description>
		<author>Ago Luberg</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4457/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4457/lastpage</guid>
		<pubDate>Wed, 01 Feb 2012 14:08:17 PST</pubDate>
	</item>
	<item>
		<title>Re: Positionable qdialog box</title>
		<link>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</link>
		<description><![CDATA[<p>Depends on how you have your JS includes set up...</p>

<p>If you're using the optimized/packed JS file by explicitly including it on the page and overriding the includes in QForm's protected $strIgnoreJavaScriptFileArray, then your site will use the packed file and (yes) editing control_dialog.js will have no effect whatsoever.</p>

<p>So if you're wanting to make manual edits to any of the JS files, it's best that you remove any &lt;script&gt; type of reference to the _qc_packed.js file, and ensure that QForm is NOT ignoring the include of any core/framework JS files.</p>

]]></description>
		<author>Mike Ho</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/2812/lastpage</guid>
		<pubDate>Tue, 31 Jan 2012 20:37:02 PST</pubDate>
	</item>
	<item>
		<title>Re: Positionable qdialog box</title>
		<link>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</link>
		<description><![CDATA[<p>I've found that you can delete the control_dialog.js file and QDialogBox still works OK so I don't think that's where you need to look to control the positioning.</p>

]]></description>
		<author>Mike Cobb</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/2812/lastpage</guid>
		<pubDate>Tue, 31 Jan 2012 14:55:49 PST</pubDate>
	</item>
	<item>
		<title>Re: Virtual Foreign Key via codegen_settings.xml</title>
		<link>http://www.qcodo.com/forums/forum.php/2/2734/lastpage</link>
		<description><![CDATA[<p>Unfortunately, not if the tables are in two different databases.</p>

<p>The current implementation of codegen only allows you to define the relationships within a database... but of course, you could likely poke around in the code and make mods to it so that it can recognize and start to gen across different databases.</p>

]]></description>
		<author>Mike Ho</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/2734/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/2734/lastpage</guid>
		<pubDate>Tue, 31 Jan 2012 08:08:59 PST</pubDate>
	</item>
	<item>
		<title>Re: Virtual Foreign Key via codegen_settings.xml</title>
		<link>http://www.qcodo.com/forums/forum.php/2/2734/lastpage</link>
		<description><![CDATA[<p>I just tried using virtual foreign keys for the first time today (trying to split up tables between two database instead of one) and I am wondering if there is a trick to getting the virtual keys to generate linking objects like they do when you define foreign keys between tables in a single database?</p>

<p>In other words, if I have table 'form' that has a foreign key to 'user' table (both in the same database with foreign keys defined in the database), I can access the user object from a form object ($objForm-&gt;User); so I get a User object generated within the Form data class for me. &nbsp;However if I split the two tables between databases and use virtual foreign keys within the codegen_settings.xml file all I get is a UserId property generated in the Form data class and not a reference to the User node.</p>

<p>Can the codegen generate the User objects/nodes in my Form data class using virtual foreign keys or is that not coded into the functionality?</p>

<p>many thanks</p>

]]></description>
		<author>w. Patrick Gale</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/2734/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/2734/lastpage</guid>
		<pubDate>Mon, 30 Jan 2012 16:20:03 PST</pubDate>
	</item>
	<item>
		<title>Re: Create advanced (combined) search</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</link>
		<description><![CDATA[<p>NEver mind Mike.</p>

<p>Stupid me :-)</p>

]]></description>
		<author>dorito</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4459/lastpage</guid>
		<pubDate>Mon, 30 Jan 2012 15:38:53 PST</pubDate>
	</item>
	<item>
		<title>Re: Create advanced (combined) search</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</link>
		<description><![CDATA[<p>Hi MIke,</p>

<p>Sure helps. But what if the user has entered both field 1 and 2? Or 2 and 3? Or 1 and 3...</p>

<p>You get the point.</p>

<p>The current solution only supports one filter.</p>

<p>Best regards<br/>
Geert</p>

]]></description>
		<author>dorito</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4459/lastpage</guid>
		<pubDate>Mon, 30 Jan 2012 15:35:43 PST</pubDate>
	</item>
	<item>
		<title>Re: Create advanced (combined) search</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</link>
		<description><![CDATA[<p>Use QQ::And() instead of pushing the conditions on top of each other.</p>

<p>So something like:</p>

<pre ><code><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;$objCondition&nbsp;=&nbsp;QQ::All();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($txtFilter1-&gt;Text)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$objCondition&nbsp;=&nbsp;QQ::AndCondition($objCondition,&nbsp;QQ::Equal(QQN::Foo()-&gt;Bar,&nbsp;$txtFilter1-&gt;Text);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($txtFilter2-&gt;Text)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$objCondition&nbsp;=&nbsp;QQ::AndCondition($objCondition,&nbsp;QQ::Equal(QQN::Foo()-&gt;Bar,&nbsp;$txtFilter2-&gt;Text);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($txtFilter3-&gt;Text)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$objCondition&nbsp;=&nbsp;QQ::AndCondition($objCondition,&nbsp;QQ::Equal(QQN::Foo()-&gt;Bar,&nbsp;$txtFilter3-&gt;Text);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Etc.</span></code></pre>

<p>hope that helps...</p>

]]></description>
		<author>Mike Ho</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4459/lastpage</guid>
		<pubDate>Mon, 30 Jan 2012 06:59:17 PST</pubDate>
	</item>
	<item>
		<title>Re: Positionable qdialog box</title>
		<link>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</link>
		<description><![CDATA[<p>Has anyone managed to create a dialog box with a custom positon?</p>

<p>I need one that doesn't reposition itself to the middle but scolls up with the rest of the page. I've worked on _core/control_dialog.js but I can't seem to override/change the default behaviour. Many thanks in advance.<br/>
Mike</p>

]]></description>
		<author>Mike Cobb</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/2812/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/2812/lastpage</guid>
		<pubDate>Mon, 30 Jan 2012 04:42:25 PST</pubDate>
	</item>
	<item>
		<title>Re: Create advanced (combined) search</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</link>
		<description><![CDATA[<p>Hello Guys,</p>

<p>I'm trying to create an advanced search function for my users. The idea is simple, the can combine 2 listboxes an 2 textboxes (with dates) to filter a list of reports.</p>

<br/>
<p>This is how it goes:</p>

<p>&ldquo;I'd like to see all reports from &lt;&lt;lstUsers&gt;&gt; for the &lt;&lt;lstPatients&gt;&gt; that were entered between &lt;&lt;dttStartDate&gt;&gt; and &lt;&lt;enddate&gt;&gt;&rdquo;</p>

<p>Creating the above is no problem. However how do I create the logic behind it.</p>

<p>this is my first try:<br/>
 bc.<br/>
 &lt;?php<br/>
 &nbsp; &nbsp;$QQfilterClause = array();<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if($this-&gt;lstFilterPatients-&gt;SelectedValue !== null){<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;array_push($QQfilterClause,QQ::Equal(QQN::Vpc()-&gt;PatientID,$this-&gt;lstFilterPatients-&gt;SelectedValue));<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if($this-&gt;lstFilterUsers-&gt;SelectedValue !== null){<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;array_push($QQfilterClause,QQ::Equal(QQN::Vpc()-&gt;CreatedBy,$this-&gt;lstFilterUsers-&gt;SelectedValue));<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/*<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * Start and endtime<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $arrDateParts = explode('.',$this-&gt;dttFilterStartTime-&gt;Text);<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dttFilterStartDate = new QDateTime(QDateTime::Now);<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dttFilterStartDate-&gt;setDate($arrDateParts[2], $arrDateParts[1], $arrDateParts[0]);</p>

<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $arrDateParts = explode('.',$this-&gt;dttFilterEndTime-&gt;Text);<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dttFilterEndDate = new QDateTime(QDateTime::Now);<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $dttFilterEndDate-&gt;setDate($arrDateParts[2], $arrDateParts[1], $arrDateParts[0]);<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array_push($QQfilterClause,QQ::GreaterOrEqual(QQN::Vpc()-&gt;VpcDate, $dttFilterStartDate));<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array_push($QQfilterClause,QQ::LessOrEqual(QQN::Vpc()-&gt;VpcDate, $dttFilterEndDate));</p>

<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $arrVpcs = Vpc::QueryArray($QQfilterClause);<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;dtgVpcs-&gt;DataSource =$arrVpcs;<br/>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;dtgVpcs-&gt;Refresh();<br/>
?&gt;<br/>
.bc</p>

<p>The QueryArry doesn't accept the array with the conditions. </p>

<p>Any help is most appreciated</p>

]]></description>
		<author>dorito</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4459/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4459/lastpage</guid>
		<pubDate>Mon, 30 Jan 2012 03:51:31 PST</pubDate>
	</item>
	<item>
		<title>Re: community</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4445/lastpage</link>
		<description><![CDATA[<p>Personally I don't see a true need of adding something like social-network capabilities to a development community web.</p>

<p>But if you really think that &ldquo;<em>it's time for an upgrade again</em>&rdquo;, the code of the Qcodo web is free. You can alter and modify it as much as you want, and then push your modifications to its main branch using GitHub.</p>

]]></description>
		<author>Fernando Lordán</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4445/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4445/lastpage</guid>
		<pubDate>Sat, 28 Jan 2012 14:14:43 PST</pubDate>
	</item>
	<item>
		<title>Re: My (2 week) Review of QCodo's MVC Approach</title>
		<link>http://www.qcodo.com/forums/forum.php/2/1010/lastpage</link>
		<description><![CDATA[<p>Sorry, Mike and Marcos, I totally lost track of this five-year-old thread.</p>

<p>I haven't had the need of modifying my event handler at the time or writing. Although I think that at this point some other JS frameworks may have better solutions, but I suspect that all them have solutions centered either in DOM2 events or in DOM1 events, never in both.</p>

<p>Basically:<br/>
- It allows to assign and manage crossbrowser listeners. It adds and removes DOM2 events to HtML objects, as almost any JS framework does.<br/>
- It triggers DOM1 and DOM2 events assigned to HTML objects, in this order. So when you trigger an event, the inline assigned events (that is, events in HTML attributes, as QCodo events for instance) are triggered first, and then the DOM2 events assigned with this same class.<br/>
- It works with arrays of HTML objects and/or with arrays of events, for convenience. A simple internal wrapper function is used for this purpose.<br/>
- It has an autocleanup routine to desassign DOM2 events on page unload. Particularly convenient in browsers that experience memory leaks by keeping in memory objects that have DOM2 events assigned.</p>

<p>Here's the code. Use it if you find it useful:</p>

<pre ><code><span style="color: #000000"><br />/**<br />&nbsp;*&nbsp;JavaScript&nbsp;class&nbsp;to&nbsp;add,&nbsp;remove&nbsp;and&nbsp;trigger&nbsp;event&nbsp;handlers&nbsp;for&nbsp;events&nbsp;of&nbsp;controls.<br />&nbsp;*&nbsp;-&nbsp;Makes&nbsp;crossbrowser&nbsp;listeners.<br />&nbsp;*&nbsp;-&nbsp;The&nbsp;event&nbsp;object&nbsp;is&nbsp;always&nbsp;passed&nbsp;as&nbsp;parameter&nbsp;to&nbsp;the&nbsp;event&nbsp;handler&nbsp;function,<br />&nbsp;*&nbsp;&nbsp;&nbsp;and&nbsp;inside&nbsp;the&nbsp;function&nbsp;the&nbsp;'this'&nbsp;keyword&nbsp;refers&nbsp;to&nbsp;the&nbsp;control&nbsp;that&nbsp;generated&nbsp;the&nbsp;event.<br />&nbsp;*&nbsp;-&nbsp;Admits&nbsp;setting/removing/triggering&nbsp;event&nbsp;handlers&nbsp;for&nbsp;a&nbsp;single&nbsp;control&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;controls,<br />&nbsp;*&nbsp;&nbsp;&nbsp;for&nbsp;a&nbsp;single&nbsp;event&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;events.<br />&nbsp;*&nbsp;-&nbsp;Admits&nbsp;both&nbsp;"click"&nbsp;and&nbsp;"onclick"&nbsp;syntax&nbsp;for&nbsp;events.<br />&nbsp;*&nbsp;-&nbsp;Automatic&nbsp;cleanout&nbsp;of&nbsp;assigned&nbsp;event&nbsp;handlers&nbsp;on&nbsp;page&nbsp;unload.<br />&nbsp;*&nbsp;-&nbsp;Triggers&nbsp;both&nbsp;event&nbsp;handlers&nbsp;set&nbsp;with&nbsp;this&nbsp;class&nbsp;(DOM2)&nbsp;and&nbsp;as&nbsp;inline&nbsp;HTML&nbsp;attributes&nbsp;(DOM1).<br />&nbsp;*&nbsp;Limitations:<br />&nbsp;*&nbsp;-&nbsp;Handlers&nbsp;must&nbsp;be&nbsp;named&nbsp;functions.<br />&nbsp;*&nbsp;Thanks&nbsp;to:<br />&nbsp;*&nbsp;-&nbsp;John&nbsp;Resig,&nbsp;for&nbsp;the&nbsp;original&nbsp;addEvent/removeEvent&nbsp;solution<br />&nbsp;*&nbsp;&nbsp;&nbsp;(&nbsp;http://ejohn.org/projects/flexible-javascript-events/&nbsp;)<br />&nbsp;*&nbsp;-&nbsp;Kupu&nbsp;developers,&nbsp;for&nbsp;the&nbsp;ContextFixer&nbsp;object&nbsp;solution<br />&nbsp;*&nbsp;&nbsp;&nbsp;(&nbsp;http://kupu.oscom.org/&nbsp;)<br />&nbsp;*&nbsp;Version&nbsp;1.0&nbsp;Copyright&nbsp;(C)&nbsp;Fernando&nbsp;Lordán,&nbsp;October&nbsp;2006.<br />&nbsp;*&nbsp;Distributed&nbsp;under&nbsp;the&nbsp;BSD&nbsp;License.<br />&nbsp;*/<br />if&nbsp;(typeof(eventManager)&nbsp;==&nbsp;'undefined')&nbsp;{<br /><br /><br />function&nbsp;eventManagerContextFixer(func,&nbsp;context)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;Make&nbsp;sure&nbsp;'this'&nbsp;inside&nbsp;a&nbsp;method&nbsp;points&nbsp;to&nbsp;its&nbsp;class&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;this.func&nbsp;=&nbsp;func;<br />&nbsp;&nbsp;&nbsp;&nbsp;this.context&nbsp;=&nbsp;context;<br />&nbsp;&nbsp;&nbsp;&nbsp;this.args&nbsp;=&nbsp;arguments;<br />&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;self&nbsp;=&nbsp;this;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.execute&nbsp;=&nbsp;function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;execute&nbsp;the&nbsp;method&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;args&nbsp;=&nbsp;new&nbsp;Array();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;the&nbsp;first&nbsp;arguments&nbsp;will&nbsp;be&nbsp;the&nbsp;extra&nbsp;ones&nbsp;of&nbsp;the&nbsp;class<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i=0;&nbsp;i&nbsp;&lt;&nbsp;self.args.length&nbsp;-&nbsp;2;&nbsp;i++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;args.push(self.args[i&nbsp;+&nbsp;2]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;the&nbsp;last&nbsp;are&nbsp;the&nbsp;ones&nbsp;passed&nbsp;on&nbsp;to&nbsp;the&nbsp;execute&nbsp;method<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i=0;&nbsp;i&nbsp;&lt;&nbsp;arguments.length;&nbsp;i++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;args.push(arguments[i]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.func.apply(self.context,&nbsp;args);<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br />};<br /><br /><br />var&nbsp;eventManager&nbsp;=&nbsp;{&nbsp;initialize:&nbsp;function()&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.actionAdd&nbsp;=&nbsp;1;<br />&nbsp;&nbsp;&nbsp;&nbsp;this.actionRemove&nbsp;=&nbsp;2;<br />&nbsp;&nbsp;&nbsp;&nbsp;this.actionTrigger&nbsp;=&nbsp;3;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.add&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;fnHandler)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._wrapCall(sNode,&nbsp;sEventType,&nbsp;fnHandler,&nbsp;eventManager.actionAdd);<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.remove&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;fnHandler)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._wrapCall(sNode,&nbsp;sEventType,&nbsp;fnHandler,&nbsp;eventManager.actionRemove);<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.trigger&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;objWindow)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._wrapCall(sNode,&nbsp;sEventType,&nbsp;objWindow,&nbsp;eventManager.actionTrigger);<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this._wrapCall&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;objParam,&nbsp;iAction)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(typeof(sNode)&nbsp;==&nbsp;'object')&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Works&nbsp;with&nbsp;events&nbsp;of&nbsp;an&nbsp;array&nbsp;of&nbsp;controls.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i=0;i&lt;sNode.length;i++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._wrapCall(sNode[i],&nbsp;sEventType,&nbsp;objParam,&nbsp;iAction);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;if&nbsp;(typeof(sNode)&nbsp;==&nbsp;'string')&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(typeof(sEventType)&nbsp;==&nbsp;'object')&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Works&nbsp;with&nbsp;an&nbsp;array&nbsp;of&nbsp;events&nbsp;of&nbsp;one&nbsp;control.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i=0;i&lt;sEventType.length;i++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._wrapCall(sNode,&nbsp;sEventType[i],&nbsp;objParam,&nbsp;iAction);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;if&nbsp;(typeof(sEventType)&nbsp;==&nbsp;'string')&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Standarizes&nbsp;the&nbsp;event&nbsp;name.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sEventType&nbsp;=&nbsp;sEventType.toLowerCase();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(sEventType.substr(0,2)=='on')&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sEventType&nbsp;=&nbsp;sEventType.substr(2,sEventType.length-2);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Calls&nbsp;the&nbsp;convenient&nbsp;action.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch&nbsp;(iAction)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;eventManager.actionAdd:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._add(sNode,sEventType,objParam);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;eventManager.actionRemove:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._remove(sNode,sEventType,objParam);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;eventManager.actionTrigger:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._trigger(sNode,sEventType,objParam);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;"Invalid&nbsp;event&nbsp;action";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this._getNode&nbsp;=&nbsp;function(sNode,&nbsp;objWindow)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(sNode)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(sNode.substr(0,1)&nbsp;==&nbsp;"/")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;If&nbsp;node&nbsp;starts&nbsp;with&nbsp;"/",&nbsp;works&nbsp;with&nbsp;the&nbsp;specified&nbsp;literal&nbsp;instead&nbsp;of&nbsp;a&nbsp;control.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;oNode&nbsp;=&nbsp;eval(sNode.substr(1));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(typeof(objWindow)=="undefined")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objWindow&nbsp;=&nbsp;window;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;oNode&nbsp;=&nbsp;objWindow.document.getElementById(sNode);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!oNode)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;"Invalid&nbsp;control&nbsp;specified:&nbsp;'"+sNode+"'";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;oNode;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this._add&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;fnHandler)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Gets&nbsp;the&nbsp;node&nbsp;where&nbsp;event&nbsp;will&nbsp;be&nbsp;added.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;oNode&nbsp;=&nbsp;eventManager._getNode(sNode);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!oNode)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;There's&nbsp;a&nbsp;chance&nbsp;that&nbsp;we&nbsp;assign&nbsp;more&nbsp;than&nbsp;once&nbsp;the&nbsp;same&nbsp;handler&nbsp;function&nbsp;for&nbsp;the&nbsp;same&nbsp;event&nbsp;for&nbsp;the&nbsp;same&nbsp;control,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;and&nbsp;it&nbsp;can&nbsp;be&nbsp;convenient&nbsp;because&nbsp;when&nbsp;a&nbsp;control&nbsp;is&nbsp;redrawn&nbsp;via&nbsp;.innerHTML&nbsp;it&nbsp;looses&nbsp;its&nbsp;event&nbsp;handlers.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;IE&nbsp;doesn't&nbsp;keep&nbsp;track&nbsp;of&nbsp;repeatedly&nbsp;added&nbsp;event&nbsp;handlers,&nbsp;it&nbsp;simply&nbsp;adds&nbsp;them&nbsp;again,&nbsp;so&nbsp;we&nbsp;could&nbsp;fall&nbsp;into&nbsp;memory&nbsp;leaking&nbsp;and&nbsp;performance&nbsp;issues.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType][fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(oExc)&nbsp;{};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode.attachEvent)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Add&nbsp;event&nbsp;handler&nbsp;in&nbsp;IE,&nbsp;making&nbsp;possible&nbsp;to&nbsp;access&nbsp;the&nbsp;control&nbsp;object&nbsp;as&nbsp;'this'.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode['e'+sEventType+fnHandler]&nbsp;=&nbsp;eval(fnHandler);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode[sEventType+fnHandler]&nbsp;=&nbsp;function()&nbsp;{&nbsp;oNode[eval("'e'+sEventType+fnHandler")](window.event);&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode.attachEvent('on'+sEventType,&nbsp;oNode[sEventType+fnHandler]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Add&nbsp;event&nbsp;handler&nbsp;in&nbsp;Mozilla.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode.addEventListener(sEventType,&nbsp;eval(fnHandler),&nbsp;false);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Store&nbsp;event&nbsp;handler&nbsp;to&nbsp;remove&nbsp;on&nbsp;unload.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!oNode._nodeListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._nodeListeners&nbsp;=&nbsp;new&nbsp;Object();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!oNode._nodeListeners[sEventType])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._nodeListeners[sEventType]&nbsp;=&nbsp;new&nbsp;Object();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!oNode._nodeListeners[sEventType][fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._nodeListeners[sEventType][fnHandler]&nbsp;=&nbsp;true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!document._docListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document._docListeners&nbsp;=&nbsp;new&nbsp;Object();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!document._docListeners[sNode])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document._docListeners[sNode]&nbsp;=&nbsp;oNode;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Store&nbsp;handler&nbsp;reference&nbsp;to&nbsp;remove&nbsp;all&nbsp;event&nbsp;handlers&nbsp;on&nbsp;unload.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!document._docListeners._cleanout)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode.attachEvent)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.attachEvent('onunload',&nbsp;eventManager.cleanOut);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.addEventListener('unload',&nbsp;eventManager.cleanOut,&nbsp;false);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document._docListeners._cleanout&nbsp;=&nbsp;true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this._remove&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;fnHandler)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Gets&nbsp;the&nbsp;node&nbsp;where&nbsp;event&nbsp;will&nbsp;be&nbsp;removed.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!(oNode&nbsp;=&nbsp;eventManager._getNode(sNode)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode.attachEvent)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Removes&nbsp;event&nbsp;handler&nbsp;in&nbsp;IE.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode.detachEvent('on'+sEventType,&nbsp;oNode[sEventType+fnHandler]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode[sEventType+fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode[sEventType+fnHandler]&nbsp;=&nbsp;null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode['e'+sEventType+fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode['e'+sEventType+fnHandler]&nbsp;=&nbsp;null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Removes&nbsp;event&nbsp;handler&nbsp;in&nbsp;Mozilla.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode.removeEventListener(sEventType,&nbsp;eval(fnHandler),&nbsp;false);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Deletes&nbsp;the&nbsp;event&nbsp;handler&nbsp;from&nbsp;the&nbsp;list&nbsp;of&nbsp;event&nbsp;handlers&nbsp;to&nbsp;remove&nbsp;on&nbsp;unload.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType][fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._nodeListeners[sEventType][fnHandler]&nbsp;=&nbsp;false;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this._trigger&nbsp;=&nbsp;function(sNode,&nbsp;sEventType,&nbsp;objWindow)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Will&nbsp;trigger&nbsp;events&nbsp;in&nbsp;current&nbsp;window&nbsp;if&nbsp;window&nbsp;not&nbsp;specified.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(typeof(objWindow)=="undefined")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objWindow&nbsp;=&nbsp;window;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;If&nbsp;window&nbsp;has&nbsp;been&nbsp;closed,&nbsp;returns.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!objWindow&nbsp;||&nbsp;!objWindow.document)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Gets&nbsp;the&nbsp;node&nbsp;where&nbsp;event&nbsp;will&nbsp;be&nbsp;triggered.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!(oNode&nbsp;=&nbsp;eventManager._getNode(sNode,objWindow)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Constructs&nbsp;the&nbsp;event&nbsp;object&nbsp;to&nbsp;pass&nbsp;as&nbsp;parameter.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objFakeEvent&nbsp;=&nbsp;new&nbsp;Object();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objFakeEvent.type&nbsp;=&nbsp;sEventType;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(window.attachEvent)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;In&nbsp;IE,&nbsp;the&nbsp;"event.srcElement"&nbsp;property&nbsp;holds&nbsp;the&nbsp;control&nbsp;that&nbsp;issued&nbsp;the&nbsp;event.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objFakeEvent.srcElement&nbsp;=&nbsp;oNode;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Else,&nbsp;the&nbsp;control&nbsp;that&nbsp;issued&nbsp;the&nbsp;event&nbsp;is&nbsp;in&nbsp;the&nbsp;"event.target"&nbsp;property.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objFakeEvent.target&nbsp;=&nbsp;oNode;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Calls&nbsp;the&nbsp;DOM1&nbsp;event&nbsp;handler&nbsp;set&nbsp;as&nbsp;a&nbsp;control&nbsp;property&nbsp;or&nbsp;as&nbsp;inline&nbsp;HTML&nbsp;attribute&nbsp;of&nbsp;the&nbsp;control,&nbsp;if&nbsp;any.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(((oNode.type&nbsp;==&nbsp;"checkbox")&nbsp;||&nbsp;(oNode.type&nbsp;==&nbsp;"radio"))&nbsp;&amp;&amp;&nbsp;!!oNode[0])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;i=0;&nbsp;i&nbsp;&lt;&nbsp;oNode.length;&nbsp;i++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fnHandler&nbsp;=&nbsp;eval("oNode[i].on"&nbsp;+&nbsp;sEventType);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(fnHandler)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;This&nbsp;is&nbsp;explained&nbsp;below.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(typeof(fnHandler)&nbsp;==&nbsp;"object")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objHandler=fnHandler;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fnHandler=function(event){eval(objHandler+";event=objFakeEvent;anonymous();")};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy&nbsp;=&nbsp;new&nbsp;eventManagerContextFixer(fnHandler,&nbsp;oNode).execute(objFakeEvent);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;if&nbsp;(typeof(fnHandler)&nbsp;==&nbsp;"function")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy&nbsp;=&nbsp;new&nbsp;eventManagerContextFixer(fnHandler,&nbsp;oNode).execute(objFakeEvent);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fnHandler&nbsp;=&nbsp;eval("oNode.on"&nbsp;+&nbsp;sEventType);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(fnHandler)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(typeof(fnHandler)&nbsp;==&nbsp;"object")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;In&nbsp;IE,&nbsp;the&nbsp;handler&nbsp;is&nbsp;not&nbsp;stored&nbsp;as&nbsp;a&nbsp;function&nbsp;reference,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;but&nbsp;as&nbsp;an&nbsp;object&nbsp;that&nbsp;contains&nbsp;a&nbsp;function&nbsp;called&nbsp;"anonymous()",&nbsp;literally.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Makes&nbsp;a&nbsp;wrapper&nbsp;function&nbsp;to&nbsp;call&nbsp;the&nbsp;anonymous&nbsp;function&nbsp;object&nbsp;and&nbsp;use&nbsp;the&nbsp;"event"&nbsp;variable&nbsp;inside&nbsp;it.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Compatibility&nbsp;warning:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;Inside&nbsp;the&nbsp;inline&nbsp;handler,&nbsp;the&nbsp;"event"&nbsp;variable&nbsp;will&nbsp;work,&nbsp;but&nbsp;"window.event"&nbsp;will&nbsp;not.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Compatibility&nbsp;note:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;In&nbsp;IE,&nbsp;inside&nbsp;an&nbsp;inline&nbsp;handler,&nbsp;the&nbsp;"this"&nbsp;keyword&nbsp;will&nbsp;refer&nbsp;to&nbsp;the&nbsp;calling&nbsp;window,&nbsp;not&nbsp;to&nbsp;a&nbsp;control.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;This&nbsp;is&nbsp;the&nbsp;standard&nbsp;IE&nbsp;behaviour&nbsp;for&nbsp;inline&nbsp;event&nbsp;handlers.&nbsp;In&nbsp;IE&nbsp;just&nbsp;don't&nbsp;use&nbsp;"this",&nbsp;use&nbsp;"event.srcElement".<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objHandler=fnHandler;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fnHandler=function(event){eval(objHandler+";event=objFakeEvent;anonymous();")};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;At&nbsp;this&nbsp;moment,&nbsp;calling&nbsp;the&nbsp;wrapper&nbsp;function&nbsp;directly&nbsp;or&nbsp;calling&nbsp;it&nbsp;through&nbsp;the&nbsp;context&nbsp;wrapper&nbsp;have&nbsp;the&nbsp;same&nbsp;effect,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;so&nbsp;both&nbsp;options&nbsp;are&nbsp;equivalent.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fnHandler();<br />//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy&nbsp;=&nbsp;new&nbsp;eventManagerContextFixer(fnHandler,&nbsp;oNode).execute(objFakeEvent);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;if&nbsp;(typeof(fnHandler)&nbsp;==&nbsp;"function")&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy&nbsp;=&nbsp;new&nbsp;eventManagerContextFixer(fnHandler,&nbsp;oNode).execute(objFakeEvent);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Calls&nbsp;all&nbsp;the&nbsp;DOM2&nbsp;event&nbsp;handlers&nbsp;added&nbsp;for&nbsp;the&nbsp;event&nbsp;of&nbsp;the&nbsp;control.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;fnHandler&nbsp;in&nbsp;oNode._nodeListeners[sEventType])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType][fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(window.attachEvent)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;In&nbsp;IE,&nbsp;attach&nbsp;the&nbsp;event&nbsp;handler&nbsp;to&nbsp;the&nbsp;target&nbsp;control&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;use&nbsp;the&nbsp;"this"&nbsp;keyword.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._tmpHandler&nbsp;=&nbsp;eval("objWindow."+fnHandler);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._tmpHandler(objFakeEvent);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oNode._tmpHandler&nbsp;=&nbsp;null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Else,&nbsp;just&nbsp;use&nbsp;the&nbsp;context&nbsp;wrapper.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy&nbsp;=&nbsp;new&nbsp;eventManagerContextFixer(eval("objWindow."+fnHandler),&nbsp;oNode).execute(objFakeEvent);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.removeAll&nbsp;=&nbsp;function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Removes&nbsp;all&nbsp;event&nbsp;listeners.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(document._docListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;sNode&nbsp;in&nbsp;document._docListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;oNode&nbsp;=&nbsp;document._docListeners[sNode];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;sEventType&nbsp;in&nbsp;oNode._nodeListeners)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;fnHandler&nbsp;in&nbsp;oNode._nodeListeners[sEventType])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(oNode._nodeListeners[sEventType][fnHandler])&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager._remove(sNode,&nbsp;sEventType,&nbsp;fnHandler);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;this.cleanOut&nbsp;=&nbsp;function()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Removes&nbsp;all&nbsp;stored&nbsp;event&nbsp;handlers.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventManager.removeAll();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document._docListeners&nbsp;=&nbsp;null;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Removes&nbsp;the&nbsp;event&nbsp;handler&nbsp;that&nbsp;removes&nbsp;all&nbsp;event&nbsp;handlers.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(window.attachEvent)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.detachEvent('onunload',&nbsp;eventManager.cleanOut);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;window.removeEventListener('unload',&nbsp;eventManager.cleanOut,&nbsp;false);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br />&nbsp;&nbsp;&nbsp;&nbsp;};<br /><br />}};<br /><br />em&nbsp;=&nbsp;eventManager;<br />em.initialize();<br /><br />/*<br />addEvent=em.add;<br />removeEvent=em.remove;<br />triggerEvent=em.trigger;<br />*/<br /><br />};<br /></span></code></pre>

<p>Please, read the comments into the code. They probably respond to some questions.</p>

<p>Also take into account that this code hasn't been reviewed for more than five years. Not only it has not been particularly tested against IE8+ and Chrome, but also I was not the coder I am now. Anyway I tend to do defensive programming, so I'm pretty sure it still performs well in any browser.</p>

]]></description>
		<author>Fernando Lordán</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/1010/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/1010/lastpage</guid>
		<pubDate>Sat, 28 Jan 2012 13:36:53 PST</pubDate>
	</item>
	<item>
		<title>Re: Which framework to use?</title>
		<link>http://www.qcodo.com/forums/forum.php/2/4453/lastpage</link>
		<description><![CDATA[<p>it depends on what you are trying to do or build.</p>

]]></description>
		<author>Steve Stella</author>
		<category>General Discussion</category>
		<comments>http://www.qcodo.com/forums/forum.php/2/4453/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/2/4453/lastpage</guid>
		<pubDate>Wed, 25 Jan 2012 16:00:45 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>Are you guys still using CentOS? &nbsp;I typically use YUM to install most of the binaries from RPM, and the only thing I custom compile is PHP...</p>

<p>If you guys are still with MediaTemple, I've got a pretty decent build script for their (ve) line of virtual servers. &nbsp;I've got a number of clients using it...</p>

]]></description>
		<author>Mike Ho</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Wed, 11 Jan 2012 20:48:44 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>The problem was a mysqli<br/>
headers and client library versions were mismatched.<br/>
We found out the problem by viewing the phpinfo.<br/>
The fix was to remove mysql totally and re-installing it.<br/>
</p>

]]></description>
		<author>nick leung</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Wed, 11 Jan 2012 16:15:45 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>We're using php 5.2.5. &nbsp;But upgrading to Qcodo 0.4.x and php 5.3.x is on the roadmap.</p>

]]></description>
		<author>ryanmac</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Tue, 10 Jan 2012 20:43:03 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>Not sure... can you figure out which line actually throws the seg fault?</p>

<p>You may need to start putting echo() statements throughout your gen code to find out.</p>

<p>Also, it sounds like you're still on the v0.3.x version of qcodo... if so, note that there are several things that are incompatible with 5.3.x of PHP.</p>

<p>So your options at that point are to stick with 5.2.x of PHP or upgarde to v0.4.x of Qcodo. &nbsp;Just a thought.</p>

]]></description>
		<author>Mike Ho</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Tue, 10 Jan 2012 16:50:41 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>Do you think there might be configuration I'm missing?<br/>
I even created a raw php mysql php script to see if I could grab the data, the raw script was able to output data from the database.</p>

<p>Here's the raw script<br/>
&lt;?php<br/>
$con = mysql_connect(&ldquo;localhost&rdquo;,&rdquo;root&rdquo;,&rdquo;&rdquo;);<br/>
if (!$con)<br/>
 &nbsp;{<br/>
 &nbsp;die('Could not connect: ' . mysql_error());<br/>
 &nbsp;}</p>

<p>mysql_select_db(&ldquo;uloop_prod&rdquo;, $con);</p>

<p>$result = mysql_query(&ldquo;SELECT * FROM person limit 10&rdquo;);</p>

<p>while($row = mysql_fetch_array($result))<br/>
 &nbsp;{<br/>
 &nbsp;echo $row['first_name'] . &quot; &quot; . $row['last_name'];<br/>
 &nbsp;echo &ldquo;\n&rdquo;;<br/>
 &nbsp;}</p>

<p>mysql_close($con);</p>

<p>?&gt;</p>

]]></description>
		<author>nick leung</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Tue, 10 Jan 2012 16:33:18 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>When I load one school, I still get a segmentation fault:<br/>
$objSchool = School::LoadById(1);<br/>
echo &ldquo;SchoolName: &quot; . $objSchool-&gt;Name . &ldquo;\n&rdquo;;</p>

<p>Also tried putting it into a cursor, but the InsantiateCursor method is not defined.</p>

]]></description>
		<author>nick leung</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Tue, 10 Jan 2012 15:25:33 PST</pubDate>
	</item>
	<item>
		<title>Re: Segmentation fault on Data Load</title>
		<link>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</link>
		<description><![CDATA[<p>Hmm... strange. &nbsp;What if you loaded each school at a time? &nbsp;Do you get an error?</p>

<p>Also, what happens if you do a QQ::All() query and stuff it into a cursor?</p>

<p>e.g.</p>

<pre ><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$objCursor&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">School</span><span style="color: #007700">::</span><span style="color: #0000BB">QueryCursor</span><span style="color: #007700">(</span><span style="color: #0000BB">QQ</span><span style="color: #007700">::</span><span style="color: #0000BB">All</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$objSchool&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">School</span><span style="color: #007700">::</span><span style="color: #0000BB">InsantiateCursor</span><span style="color: #007700">(</span><span style="color: #0000BB">$objCursor</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(</span><span style="color: #0000BB">$objSchool</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Id&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"\r\n"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></pre>

<p>Let me know...</p>

]]></description>
		<author>Mike Ho</author>
		<category>Bugs and Issues</category>
		<comments>http://www.qcodo.com/forums/forum.php/3/4458/lastpage</comments>
		<guid isPermaLink="true">http://www.qcodo.com/forums/forum.php/3/4458/lastpage</guid>
		<pubDate>Tue, 10 Jan 2012 15:12:33 PST</pubDate>
	</item>
</channel>
</rss>

