if(this._cometd.connected){ return; } 
if(this._cometd._polling){ return; } 
dojox.cometd.longPollTransport = new function(){	this._cometd=null;	this.lastTimestamp = null;	this.check = function(types, version, xdomain){		return ((!xdomain)&&(dojo.indexOf(types, "long-polling") >= 0));	}	this.tunnelInit = function(){		if(this._cometd.connected){ return; }		// FIXME: open up the connection here		this.openTunnelWith({			message: dojo.toJson([				{					channel:	"/meta/connect",					clientId:	this._cometd.clientId,					connectionType: "long-polling",					id:		this._cometd.messageId++				}			])		});	}	this.tunnelCollapse = function(){		if(!this._cometd.connected){			// try to restart the tunnel			this._cometd.connected = false;			// TODO handle transport specific advice			if(this._cometd["advice"]){				if(this._cometd.advice["reconnect"]=="none"){					return;				}				if(	(this._cometd.advice["interval"])&&					(this._cometd.advice.interval>0) ){					var transport = this;					setTimeout(function(){ transport._connect(); },						this._cometd.advice.interval);				}else{					this._connect();				}			}else{				this._connect();			}		}	}	this._connect = function(){		if(	(this._cometd["advice"])&&			(this._cometd.advice["reconnect"]=="handshake")		){			this._cometd.init(null,this._cometd.url); 		}else if(this._cometd.initialized){			this.openTunnelWith({				message: dojo.toJson([					{						channel:	"/meta/connect",						connectionType: "long-polling",						clientId:	this._cometd.clientId,						timestamp:	this.lastTimestamp,						id:		this._cometd.messageId++					}				])			});		}	}	this.deliver = function(/*array*/ message){		// console.debug(message);		if(message["timestamp"]){			this.lastTimestamp = message.timestamp;		}	}	this.openTunnelWith = function(content, url){		// console.debug("openTunnelWith:", content, (url||cometd.url));		var d = dojo.xhrPost({			url: (url||this._cometd.url),			content: content,			handleAs: this._cometd.handleAs,			load: dojo.hitch(this, function(data){				// console.debug(evt.responseText);				// console.debug(data);				this._cometd.connected = false;				this._cometd.deliver(data);				this.tunnelCollapse();			}),			error: function(err){				console.debug("tunnel opening failed:", err);				dojo.cometd.connected = false;				// TODO - follow advice to reconnect or rehandshake?			}		});		this._cometd.connected = true;	}	this.sendMessages = function(messages){		for(var i=0; i<messages.length; i++){			messages[i].clientId = this._cometd.clientId;			messages[i].id = this._cometd.messageId++;		}		return dojo.xhrPost({			url: this._cometd.url||djConfig["cometdRoot"],			handleAs: this._cometd.handleAs,			load: dojo.hitch(this._cometd, "deliver"),			content: {				message: dojo.toJson(messages)			}		});	}	this.startup = function(handshakeData){		if(this._cometd.initialized){ return; }		this.tunnelInit();	}	this.disconnect = function(){		if(!this._cometd.initialized){ return; }		dojo.xhrPost({			url: this._cometd.url||djConfig["cometdRoot"],			handleAs: this._cometd.handleAs,			content: {				message: dojo.toJson([{					channel:	"/meta/disconnect",					clientId:	this._cometd.clientId,					id:		this._cometd.messageId++				}])			}		});		this._cometd.initialized=false;	}}
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/cc204486907533a1a55d8dd5e73f9d3e25e2d0b1/cometd.js/clean/_cometd/cometd.js