	/**
	 * Class authenticatedJsonProxy; allows for fairly secure cross-domain javascript-remoting 
	 * 
	 * @author Ivo Toby, ivo@i-v-o.nl www.i-v-o.nl
	 * @version 0.01a
	 * @requires authenticatedJsonProxy.php, JsonProxy.js,  Prototype.js by Sam Stephenson (http://www.prototypejs.org/) and Scriptaculous (http://script.aculo.us/) by Thomas Fuchs and a fairly decent browser 
	 * @constructor initialize
	 * 
	 * THIS CLASS IS GPL, see licence.txt .
	 */

	 var authenticatedJsonProxy = Class.create(jsonProxy, {
	 	debug:false,
	 	initialize: function($super, uri){
	 		$super(uri);
	 	},
	 	
	 	doRequest : function(callBack){
	 		this.callBack = callBack;
	 		// create a node that requests authorization from authenticatedJsonProxy.php
	 		var authReq = new jsonProxy(this.uri);
	 		authReq.set('authenticate', this.instID);
	 		authReq.doRequest(this.doAuthenticatedRequest.bind(this)); 
	 	},
	 	
	 	doAuthenticatedRequest : function(obj){
	 		var serial = obj.serial;
	 		this.set('serial', serial);
	 		this._doRequest();// do the request from superclass jsonProxy
	 	} 
	 })