this.init = function(  /*String*/       root, /*Object|null */ props, /*Object|null */ bargs){ 
this.init = function(	/*String*/	root, /*Object|null */ props, /*Object|null */ bargs){ 
	this.init = function(  /*String*/       root, 			       /*Object|null */ props, 			       /*Object|null */ bargs){	// return: dojo.Deferred      		//	summary:		//		Initialize the cometd implementation of the Bayeux protocol		//	description:		//		Initialize the cometd implementation of the Bayeux protocol by		//		sending a handshake message. The cometd state will be changed to CONNECTING		//		until a handshake response is received and the first successful connect message		//		has returned.		//		The protocol state changes may be monitored		//		by subscribing to the dojo topic "/cometd/meta" where events are		//		published in the form {cometd:this,action:"handshake",successful:true,state:this.state()}		//	root:		//		The URL of the cometd server. If the root is absolute, the host		//		is examined to determine if xd transport is needed. Otherwise the		//		same domain is assumed. 		//	props:		//		An optional object that is used as the basis of the handshake message		//	bargs:		//		An optional object of bind args mixed in with the send of the handshake		//	example:		//	|       dojox.cometd.init("/cometd");		//	|       dojox.cometd.init("http://xdHost/cometd",{ext:{user:"fred",pwd:"secret"}});		// FIXME: if the root isn't from the same host, we should automatically		// try to select an XD-capable transport		props = props||{};		// go ask the short bus server what we can support		props.version = this.version;		props.minimumVersion = this.minimumVersion;		props.channel = "/meta/handshake";		props.id = ""+this.messageId++;		this.url = root||djConfig["cometdRoot"];		if(!this.url){			console.debug("no cometd root specified in djConfig and no root passed");			return;		}		// Are we x-domain? borrowed from dojo.uri.Uri in lieu of fixed host and port properties		var regexp = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";		var r = (""+window.location).match(new RegExp(regexp));		if(r[4]){			var tmp = r[4].split(":");			var thisHost = tmp[0];			var thisPort = tmp[1]||"80"; // FIXME: match 443			r = this.url.match(new RegExp(regexp));			if(r[4]){				tmp = r[4].split(":");				var urlHost = tmp[0];				var urlPort = tmp[1]||"80";				this._isXD = ((urlHost != thisHost)||(urlPort != thisPort));			}		}		if(!this._isXD){			if(props.ext){				if(props.ext["json-comment-filtered"]!==true && props.ext["json-comment-filtered"]!==false){					props.ext["json-comment-filtered"] = true;				}			}else{				props.ext = { "json-comment-filtered": true };			}		} 		var bindArgs = {			url: this.url,			handleAs: this.handleAs,			content: { "message": dojo.toJson([props]) },			load: dojo.hitch(this,function(msg){				this._finishInit(msg);			}),			error: dojo.hitch(this,function(e){				console.debug("handshake error!:",e);				this._finishInit([{}]);			})		};		if(bargs){			dojo.mixin(bindArgs, bargs);		}		this._props=props;		for (var tname in this._subscriptions){		    for (var sub in this._subscriptions[tname]) {			if (this._subscriptions[tname][sub].topic)			    dojo.unsubscribe(this._subscriptions[tname][sub].topic);		    }		}		this._subscriptions = [];		this._initialized=true;		this.batch=0;		this.startBatch();				var r;		// if xdomain, then we assume jsonp for handshake		if(this._isXD){		    bindArgs.callbackParamName="jsonp";		    r= dojo.io.script.get(bindArgs);		} else		    r = dojo.xhrPost(bindArgs);		dojo.publish("/cometd/meta", [{cometd:this,action:"handshake",successful:true,state:this.state()}]);		return r;	}
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/c5d4597e2dcaa3b9ca02e49b6818d5a152bf8ef8/cometd.js/buggy/_cometd/cometd.js