if( !xhr.status ) { if( (xhr_error_ttl > 0) && !xhr.getAllResponseHeaders() ) {   xhr_error_ttl--;  register( id ); } 
if( !xhr.status && (xhr_error_ttl > 0) && !xhr.getAllResponseHeaders() ) {   xhr_error_ttl--;  register( id ); 
function start_servevt_ajax_proxy( key ) {   if( !hop_servevt_proxy.httpreq ) {      var xhr_error_ttl = 6 * 3;      var pending_events = 0;            var register = function( id ) {	 var svc = "/hop/server-event-register?event=" + id + "&key=" + key;	 var success = function( val, http ) {	    // erase previous errors	    xhr_error_ttl = 6 * 3;	    // re-register the event as soon as possible	    register( id );	    // invoke all the user handlers (we have received a list of values	    // corresponding to server buffer).	    while( val != null ) {	       hop_trigger_servevt( id, http.responseText, val.car, false );	       val = val.cdr;	       	    }	 }	 var failure = function( xhr ) {	    if( !xhr.status ) {	       if( (xhr_error_ttl > 0) && !xhr.getAllResponseHeaders() ) {		  // mark the connection timeout error in order to avoid		  // falling into an infinit loop when the server has crashed.		  xhr_error_ttl--;		  // we have reached a timeout, we just re-register		  register( id );	       }	    } else {	       hop_servevt_onclose();	       hop_trigger_servevt( id, "Ajax Server Event error", false, false );	    }	 }	 hop_servevt_proxy.httpreq = hop_send_request( svc,						       // asynchronous call						       false,						       // success callback						       success,						       // failure callback						       failure,						       // no anim						       false,						       // no environment						       [] );	 // raises the ready state when it exists pending events	 if( pending_events > 0 ) {	    if( pending_events == 1 ) {	       hop_trigger_serverready_event( new HopServerReadyEvent() );	    }	    pending_events--;	 }      }      var unregister = function( id ) {	 hop_servevt_proxy.httpreq.abort();	 	 var svc = "/hop/server-event-unregister?event=" + id	 + "&key=" + hop_servevt_proxy.key;	 	 hop_servevt_proxy.httpreq = hop_send_request( svc, false,						       function() { ; }, false,						       false, [] );      };      // complete the proxy definition      hop_servevt_proxy.register = register;      hop_servevt_proxy.unregister = unregister;      // count the number of pre-registered events      for( var p in hop_servevt_table ) {	 if( hop_servevt_table[ p ].hop_servevt ) {	    pending_events++;	 }      }      if( pending_events > 0 ) {	 for( var p in hop_servevt_table ) {	    if( hop_servevt_table[ p ].hop_servevt ) {	       register( p );	    }	 }      } else {	 hop_trigger_serverready_event( new HopServerReadyEvent() );      }   }}
4636	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4636/676ef819dd4d310a02620e9c46600d309dd79cfc/hop-event.js/clean/share/hop-event.js