<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Justin Deltener&#039;s Blog</title>
	<atom:link href="http://www.justindeltener.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justindeltener.com</link>
	<description>Trying hard to prove Technology isn&#039;t evil..and failing horribly.</description>
	<lastBuildDate>Tue, 06 Jul 2010 03:32:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>VMWare Fault Tolerance supports only one core</title>
		<link>http://www.justindeltener.com/vmware-fault-tolerance-supports-only-one-core/</link>
		<comments>http://www.justindeltener.com/vmware-fault-tolerance-supports-only-one-core/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 03:11:08 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/?p=138</guid>
		<description><![CDATA[<p>VMWare Fault Tolerance is a pretty sweet technology&#8230;if only you could run it on more than your image server.<br />
<!--more--></p>
<div id="attachment_140" class="wp-caption alignright" style="width: 310px"><a href="http://www.justindeltener.com/wp-content/uploads/2010/07/vmware-fault-tolerance-single-core.gif" title="vmware-fault-tolerance-single-core" rel="lightbox[138]"><img class="size-medium wp-image-140" title="vmware-fault-tolerance-single-core" src="http://www.justindeltener.com/wp-content/uploads/2010/07/vmware-fault-tolerance-single-core-300x129.gif" alt="" width="300" height="129" /></a><p class="wp-caption-text">VMWare limits Fault Tolerance to a single core</p></div>
<p>In a recent post <a href="/vmware-vsphere-vs-red-hat-enterprise-linux-virtualization/">VMWare vs RedHat Virtualization</a> I was pretty excited about using VMWare&#8217;s Fault Tolerance feature. This allows a VM to run on 2 separate servers with each command being executed in perfect sync across them. Should one fail, the other will pick up without losing a single instruction. It is important to note that non-deterministic events aren&#8217;t replicated. After looking very closely into the documentation, they sneak inside the requirements that the VM can only run on a SINGLE CORE. The screen shot listed is under &#8220;vSphere Availability Guide&#8221; What is even more interesting is the fact that the 8 page document &#8220;Protecting Mission-Critical Workloads with VMware Fault Tolerance&#8221; from VMWare fails to make a single reference to this limitation.</p>
<blockquote><p>Hey you know what..many VM&#8217;s run just dandy with a single core. Let&#8217;s party like its 1999!</p></blockquote>
<p>You heard that right.. If you run a critical application on 4 cores, 3 cores or even 2 cores, you are out of luck. Apparently they are working on multiple core support in the 12 to 18 month time frame.</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/vmware-fault-tolerance-supports-only-one-core/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare vSphere vs Red Hat Enterprise Linux Virtualization</title>
		<link>http://www.justindeltener.com/vmware-vsphere-vs-red-hat-enterprise-linux-virtualization/</link>
		<comments>http://www.justindeltener.com/vmware-vsphere-vs-red-hat-enterprise-linux-virtualization/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 01:37:25 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/?p=102</guid>
		<description><![CDATA[<p>A few features parallel these virtualization offerings, but if you&#8217;re looking for someone to partner with for the Enterprise space, it seems a no brainer to me.<br />
<!--more--></p>
<h2>Virtualization History</h2>
<p>Although historical reference probably dates it later, my own roots in server Virtualization started about 6 or 7 years ago with XEN Server. Before that a server was just a server right? Each machine could only have a single operating system on it. There were Linux boxes and Windows boxes. If you started to outgrow the capacity of the server you simply upgraded the server. Some servers had too much CPU power and too little Hard Disk space, and others vice versa. A network administrator had to be very careful to gauge the requirements of the server to balance cost vs performance and still maintain some kind of semblance of ROI. Luckily over the next few years power increased dramatically as did our capacity and eventual need for more RAM and Disk space.</p>
<p>Virtualization describes a system in which there is a separation between the operating system and the hardware. Ok, some could argue such a separation has always existed in the form of BIOS, but this later is much much more.This layer is referred to as a Hypervisor. Most companies explain them as simply &#8220;stripped down operating systems&#8221; in that they are purpose built with a very small footprint. This is good in the sense that its easier for companies to maintain, and  harder to hack. It acts as a safety net should one of the guest Operating Systems die, the whole machine isn&#8217;t taken down.  It&#8217;s a layer that provides a common interface for other operating systems to co-exist on the same piece of hardware. This is significant in the sense that we no longer have a 1:1 correspondence between operating system and hardware. In an extreme case we could possibly add several gigs of ram and a few TB of Disk space to allow 10 or more operating systems to run on a single piece of hardware. The hardware processing power and memory could be used across these systems. In reality, the number of Operating Systems is only limited by the resources available. Buy a larger machine and have the ability to house more VM&#8217;s.</p>
<h2>VMWare Overview</h2>
<p>Whenever I think of Enterprise Server Virtualization I&#8217;ve always thought first of VMWare. Apparently I&#8217;m not the only one as 100 of the Fortune&#8217;s Top 100 are clients. In my professional experience, we started using VMWare Workstation to run Debian Linux machines on our Windows XP Pro machines. I can&#8217;t think of a single time where one of our Virtual Machine&#8217;s didn&#8217;t operate properly due to the VMWare. It certainly did have its own issues though. One of the top annoyances on my list would have to be the 100 hoops you had to go through to shrink your virtual disk. If you somehow managed to balloon your disk file to 20 gigs and were only using 1 gig, you had to go through many different steps to shrink it back. When taking snapshots and basing new machines from those snapshots the limits were a bit more pronounced as well. All said and done, it did the job and besides a chubby disk file, worked well.</p>
<p>In order to sit at the big kid table with VMWare, we have to be talking about the ESXi Hypervisor and vSphere.  In broader terms lets describe a set of 2 machines with ESXi installed on the hardware. On top of that runs vSphere which does the real orchestration. Here is a list of some kick ass features that make their offering very promising.</p>
<ol>
<li>vMotion &#8211; The ability to move a virtual machine from one physical server to another with NO downtime or interruption of service. In our 2 server configuration, let&#8217;s say we wanted to take Server #1 down for some kind of upgrade, but we had our production VM running Microsoft SQL Server 2005 with some load. This would allow us to say &#8220;Hey Mr. Machine..go wander over to that other piece of hardware&#8221; and lo and behold it would migrate across over to the new machine without interrupting a single SQL call. That&#8217;s pretty damn impressive.</li>
<li>High Availability &#8211; Simply put my little VM machine just took a big dump. The main server will detect this and will  restart it for me automatically.</li>
<li>Fault Tolerance &#8211; HA on crack. This will start a single virtual machine on 2 physical servers and lock them together event for event, instruction per instruction. In the event a single machine fails, the Doppelganger will automatically fail over without losing a single instruction.</li>
<li>Virtual CPUs &#8211; These are really processor Core&#8217;s per Virtual Machine. It does no good to move a physical machine with 4x4core processors to a Virtual Machine if it only has access to 2 cores. This is the maximum utilization for a VM. VMWare offers 4 SMP (Symetrical Multi-Processing) with all their lower offerings and up to 8 SMP for their highest &#8220;Enterprise Plus&#8221; offering.</li>
</ol>
<p>Pricing for VMWare seems a bit high. They seem to split their offerings to target their high end offerings to big bad boy virtualizers, yet something that I think is rather new is their offering of &#8220;Acceleration Packs&#8221; which allow the smaller kiddies to get some more features if they&#8217;re small enough <img src='http://www.justindeltener.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>RHEL Overview</h2>
<p>Admittedly, I&#8217;ve never used RHEL. We&#8217;ve always run Debian for its well known stability in leau of its slow acceptance and verification process. It seems that RHEL tried to jump in to the virtualization market with its acquisition of KVM which powers its virtualization systems. Herein lies some of my issues with it. On one hand, they tout virtualization comes &#8220;standard&#8221; with RHEL..meant to imply you don&#8217;t pay extra for it (cough).</p>
<ol>
<li>vMotion &#8211; Yup, got it..similar to vMotion of VMWare</li>
<li>Virtual CPUs &#8211; To my surprise they actually support 2x the virtual processors (cores) per VM over what VMWare offers in their highest offering. That is a total of 16 vCPUS.</li>
<li>Pricing is much much cheaper then VMWare.</li>
</ol>
<p>Things start to get a little shaky though when you start going beyond that. For one..and yes..just pause for effect here..you aren&#8217;t reading this wrong.. At the time of this writing the web interface to manage the virtualization MUST be run on Windows Server 2003. That&#8217;s right.. Your Linux powered environment is being managed through a Windows machine.. The site mentions a pure Linux management interface is &#8220;in the works&#8221;.. Holy @#$# people.. talk about getting the cart in front of the horses. For me this was kind of a deal breaker. With vMotion support, VMWare even allows the management console to be running INSIDE a virtual machine. I know..that really does break the laws of space time.</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/vmware-vsphere-vs-red-hat-enterprise-linux-virtualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to download Excel or other file over SSL under IE8</title>
		<link>http://www.justindeltener.com/unable-to-download-excel-or-other-file-over-ssl-under-ie8/</link>
		<comments>http://www.justindeltener.com/unable-to-download-excel-or-other-file-over-ssl-under-ie8/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 13:23:37 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/?p=99</guid>
		<description><![CDATA[<p>Ever since IE8 hit the streets I&#8217;ve been having a horrifically nagging issue where all our files that normally download over HTTPS no longer work. They download correctly under FireFox or Google Chrome, but not under Internet Explorer 8. I&#8217;ve tried googling it many times through the months and finally found the issue. It has to do with cach-control headers in the head of the server response. In my context we are generating some Excel documents on the server and pushing to the browser. We were setting Pragma to no-cache in our PHP header like such: &#8220;header(&#8216;Pragma: no-cache&#8217;);&#8221; Removing this little guy fixed the issue. If you&#8217;re unable to do this on the code side, Microsoft has some nice Registry hacking to <a href='http://support.microsoft.com/kb/323308' title="Microsoft IE8 Download Over SSL Fix">fix the issue</a> on the browser side.</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/unable-to-download-excel-or-other-file-over-ssl-under-ie8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Mini Appliance Review and Integration Tutorial</title>
		<link>http://www.justindeltener.com/google-mini-appliance-review-and-integration-tutorial/</link>
		<comments>http://www.justindeltener.com/google-mini-appliance-review-and-integration-tutorial/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 02:32:44 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/google-mini-appliance-review-and-integration-tutorial/</guid>
		<description><![CDATA[<p>It&#8217;s inevitable. That home-brew, built-from-scratch search engine code will start to show its age sooner or later. After many years and a good run my search code was starting to show its age. I did a SQL Profiler trace on MSSQL 2005 and there were several hundred searches daily that took over 10 seconds to execute. I don&#8217;t know about you, but if my search doesn&#8217;t come back in a few seconds, I go elsewhere. I&#8217;ve been farting around with the idea of integrating a Google Mini appliance for a few years but thought its time may of finally come.</p>
<p><!--more--></p>
<h2>Google Mini Features</h2>
<p>We went with the highest available Google Mini Appliance that can index 300,000 pages for a retail price of ~$10,000 US. The website doesn&#8217;t show too much about the actual physical hardware besides pointing out this 10k gem has NO RAID support. For those companies that need mission critical availability, but can&#8217;t fork over the min amount to get into the real Google Appliance offering they suggest buying 2 Google minis. Uhm what? Ok so I dropped 10k on this server and you can&#8217;t throw in a $150 raid card and another hard drive. That&#8217;s just annoying.</p>
<h3>Auto Spell Checking / Suggestions</h3>
<p>The appliance has some kind of black magic spell check thing going on which isn&#8217;t too horribly helpful. There seems to be no way to add onto the dictionary which is pretty annoying. Even more annoying is the fact that even if you supply synonyms for words, it WILL NOT give you the spelling suggestion every time. In my testing I had to perform the exact same search with my misspelling 4-5 times before it gave me the synonym suggestion. As quoted from Google</p>
<blockquote><p>&#8220;The Google Mini uses sophisticated algorithms to generate spelling suggestions from the content in your index. It is especially good at providing relevant spelling suggestions for proper nouns such as the names of employees and product names. The spelling system is fully automated; so it is not possible to manually edit the spelling dictionary. &#8220;</p></blockquote>
<h3>Query Expansion / Keyword Stemming</h3>
<p>This is kind of a bummer. The Mini doesn&#8217;t support this feature. Ideally as an admin I should be able to say &#8220;Hey Mr. appliance, I want you to consider these 3 words as equals&#8221;. There are many cases where I want to server relevant search results based on a small set of keywords instead of having the results scattered across multiple keywords. For instance, what I had a ton of content that related to &#8220;Tonnea Covers&#8221; &#8220;Truck Bed Covers&#8221; or &#8220;Tonno Covers&#8221;. All 3 are the exact same thing, yet its possible if the visitor searches for one, they won&#8217;t get the content behind the others. Of course there are ways &#8220;around&#8221; this, but ideally I should be able to tell the appliance these terms are the same and interchangeable.</p>
<h3>Synonyms</h3>
<p>This is a way for us to suggest another term to search for based on a keyword in the original search. This is *kind* of a work around the Keyword Stemming issue, but the jist is that you&#8217;re still forcing the visitor to click around to see the other search results instead of serving them up all in one group the first time.</p>
<h3>Meta Data Fetching / Searching</h3>
<p>This is actually a pretty sweet feature. We can expose Meta Data on our pages and filter our search results by them, and also fetch the full meta data itself. This would  allow us to cache data right on the appliance for us to pull through on the presentation side instead of being force to do lookups on presentation per data row.</p>
<h2>Integration Options for the Google Mini</h2>
<p>There&#8217;s basically 2 different mechanisms that we can use to integrate with the beast.</p>
<p>Fully Formatted Search Output From the Appliance</p>
<p>XML Search Output</p>
<h2>Issues / Bugs with the Google Mini Search Appliance</h2>
<h3>Broken Preview Feature and Images.</h3>
<p>Ok its probably not a good sign when the first thing you see when you log into the appliance after setup are a bunch of broken images. It wasn&#8217;t a huge deal..but after dropping 10 large on a machine I would hope for more. There is also a preview sections that allows you to modify the XSL stylesheet and see it before saving, that was just simply broken.</p>
<h3>Temporary server error. Try again in a minute.</h3>
<p>Just over a month out of the box, we started having issues. We&#8217;re indexing only a fraction of our max page limit and I would summarize our overall search load as &#8220;low&#8221;. We started getting the following ominous error &#8220;Temporary server error. Try again in a minute.&#8221; The mini comes with tech support now automatically, so it was time to get them in the loop to see what the deal was. Now if you&#8217;re one of those shops that didn&#8217;t pay for the super-uber tech support get ready to wait. Support was only via email and took about a day per email to work through things. All said and done the tech though we were experiencing a documented &#8220;Issue&#8221; and recommended we update our OS software and server software to the latest versions. Now here&#8217;s where things start to get fun. There are 2 different types of updates to view. One is for the Linux OS they have running and another for the actual search engine software running on it. As it turns out, the mini stopped spitting this out and we just decided to address it later should it arise again. Little did we know what was in store!</p>
<h3>Google Mini Appliance Crash / Dead In the Water</h3>
<p>About a month after the issue above, we had a hard crash. The appliance was horribly slow on the admin side and only 10% or less of the search requests were actually getting fulfilled. Those that WERE getting fulfilled were very slow (10-45 seconds each). After a full reboot, it was fine..for 1 minute..then started the same crap. At this point we decided toÂ  push forward with our full OS/Server software updates. That took about 2 hours all said and done and all issues were finally resolved after that.<br />
coming from the XML output from the box.</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/google-mini-appliance-review-and-integration-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMWare Bridged Networking Not Working DHCP</title>
		<link>http://www.justindeltener.com/vmware-bridged-networking-not-working-dhcp/</link>
		<comments>http://www.justindeltener.com/vmware-bridged-networking-not-working-dhcp/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 22:37:16 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
		
		<guid isPermaLink="false">http://www.justindeltener.com/vmware-bridged-networking-not-working-dhcp/</guid>
		<description><![CDATA[<p>Ok so here&#8217;s the low-down. I got a new Vostro lappy for work and I was really hoping that it would be easy to get all my crap ported over to it. I was a little leary about how well my virtual machines would port over; turns out for good reason. For the life of me I couldn&#8217;t get an IP from the DHCP server! I was running Debian Linux on a Vista host. The VM was originally created using VMWare Workstation but now was running under the free VMWare Server. This new computer has Norton Internet Security and I&#8217;ve had issues with that before with mystery blocking etc. I was able to communicate with the VM through the shared private network and also through the Bridged interface only when I hardcoded the IP. It still couldn&#8217;t reach the internet though. Well after turning off all possible options, quadruple checking my adapter settings and all that fun crap, it came down to this.</p>
<p>In order to get Bridged Mode working on the Virtual Machine, the adapter it connects to must support promiscuous mode. It was connecting to my Wireless adapter..just like it was in the previous computer. You think it supported it? yeah..bad times. I simply told VM to use the normal Lan adapter, connected it to the wireless switch and kablam, i had my IP..Nice 5 hours of wasted time. I hope this helps someone cause it took me forever to figure out <img src='http://www.justindeltener.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/vmware-bridged-networking-not-working-dhcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Peanut Butter and Jelly Sandwich Method for higher quality communication</title>
		<link>http://www.justindeltener.com/using-the-peanut-butter-and-jelly-sandwich-method-to-force-communication-detail/</link>
		<comments>http://www.justindeltener.com/using-the-peanut-butter-and-jelly-sandwich-method-to-force-communication-detail/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 16:56:00 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[Be a better developer]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/using-the-peanut-butter-and-jelly-sandwich-method-to-force-communication-detail/</guid>
		<description><![CDATA[<p>This article describes an activity to really get yourself and others to increase their level of communication detail.<br />
<!--more--></p>
<h2>Peanut Butter and Jelly</h2>
<p>mmmmm. Holy crap I love PB&#038;J sandwiches. In fact I just got done eating one. That reminded me of a really fun and silly activity I did when I was an On The Road Trainer for Chilis Bar &#038; Grill. Mind you that was a LONG time ago.</p>
<h2>The Activity</h2>
<p>Ok the jist is very simple. The process involves 2 people. One person who is going to be trained (Instructor) in the method and the trainer (Sandwich Builder). The goal is to get the Builder to put together the sandwich with the directions being supplied by the Instructor. Now this sounds pretty easy doesn&#8217;t it? The fun part is to take what the Instructor says for face value and only do the bare minimum to comply with the direction. Here is a fun example:</p>
<blockquote><p>
<b>Instructor:</b> Pick up the bread.<br />
Builder: Uses his feet to pick up the piece of bread.<br />
<b>Instructor:</b> No, pick up the bread with your hands.<br />
Builder: Uses the back of his hands to pick up the entire loaf of bread.<br />
<b>Instructor:</b> NO! Pick up a single slice of bread.<br />
Builder: Uses his mouth to pick up a slice of bread still in the wrapper.<br />
<b>Instructor:</b> GAAH No, Use your hands to take the slice of bread out of the wrapper.<br />
Builder: Uses the bottoms of his hands to pick up the piece of bread then eats it.
</p></blockquote>
<p>You can see how quickly this can become horribly out of control. Its a lot of fun. Here is something that would get the Builder to do the job correctly.</p>
<blockquote><p>
<b>Instructor:</b><br />
Using your right arm slowly extend your arm so that your hand is approximately 3 inches from the mouth of the loaf of bread.<br />
With your right hand make a pinching gesture using your pointer finger and thumb.<br />
Open this gesture the thickness of the first piece of bread in the loaf.<br />
With great care move your arm and hand toward the first slice of bread as such the first slice is inserted in the the space between your pointer finger and thumb; The orientation of the hand will be perpendicular to longest side of the bread so that the piece will fit into the gesture without compression or deformation.
</p></blockquote>
<p>You can easily notice the great level of detail between the 2 examples. Each time I communicate I try to nail down the appropriate level of detail for the audience in order to make certain they are on the same page as I am so we don&#8217;t have to double back to clarify things that should of been clear from the beginning.</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/using-the-peanut-butter-and-jelly-sandwich-method-to-force-communication-detail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining Caller Context When Using Javascript Class Instance Member Functions As AJAX Event Handlers</title>
		<link>http://www.justindeltener.com/maintaining-caller-context-when-using-javascript-class-instance-member-functions-as-ajax-event-handlers/</link>
		<comments>http://www.justindeltener.com/maintaining-caller-context-when-using-javascript-class-instance-member-functions-as-ajax-event-handlers/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 03:26:11 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/maintaining-caller-context-when-using-javascript-class-instance-member-functions-as-ajax-event-handlers/</guid>
		<description><![CDATA[<p>One would think that it would be pretty trivial to set an AJAX Event Handler to be a Javascript class member function &#8230; yeah not so much. Just one more reason why Javascript seems more and more left field to me. Don&#8217;t worry though, I&#8217;ll walk you through how to get it to play nice.<br />
<!--more--></p>
<h2>About Javascript Context</h2>
<p>If you&#8217;re a stickler for Javascript class encapsulation, when you get into Ajax calls, things start to get pretty hairy. You will quickly find out that if you want to fire a method of your Javascript class instance, it WILL call it&#8230;oh yes&#8230;it will&#8230;but will lose all context as to where it belongs. For instance, if we have a method that purely local variables, all will be fine and dandy. It has local scope or utilizes global Javascript variables so all will perform as you expect. Its only when you start accessing this.  values when things go ape-shit. The best way I can image it myself is to think that Javascript is grabbing a copy of my routine and placing it into nana land and at that point this.anything is meaningless. this is no longer the THIS that you mean it to be when you first assigned the function.</p>
<h2>Be A Lazy Ass And Store The Calling Context In A Global Variable</h2>
<p>You will notice in the code that it forces you to pass in the context of the function that you are going to be firing in response to the Ajax request. I personally think this is a good thing to enforce. It makes you always think about what context your functions are going to be called and with member functions being fired by events, this is a good thing to keep in mind. By default the code will store the global context as this, which is the small utility class to fire off an Ajax request.  This will make sure then when our local member function is called OUT of context, that we can access a known global variable to hop back into the correct context which would be this EXACT instance of the class. Realize that 2 concurrent requests will blow this out of the water. The class is designed for a quick and dirty one shot deal, nothing more. If we want to get any fancier, we will need something to help us keep track of all this crap.</p>
<h2>Use A Globally Instantiated Context Handler For Your Page Lifetime</h2>
<p>I just love thinking about this because I mean, cummon, it sounds pretty big and important right? Well in reality its a fancy description for a single Javascript class who&#8217;s only mission in life is to keep track of all our Ajax requests. Instead of relying on a single global variable to hold our THIS context, we will instead get passed in an instance of the Global Context Handler. Then when we get a response on from our Ajax request, we simply tell our handler to go check its children to see who fired. At that point, the Context Handler will loop through all its instances of our class and when it finds one that has fired and hasn&#8217;t been handled, it will call the handling function for THAT specific instance which will make sure we maintain the correct Javascript Context. As you see in the code below, its horribly stupid, but really does the job.</p>
<p>Another thing to consider is that we could also have this Marshalling our Ajax requests as well. I&#8217;ve read that many browsers can only handle a few Ajax requests at the same time. The Context Handler class would be the perfect spot to push all our requests on a queue and when we call CheckEvents and get a new event handled, we can nuke that Ajax request and start a new one from our queue.</p>
<p><div style='font-size:10pt;'><div class="synthi_code" style="display:none;" id ="plain_synthi_4f3309944a1cc"><div class="synthi_header" style="font-weight:bold;"> Javascript <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4f3309944a1cc').style.display='block';document.getElementById('plain_synthi_4f3309944a1cc').style.display='none';return false">Show Styled Code</a>]:</span></div><pre style="width:100%;overflow:auto;">/**
 * 
 * @param {String} HttpUrl - The Url to post to
 * @param {Object} CallBackContext - The object which contains the CallBackFunction
 * @param {Method} CallBackFunction - The call back function
 * @param {String} PostMethod - The get/post method
 * @param {String} Parameters - Parameters to pass in the get/post string
 * @param {Object} ContextHandler - This is an instance of our  global context handler. That allows concurrent
 * ajax calls correctly.
 */
function Ajaxv2(HttpUrl,CallBackContext,CallBackFunction,PostMethod,Parameters,ContextHandler)
{	
	this.HttpUrl		= HttpUrl;
	this.PostMethod		= PostMethod;
	this.Parameters		= Parameters;
	this.ContextHandler	= ContextHandler;
	this.Handled		= false;	
	this.Version		= 2.0;
	this.Request		= null;
	this.EventData		= null;
	
	GlobalAjaxv2Context	= this; //really only for single fired events, 2 concurrent wont' work without a  context handler.
	
	if(typeof(ContextHandler) == &#034;undefined&#034;)
		this.ContextHandler=null

	//this checks our state and performs the callback function on success
	this.GlobalProcessRequestAjaxv2 = function()
	{		
		
		//when this even fires, our context is WITHIN the XMLHttpRequest object itself
		if(typeof(ContextHandler) != &#034;undefined&#034;)
		{
			/*
			 * DO NOT fire our event off our globallly stored context. we are using a Context Handler meaning we are firing 2+ events at once. We need
			 * to let the context handler do its thing.
			*/
			ContextHandler.CheckEvents();
		}			
		else
			GlobalAjaxv2Context.ProcessRequestAjaxv2();
	}
	this.ProcessRequestAjaxv2 = function()
     {	
	 	try
		{
			if(this.Request.readyState == 4) 
			{
				//According to the HTTP 1.1 specification, any response that has a code between 200 and 299 inclusive is a successful response.
				if(this.Request.status >= 200 && this.Request.status <= 299) 
				{
					CallBackFunction.call(CallBackContext,true,this.Request,this.EventData);					
				} 
				else 
				{
					//error out with the server error code and message.
					CallBackFunction.call(CallBackContext,false,this.Request,this.EventData);
				}
			}
		}
		catch(exception)
		{
			alert(&#034;An exception was caught while trying to process an AJAX request. (&#034;+exception+&#034;)&#034;);
		}		        	
     }	
					
	//this creates our object
     this.InitAjaxv2 = function()
     {	     
	     try 
	     {
	     	HttpRequest = new XMLHttpRequest();
	     } 
	     catch(e) 
	     {
	     	try 
	       	{
	       		HttpRequest = new ActiveXObject(&#034;Msxml2.XMLHTTP&#034;);
	       	} 
	       	catch (e) 
	       	{
	        	try 
	        	{
	         		HttpRequest = new ActiveXObject(&#034;Microsoft.XMLHTTP&#034;);
	         	} 
	         	catch (E) 
	         	{
	          		HttpRequest = null;
	         	}
	       	}
	     }	     
	     return HttpRequest;
	 }
	

	//this actually sends the get or post request
	this.GetPost = function(Async)
	{
		this.Request = this.InitAjaxv2();

		if(this.Request == null)
			return false;
			
		this.Request.onreadystatechange=this.GlobalProcessRequestAjaxv2;
		
		//setup our context handler if we need to
		if(this.ContextHandler != null)
			this.ContextHandler.AddAjaxv2Object(this);
	
      	this.Request.open(this.PostMethod, this.HttpUrl, Async);
	    this.Request.setRequestHeader(&#034;Content-Type&#034;,&#034;application/x-www-form-urlencoded; charset=UTF-8&#034;);
	    this.Request.setRequestHeader(&#034;If-Modified-Since&#034;, &#034;Sat, 1 Jan 2000 00:00:00 GMT&#034;);
      	this.Request.send(this.Parameters);
      	
      	/*
      		MOZ browser will never fire onreadystatechange when in synchronous mode,
      		but they will wait for req.send to complete. So we can fire the function here instead.
      		http://www.quirksmode.org/blog/archives/2005/09/xmlhttp_notes_r_2.html
      	*/
      	if (Async == false)      	
      	{
			this.GlobalProcessRequestAjaxv2();   	
      	}		
	}
	
	/*
	*   @name getFormValues()
	*   @descr This function creates a string of the name-value pairs for the specified form object
	*   @param (object) fobj - the form object that the values are wanted for
	*   @return str - the string containing the name-value pairs for the form object
	*/
	this.GetFormValues = function(fobj)
	{
	    var str = &#034;&#034;;
	    var valueArr = null;
	    var val = &#034;&#034;;
	    var cmd = &#034;&#034;;
		var obj;
	
		//get all the inputs
		var objects = fobj.getElementsByTagName('input');
		for(object in objects)
		{
			obj = objects[object];
			switch(obj.type)
			{
				case &#034;text&#034;:				
				case &#034;hidden&#034;:
					str += obj.id + &#034;=&#034; + escape(obj.value) + &#034;&&#034;;				
					break;
					
				case &#034;radio&#034;:
				case &#034;checkbox&#034;: 
	                if  (obj.checked)
	                    str += obj.id + &#034;=&#034; + escape(obj.value) + &#034;&&#034;;	                
	                break;
	            
			}
			
		}
		
		objects = fobj.getElementsByTagName('select');
		for(object in objects)
		{
			obj = objects[object];
			switch(obj.type)
			{
				case &#034;select-one&#034;:
	                str += obj.id + &#034;=&#034; + obj.options[obj.selectedIndex].value + &#034;&&#034;;
	                break;	            
	            
	            case &#034;select-multiple&#034;:
	            	for(f=0;f<obj.length;f++)
					{
	                   	if(obj.options[f].selected==true)
	            			str += obj.id + &#034;=&#034; + escape(obj.options[f].value) + &#034;&&#034;;       	 
	               	}
	            	break; 
			}
		}
		
		objects = fobj.getElementsByTagName('textarea');
		for(object in objects)
		{
			obj = objects[object];	
			str += obj.id + &#034;=&#034; + escape(obj.value) + &#034;&&#034;;
		}
	
		str = str.replace(/\+/g,&#034;%2b&#034;); //+ are going to spaces grr!	
	    str = str.substr(0,(str.length - 1));
	    return str;
	}
}</pre></div><div class="synthi_code" style="display:block;" id ="styled_synthi_4f3309944a1cc"><div class="synthi_header" style="font-weight:bold;"> Javascript <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4f3309944a1cc').style.display='block';document.getElementById('styled_synthi_4f3309944a1cc').style.display='none';return false">Show Plain Code</a>]:</span></div><div class="javascript" style="font-family: monospace;"><ol><li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * </span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * @param {String} HttpUrl - The Url to post to</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * @param {Object} CallBackContext - The object which contains the CallBackFunction</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * @param {Method} CallBackFunction - The call back function</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * @param {String} PostMethod - The get/post method</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * @param {String} Parameters - Parameters to pass in the get/post string</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * @param {Object} ContextHandler - This is an instance of our&nbsp; global context handler. That allows concurrent</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * ajax calls correctly.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> */</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> Ajaxv2<span style="color: #66cc66;">&#40;</span>HttpUrl,CallBackContext,CallBackFunction,PostMethod,Parameters,ContextHandler<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">HttpUrl</span>&nbsp; &nbsp; &nbsp; &nbsp; = HttpUrl;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">PostMethod</span>&nbsp;&nbsp;= PostMethod;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Parameters</span>&nbsp;&nbsp;= Parameters;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">ContextHandler</span>&nbsp;= ContextHandler;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Handled</span>&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #003366; font-weight: bold;">false</span>;&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Version</span>&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #CC0000;">2.0</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #003366; font-weight: bold;">null</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">EventData</span>&nbsp; &nbsp; = <span style="color: #003366; font-weight: bold;">null</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; GlobalAjaxv2Context&nbsp;= <span style="color: #000066; font-weight: bold;">this</span>; <span style="color: #009900; font-style: italic;">//really only for single fired events, 2 concurrent wont' work without a&nbsp; context handler.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #66cc66;">&#40;</span>ContextHandler<span style="color: #66cc66;">&#41;</span> == <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">ContextHandler</span>=<span style="color: #003366; font-weight: bold;">null</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//this checks our state and performs the callback function on success</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">GlobalProcessRequestAjaxv2</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//when this even fires, our context is WITHIN the XMLHttpRequest object itself</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #66cc66;">&#40;</span>ContextHandler<span style="color: #66cc66;">&#41;</span> != <span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/*</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * DO NOT fire our event off our globallly stored context. we are using a Context Handler meaning we are firing 2+ events at once. We need</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * to let the context handler do its thing.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ContextHandler.<span style="color: #006600;">CheckEvents</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GlobalAjaxv2Context.<span style="color: #006600;">ProcessRequestAjaxv2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">ProcessRequestAjaxv2</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span>&nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">try</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #006600;">readyState</span> == <span style="color: #CC0000;">4</span><span style="color: #66cc66;">&#41;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//According to the HTTP 1.1 specification, any response that has a code between 200 and 299 inclusive is a successful response.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #000066;">status</span> &gt;= <span style="color: #CC0000;">200</span> &amp;&amp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #000066;">status</span> &lt;= <span style="color: #CC0000;">299</span><span style="color: #66cc66;">&#41;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CallBackFunction.<span style="color: #006600;">call</span><span style="color: #66cc66;">&#40;</span>CallBackContext,<span style="color: #003366; font-weight: bold;">true</span>,<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>,<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">EventData</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//error out with the server error code and message.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CallBackFunction.<span style="color: #006600;">call</span><span style="color: #66cc66;">&#40;</span>CallBackContext,<span style="color: #003366; font-weight: bold;">false</span>,<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>,<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">EventData</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #66cc66;">&#40;</span>exception<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;An exception was caught while trying to process an AJAX request. (&quot;</span>+exception+<span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span>&nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//this creates our object</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">InitAjaxv2</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span>&nbsp;&nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">try</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;HttpRequest = <span style="color: #003366; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">try</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;HttpRequest = <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;Msxml2.XMLHTTP&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">try</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;HttpRequest = <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft.XMLHTTP&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span>E<span style="color: #66cc66;">&#41;</span> </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; HttpRequest = <span style="color: #003366; font-weight: bold;">null</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp;&nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> HttpRequest;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//this actually sends the get or post request</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">GetPost</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>Async<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span> = <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">InitAjaxv2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span> == <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #006600;">onreadystatechange</span>=<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">GlobalProcessRequestAjaxv2</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//setup our context handler if we need to</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">ContextHandler</span> != <span style="color: #003366; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">ContextHandler</span>.<span style="color: #006600;">AddAjaxv2Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">PostMethod</span>, <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">HttpUrl</span>, Async<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #006600;">setRequestHeader</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;Content-Type&quot;</span>,<span style="color: #3366CC;">&quot;application/x-www-form-urlencoded; charset=UTF-8&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #006600;">setRequestHeader</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;If-Modified-Since&quot;</span>, <span style="color: #3366CC;">&quot;Sat, 1 Jan 2000 00:00:00 GMT&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Request</span>.<span style="color: #006600;">send</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">Parameters</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/*</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOZ browser will never fire onreadystatechange when in synchronous mode,</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; but they will wait for req.send to complete. So we can fire the function here instead.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http://www.quirksmode.org/blog/archives/2005/09/xmlhttp_notes_r_2.html</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; */</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>Async == <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">GlobalProcessRequestAjaxv2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp;&nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">/*</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;@name getFormValues()</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;@descr This function creates a string of the name-value pairs for the specified form object</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;@param (object) fobj - the form object that the values are wanted for</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; *&nbsp; &nbsp;@return str - the string containing the name-value pairs for the form object</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">&nbsp; &nbsp; */</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">GetFormValues</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>fobj<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> str = <span style="color: #3366CC;">&quot;&quot;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> valueArr = <span style="color: #003366; font-weight: bold;">null</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> val = <span style="color: #3366CC;">&quot;&quot;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> cmd = <span style="color: #3366CC;">&quot;&quot;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> obj;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//get all the inputs</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> objects = fobj.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>object <span style="color: #000066; font-weight: bold;">in</span> objects<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = objects<span style="color: #66cc66;">&#91;</span>object<span style="color: #66cc66;">&#93;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">type</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;text&quot;</span>:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;hidden&quot;</span>:</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; str += obj.<span style="color: #006600;">id</span> + <span style="color: #3366CC;">&quot;=&quot;</span> + escape<span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">value</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">&quot;&amp;&quot;</span>;&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;radio&quot;</span>:</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;checkbox&quot;</span>: </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span>&nbsp; <span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">checked</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;str += obj.<span style="color: #006600;">id</span> + <span style="color: #3366CC;">&quot;=&quot;</span> + escape<span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">value</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">&quot;&amp;&quot;</span>;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">break</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; objects = fobj.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>object <span style="color: #000066; font-weight: bold;">in</span> objects<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = objects<span style="color: #66cc66;">&#91;</span>object<span style="color: #66cc66;">&#93;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">type</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;select-one&quot;</span>:</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;str += obj.<span style="color: #006600;">id</span> + <span style="color: #3366CC;">&quot;=&quot;</span> + obj.<span style="color: #006600;">options</span><span style="color: #66cc66;">&#91;</span>obj.<span style="color: #006600;">selectedIndex</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">value</span> + <span style="color: #3366CC;">&quot;&amp;&quot;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">break</span>;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">&quot;select-multiple&quot;</span>:</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>f=<span style="color: #CC0000;">0</span>;f&lt;obj.<span style="color: #006600;">length</span>;f++<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">options</span><span style="color: #66cc66;">&#91;</span>f<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">selected</span>==<span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; str += obj.<span style="color: #006600;">id</span> + <span style="color: #3366CC;">&quot;=&quot;</span> + escape<span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">options</span><span style="color: #66cc66;">&#91;</span>f<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">value</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">&quot;&amp;&quot;</span>;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">break</span>; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; objects = fobj.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'textarea'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span>object <span style="color: #000066; font-weight: bold;">in</span> objects<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj = objects<span style="color: #66cc66;">&#91;</span>object<span style="color: #66cc66;">&#93;</span>;&nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; str += obj.<span style="color: #006600;">id</span> + <span style="color: #3366CC;">&quot;=&quot;</span> + escape<span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">value</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">&quot;&amp;&quot;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; str = str.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066FF;">/\+/g</span>,<span style="color: #3366CC;">&quot;%2b&quot;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">//+ are going to spaces grr!&nbsp; &nbsp; </span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;str = str.<span style="color: #006600;">substr</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;">0</span>,<span style="color: #66cc66;">&#40;</span>str.<span style="color: #006600;">length</span> - <span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span> str;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></div></div></div><br />
<div style='font-size:10pt;'><div class="synthi_code" style="display:none;" id ="plain_synthi_4f33099458458"><div class="synthi_header" style="font-weight:bold;"> Javascript <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('styled_synthi_4f33099458458').style.display='block';document.getElementById('plain_synthi_4f33099458458').style.display='none';return false">Show Styled Code</a>]:</span></div><pre style="width:100%;overflow:auto;">/**
 * Global Ajax Context Handler. This is simply a global class that keeps track of all ajax requests we've made and when told to, will loop through them to see if there are
 * any that need to be taken care of. By housing all instances in a single spot, we  can simply tell this  class to CheckEvents and it will loop through its internal
 * array of ajax objects to see which objects have have completed, yet haven't been handled. This way it doesn't care who actually STARTED this request, it will always
 * fire the right handler for the right ajax object.
 */
function AjaxContextHandler()
{
	this.AjaxObjects = Array();
	
	this.AddAjaxv2Object = function(object)
	{
		this.AjaxObjects.push(object);		
	}
	
	
	this.CheckEvents = function()
	{			
		for(var i=0;i<this.AjaxObjects.length;i++)
		{
			var obj=this.AjaxObjects[i];				
			if(obj != null && !obj.Handled)
			{
				if(obj.Request != null && obj.Request.readyState == 4)
				{					
					obj.Handled	= true;
					obj.Fired	= true;
					obj.ProcessRequestAjaxv2(); //get back into context ;)
					this.AjaxObjects[i] = null; //free up our array;
				}				
			}
		}
	}	
}</pre></div><div class="synthi_code" style="display:block;" id ="styled_synthi_4f33099458458"><div class="synthi_header" style="font-weight:bold;"> Javascript <span  class="synthi_button"style="font-weight:lighter;font-size:smaller;">[<a href="#" onClick="javascript:document.getElementById('plain_synthi_4f33099458458').style.display='block';document.getElementById('styled_synthi_4f33099458458').style.display='none';return false">Show Plain Code</a>]:</span></div><div class="javascript" style="font-family: monospace;"><ol><li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">/**</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * Global Ajax Context Handler. This is simply a global class that keeps track of all ajax requests we've made and when told to, will loop through them to see if there are</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * any that need to be taken care of. By housing all instances in a single spot, we&nbsp; can simply tell this&nbsp; class to CheckEvents and it will loop through its internal</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * array of ajax objects to see which objects have have completed, yet haven't been handled. This way it doesn't care who actually STARTED this request, it will always</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> * fire the right handler for the right ajax object.</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;"> */</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> AjaxContextHandler<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">AjaxObjects</span> = Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">AddAjaxv2Object</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>object<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">AjaxObjects</span>.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span>object<span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">CheckEvents</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i=<span style="color: #CC0000;">0</span>;i&lt;this.<span style="color: #006600;">AjaxObjects</span>.<span style="color: #006600;">length</span>;i++<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> obj=<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">AjaxObjects</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>obj != <span style="color: #003366; font-weight: bold;">null</span> &amp;&amp; !obj.<span style="color: #006600;">Handled</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">Request</span> != <span style="color: #003366; font-weight: bold;">null</span> &amp;&amp; obj.<span style="color: #006600;">Request</span>.<span style="color: #006600;">readyState</span> == <span style="color: #CC0000;">4</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">Handled</span>&nbsp;= <span style="color: #003366; font-weight: bold;">true</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">Fired</span>&nbsp; &nbsp;= <span style="color: #003366; font-weight: bold;">true</span>;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">ProcessRequestAjaxv2</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">//get back into context ;)</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">AjaxObjects</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = <span style="color: #003366; font-weight: bold;">null</span>; <span style="color: #009900; font-style: italic;">//free up our array;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></div></div></div></p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/maintaining-caller-context-when-using-javascript-class-instance-member-functions-as-ajax-event-handlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why .Net / MS open source projects really don&#8217;t exist</title>
		<link>http://www.justindeltener.com/why-net-ms-open-source-projects-really-dont-exist/</link>
		<comments>http://www.justindeltener.com/why-net-ms-open-source-projects-really-dont-exist/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 17:34:24 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[My Rant]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/why-net-ms-open-source-projects-really-dont-exist/</guid>
		<description><![CDATA[<p>Here is a short little blurb on why everyone and their grandmother uses LAMP/RAILS open source products and comparatively there are very few .Net projects in existence.</p>
<p><!--more--><br />
I was having an interesting conversation with some buddies the other day about the current status and future direction of open source projects. It really seems that the software industry is flooded with LAMP or RAILS open source projects and rarely .Net. From one of my C#/.Net developer buddies came the question:</p>
<blockquote><p>
Why do you think people gravitate towards more open source / LAMP packages for online content distribution?
</p></blockquote>
<p>It took me a while to really get a good perspective on this and I think I can offer a few bits of incite. I should mention I consider these not to be ultra enlightening objectifications.</p>
<p><img id="image84" src="/wp-content/uploads/2007/08/old_ban_birdy.jpg" alt="Cool Old Dude" style='float:right'/></p>
<h2>Maturity</h2>
<p>With the whole Blog &#8220;phenomena&#8221; going crazy the past few years we&#8217;re talking about more and more ordinary people wanting to etch out their little corner of the net. These people aren&#8217;t willing to shell out money for blog software. The whole Blog push was actually being *driven* by open source software from the start. It was only until it really started to become popular that other companies like Movable Type started joining in on the fun to make some money. With Blog software being founded on free technologies, this ultimately meant that there were many more available developers to contribute to making the software better since there was literally no cost to contribute. The same can&#8217;t be said for .Net development.</p>
<h2>Target Users</h2>
<p>.NET development shops are all about money. That&#8217;s just the nature of the beast. Its really hard to spend the serious cash involved in getting a development environment setup and a product created without wanting to recoup some of those thousands of dollars shit to the wind to the MS beast. This  can really be a good thing. Off the shelf components all come with a price tag and while this really sucks for the little guy, the corporations that utilize said goodies have at least SOMETHING to hang onto for leverage when it comes to support for the product.</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/why-net-ms-open-source-projects-really-dont-exist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using PHP5 Base Class Static Member Variables to encapsulate Presentation Layer Dependencies</title>
		<link>http://www.justindeltener.com/using-php5-base-class-static-member-variables-to-encapsulate-presentation-layer-dependencies/</link>
		<comments>http://www.justindeltener.com/using-php5-base-class-static-member-variables-to-encapsulate-presentation-layer-dependencies/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 17:05:06 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/using-php5-base-class-static-member-variables-to-encapsulate-presentation-layer-dependencies/</guid>
		<description><![CDATA[<p>This post covers how to utilize static member variables to keep track of your presentation layer CSS/JS dependencies.<br />
<!--more--></p>
<p>Wow that&#8217;s a huge title LOL. Well in reality I think you&#8217;ll find the subject matter pretty straight forward.</p>
<h2>The issue</h2>
<p>The issue is how to move to a more object oriented presentation layer  and still be able to have an object that self sufficient without having to manually include a but load of CSS or JS files on the final web page. What&#8217;s the point in having a high resolution of presentation layer abstraction if you have to instantiate the object on the page and also figure out what it uses and include those files?</p>
<h2>The answer</h2>
<p>I know for a fact I read the whole list on what was new with PHP5 but apparently I didn&#8217;t put 2+2 together for quite some time doh! You see, ideally we would have a magic array or list or &#8220;magic white board&#8221; that our instantiated presentation layer objects would all use to keep track of what their dependencies were so when it came time to render our page we not only didn&#8217;t need to hard code the references, but we didn&#8217;t need to go hunting around for what those references were either. That allows us to keep a very nice &#8220;pure&#8221; abstraction for our objects. Each object is a cute little guy with a css to encapsulate its presentation, and the actual php file to encapsulate the presentation logic.</p>
<h2>Rough Justonian Code</h2>
<p>Ok, so the jist of this methodology is to have a magic Presentation Layer Base Class that we can derive from and that allows us to push our dependencies onto an array where we trust that our calling page to use our base class static method to print out ALL our dependencies. I don&#8217;t mean just for one object, but one call for all instantiated Presentation Layer Objects that derive from this base. So, something like:</p>
<p><table class='codetable'><tr><th>1. <br />2. <br />3. <br />4. <br />5. <br />6. <br />7. <br />8. <br />9. <br />10. <br />11. <br />12. <br />13. <br />14. <br />15. <br />16. <br />17. <br />18. <br />19. <br />20. <br />21. <br />22. <br />23. <br />24. <br />25. <br />26. <br />27. <br />28. <br />29. <br />30. <br />31. <br />32. <br />33. <br />34. <br />35. <br />36. <br />37. <br />38. <br />39. <br />40. <br />41. <br />42. <br />43. <br />44. <br />45. <br />46. <br />47. <br />48. <br />49. <br />50. <br />51. <br />52. <br />53. <br />54. <br />55. <br />56. <br />57. <br />58. <br />59. <br />60. <br />61. <br />62. <br />63. <br />64. <br />65. <br />66. <br /></th><td><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">PresentationObjectBase<br /></span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**&nbsp;Constant&nbsp;to&nbsp;represent&nbsp;CSS&nbsp;Dependencies&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">const&nbsp;</span><span style="color: #0000BB">DEPENDENCY_CSS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**&nbsp;Constant&nbsp;to&nbsp;represent&nbsp;Javascript&nbsp;Dependencies&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">const&nbsp;</span><span style="color: #0000BB">DEPENDENCY_JAVASCRIPT&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**&nbsp;Our&nbsp;static&nbsp;base&nbsp;class&nbsp;array&nbsp;that&nbsp;will&nbsp;hold&nbsp;the&nbsp;dependencies&nbsp;for&nbsp;ALL&nbsp;presentation&nbsp;objects&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">static&nbsp;private&nbsp;</span><span style="color: #0000BB">$_dependencies</span><span style="color: #007700">=array();&nbsp;</span><span style="color: #FF8000">#&nbsp;we&nbsp;need&nbsp;to&nbsp;initialize&nbsp;in&nbsp;case&nbsp;we&nbsp;check&nbsp;for&nbsp;a&nbsp;dep,&nbsp;but&nbsp;have&nbsp;none.<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;/**<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Adds&nbsp;a&nbsp;dependency&nbsp;to&nbsp;the&nbsp;internal&nbsp;list<br />&nbsp;&nbsp;&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;routine&nbsp;will&nbsp;add&nbsp;a&nbsp;dependency&nbsp;to&nbsp;the&nbsp;internal&nbsp;list&nbsp;under&nbsp;the&nbsp;selected&nbsp;type.&nbsp;The&nbsp;base&nbsp;class&nbsp;holds<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;ALL&nbsp;dependencies<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;ALL&nbsp;presentation&nbsp;layer&nbsp;objects.<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;$dependency_type&nbsp;One&nbsp;of&nbsp;the&nbsp;DEPENDENCY_&nbsp;constants.<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;$full_tag&nbsp;The&nbsp;full&nbsp;tag&nbsp;to&nbsp;be&nbsp;printed&nbsp;to&nbsp;the&nbsp;browser&nbsp;come&nbsp;rendering&nbsp;time.<br />&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">protected&nbsp;static&nbsp;function&nbsp;</span><span style="color: #0000BB">add_dependency</span><span style="color: #007700">(</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">,</span><span style="color: #0000BB">$full_tag</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">$_dependencies</span><span style="color: #007700">[</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">][]&nbsp;=&nbsp;</span><span style="color: #0000BB">$full_tag</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;a&nbsp;dependency&nbsp;from&nbsp;the&nbsp;internal&nbsp;list<br />&nbsp;&nbsp;&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;will&nbsp;return&nbsp;an&nbsp;array&nbsp;of&nbsp;registered&nbsp;dependencies&nbsp;for&nbsp;the&nbsp;type&nbsp;specified.<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;ALL&nbsp;presentation&nbsp;layer&nbsp;objects.<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;$dependency_type&nbsp;One&nbsp;of&nbsp;the&nbsp;DEPENDENCY_&nbsp;constants.<br />&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">protected&nbsp;static&nbsp;function&nbsp;</span><span style="color: #0000BB">get_dependency</span><span style="color: #007700">(</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">array_key_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">,</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">$_dependencies</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">$_dependencies</span><span style="color: #007700">[</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Prints&nbsp;a&nbsp;dependency&nbsp;from&nbsp;the&nbsp;internal&nbsp;list<br />&nbsp;&nbsp;&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;will&nbsp;print&nbsp;the&nbsp;array&nbsp;of&nbsp;registered&nbsp;dependencies&nbsp;selected&nbsp;by&nbsp;type,&nbsp;split&nbsp;by&nbsp;newlines.<br />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;$dependency_type&nbsp;One&nbsp;of&nbsp;the&nbsp;DEPENDENCY_&nbsp;constants.<br />&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">public&nbsp;static&nbsp;function&nbsp;</span><span style="color: #0000BB">print_dependency</span><span style="color: #007700">(</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$depend</span><span style="color: #007700">=</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">get_dependency</span><span style="color: #007700">(</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$depend&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;</span><span style="color: #0000BB">join</span><span style="color: #007700">(</span><span style="color: #0000BB">array_unique</span><span style="color: #007700">(</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">$_dependencies</span><span style="color: #007700">[</span><span style="color: #0000BB">$dependency_type</span><span style="color: #007700">]),</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/*&nbsp;Use&nbsp;Example<br />&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;the&nbsp;derived&nbsp;class<br />&nbsp;&nbsp;&nbsp;&nbsp;parent::add_dependency(self::DEPENDENCY_JAVASCRIPT,"&lt;script&nbsp;type='text/javascript'&nbsp;src='/js/my_js_file.js'&gt;&lt;/script&gt;");<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;in&nbsp;the&nbsp;main&nbsp;php&nbsp;page&nbsp;that&nbsp;does&nbsp;the&nbsp;rendering<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php&nbsp;PresentationObjectBase::print_dependency(PresentationObjectBase::DEPENDENCY_JAVASCRIPT);&nbsp;?&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php&nbsp;PresentationObjectBase::print_dependency(PresentationObjectBase::DEPENDENCY_CSS);&nbsp;?&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;*/<br /><br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></td></tr></table></p>
<p>The somewhat crappy limitation here is that you have to instantiate your presentation layer objects before actually outputting the head portion of your code if you want the css includes to work properly. Thus far for me that really isn&#8217;t a deal breaker. </p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/using-php5-base-class-static-member-variables-to-encapsulate-presentation-layer-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 before 5.2.x and Debian Distro of FreeTDS causing Unparsable date strings</title>
		<link>http://www.justindeltener.com/php5-before-52x-and-debian-distro-of-freetds/</link>
		<comments>http://www.justindeltener.com/php5-before-52x-and-debian-distro-of-freetds/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 20:41:26 +0000</pubDate>
		<dc:creator>Justin Deltener</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.justindeltener.com/php5-before-52x-and-debian-distro-of-freetds/</guid>
		<description><![CDATA[<p>I finally nailed down a really odd date/time issue between PHP5 and FreeTDS.<br />
<!--more--></p>
<p>Ok I think this makes it official. I&#8217;ve seen the following issue on 2 boxes. The system works properly with PHP5.2.1 and the Debian Stable release of FreeTDS. When moving to PHP5.2.2 I was suddenly getting really odd Date errors. Loading objects from the database and pushing the values back to MSSQL would result in an invalid date format. Upon further inspection, I saw that the date was being pushed as &#8220;Sun Jun 4 10:34:23 2007&#8243;. Notice how the year is on the end instead of right after Jun 4. Very very odd.</p>
<p>The easy fix was to nab the latest version of FreeTDS .64 at the time of this posting, recompile PHP against it and install. Pretty crappy..</p>
]]></description>
		<wfw:commentRss>http://www.justindeltener.com/php5-before-52x-and-debian-distro-of-freetds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

