// EXAMPLE USING pukAJAX, notice set process function line 22
//	/**
//	* should make this an extension of pukAJAX
//	*/
//	function callAjaxFromDragDrop ()
//	{
//		this.arguments = "";
//
// 		// process result
//		this.processYesNo = function (msg)
//		{
//			if (msg == "yes")
//			{
//				// how kind!!!
//				var amaj 	= new pukAJAX;
//				amaj.href 	= 'http';
//				amaj.arguments 	= this.arguments;
//				amaj.process 	= this.process;
//				amaj.get();
//
//			}
//		}
//
//		// processResult
//		this.process = function ()
//		{
//			alert("PROCESS RES:" + this.result);
//			// process the xml
//
//			// set status bar to not working on completion
//		}
//	}

	/**
	* pukAJAX class
	*
	* first real brush with ajax
	*/
	function pukAJAX ()
	{

		// the ajax target, eg http://www.park-uk.com/target.php
		this.href 			= '';
		this.urlargument 	= '';
		this.result 		= '';
		this.xmlhttp		= '';
		this.errorObject	= '';
		this.gotData 		= false;
		this.process		= null;

		/**
		* get()
		*/
		this.get = function ()
		{

			var self = this;

			var output = '';
			self.createXmlHttp();
			if (!self.xmlhttp)
			{
				// error, dump
				//this.errorObject.dump();
			}
			else
			{
				// success on object creation, now lets call it
				var url = self.href + '?' + self.urlargument;
				
				// didnt work with this.xmlhttp? couldnt seem to access the parent
				//xmlhttp = this.xmlhttp;
				self.xmlhttp.open("GET", url, true);
				self.xmlhttp.onreadystatechange = function ()
				{
					self.setResult(self);
				}

				self.xmlhttp.send(null);
				return self.xmlhttp;

			}

		}

		/**
		* waits until ready to set the result
		*/
		this.setResult = function(self)
		{
			if (this.xmlhttp.readyState == 4)
			{
				self.gotData 	= true;
				self.result		= this.xmlhttp.responseText;

				// process using custom processor
				if (!(typeof self.process == 'undefined' || self.process == null))
				{
    				self.process();
    			}

			}
		}


		this.createXmlHttp = function ()
		{

			/** go through and try and create the http request object **/

			var xmlhttp	=	false;

			/*@cc_on @*/
			/*@if (@_jscript_version >= 5)
			// JScript gives us Conditional compilation, we can cope with old IE versions.
			// and security blocked creation of the objects.
			try
			{
				this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (E)
				{
					this.xmlhttp = false;
				}
			}
			@end @*/

			if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
			{
				try
				{
					this.xmlhttp = new XMLHttpRequest();
				}
				catch (e)
				{
					this.xmlhttp	= false;
				}
			}

			if (!xmlhttp && window.createRequest)
			{
				try
				{
					this.xmlhttp = window.createRequest();
				}
				catch (e)
				{
					this.xmlhttp	= false;
				}
			}

			if (!this.xmlhttp)
				this.errorObject = e;

		}

	}