// JScript File

var msETSHandle =  null;
ETSService.prototype = new Ajax();

function ETSService() {
	this.method = "POST"; 
	this.headerName = "Content-Type";
	this.headerValue = "application/x-www-form-urlencoded; charset=UTF-8";
	this.content = ""; 
    this.url="";
	this.registry = new Array();
	msETSHandle = this;
}
ETSService.prototype.handleflagETS = function() {
       
	    if(msETSHandle.xmlHttp.readyState == 4) {
	    if(msETSHandle.xmlHttp.responseXML!=null)
		    msETSHandle.registry[0](msETSHandle.xmlHttp.responseXML, msETSHandle.xmlHttp.status == 200);
		
		msETSHandle.registry[0] = null;
	}
}


ETSService.prototype.flagETS = function(xml,callback) {
    this.registry[0] = callback;
    this.content = "sEtsEventXml=" + xml ;
    
//     var wl = document.URL
//	    var sUrl = "http://break.com";
//	    sUrl = (wl.indexOf('http')!=-1)?wl.substring(0,wl.indexOf('.com') + 4):sUrl;
	   // this.url=sUrl + "/CMSWebETSAPI.asmx/SubmitETSEventXML";
	   this.url="/WebAPI/InvokeCMS/CMSWebETSAPI/SubmitETSEventXML";
	    
	    
   // this.url="http://localhost/DNet.WebService.CMS/CMSWebETSAPI.asmx/SubmitETSEventXML";
   
    this.send(this.method, this.url, this.headerName, this.headerValue, null, null, this.content,this.handleflagETS);

   
}

 function ETSResponse(response, isOk){}
 function SendETSRequest(sXml){
       var oETSService = new ETSService();
       oETSService.flagETS(sXml,ETSResponse);
	}
