var ajaxRetries=0; var privateCategory; var AJAX_SERVICE_URL = "AjaxServer.aspx"; var AJAX_MAX_RETRIES=3; /* Is Session Provider Locked */ function isProviderLocked() { var queryString=Object.toQueryString({ webMethodName : 'IsProviderLocked', systemID : SystemID, id : escape(document.getElementById("key").value), tryAttempt: ajaxRetries }); var ajax = new Ajax(CBPWebServiceUrl, { method: 'post', onComplete: function(resp) { HandleSessionProviderLocked(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { isProviderLocked(); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } /* Get County List with just state JSON */ function PopulateCountyList(st, category) { privateCategory=category; var queryString=Object.toQueryString({webMethodName: "GetCountiesByStateJSON", systemID: SystemID, stateCode:escape(st), category : escape(category), tryAttempt: 1 }); var ajax = new Ajax(CBPWebServiceUrl, { method: 'post', onComplete: function(resp) { FillCountyDropdown(null,resp,null); }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { PopulateCountry(document.getElementById(ClientID + "stateselect").value, privateCategory); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } /* Get City List with just state JSON */ function PopulateCityListByState(stateValue, category) { privateCategory=category; var queryString=Object.toQueryString({webMethodName: "GetCitiesByStateJSON", systemID: SystemID, stateCode:escape(stateValue), category : escape(category), tryAttempt: 1 }); var ajax = new Ajax(CBPWebServiceUrl, { method: 'post', onComplete: function(resp) { FillCityDropdown(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { PopulateCityListByState(document.getElementById(ClientID + "stateselect").value, privateCategory); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } /* Get State Options */ function GetStateOptions() { var queryString=Object.toQueryString({ webMethodName : 'GetStateContent', systemID : SystemID, state_code : escape( document.getElementById(ClientID + "stateselect").value ), tryAttempt: 1 }); var ajax = new Ajax(VBPWebServiceUrl, { method: 'post', onComplete: function(resp) { ApplyStateContent(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { GetStateOptions(); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } /* Get County List with state and city JSON */ function PopulateCountyListWithStateCity(state,city, category) { privateCategory=category; var queryString=Object.toQueryString({webMethodName: "GetCountyWithCityStateJSON", systemID: SystemID, stateCode:escape(state), city : city, category : escape(category), tryAttempt: 1 }); var ajax = new Ajax(CBPWebServiceUrl, { method: 'post', onComplete: function(resp) { FillCountyDropdown(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { PopulateCountyListWithStateCity( document.getElementById(ClientID + "stateselect").value , document.getElementById(ClientID + "cityselect").value , privateCategory ); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } /* Get City List with state and county JSON */ function PopulateCityListByStateAndCounty(stateValue,countyValue,category) { privateCategory=category; var queryString=Object.toQueryString({webMethodName: "GetCitiesByCountyJSON", systemID: SystemID, stateCode:stateValue, county : countyValue, category : escape(category), tryAttempt: 1 }); var ajax = new Ajax(CBPWebServiceUrl, { method: 'post', onComplete: function(resp) { FillCityDropdown(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { PopulateCityListByStateAndCounty( document.getElementById(ClientID + "stateselect").value , document.getElementById(ClientID + "countyselect").value , privateCategory ); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } /* Get Reasons by Provider ID and by Location */ function PopulateReasonsByProviderID() { var queryString=Object.toQueryString({webMethodName: "GetReasonListForProvider", systemID: SystemID, docType : escape( getSelectedCertValue() ), providerID : document.getElementById("ProviderID").value , eventDate : escape( document.getElementById(ClientID + "eventyear").value + "-" + document.getElementById(ClientID + "eventmonth").value + "-" + document.getElementById(ClientID + "eventday").value ), tryAttempt: 1}); var ajax = new Ajax(VBPWebServiceUrl, { method: 'post', onComplete: function(resp) { FillReasonDropDown(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { PopulateReasonsByProviderID(); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } function PopulateReasonsByLocation() { var stateAgencyOnly = "0"; //Bug 9212 var UnknownChecked = false; var elem = document.getElementById('chkUnknownLocation'); if (elem != null) { UnknownChecked = elem.checked; } if (document.aspnetForm.namechangecheck.checked || UnknownChecked == true) //End 9212 { stateAgencyOnly = "1"; } else { stateAgencyOnly = "0"; } var queryString=Object.toQueryString({ webMethodName : 'GetReasonListForLocation', systemID : SystemID, docType : escape( getSelectedCertValue() ), state : document.getElementById(ClientID + "stateselect").value , city : document.getElementById(ClientID + "cityselect").value , county : document.getElementById(ClientID + "countyselect").value , eventDate : escape( document.getElementById(ClientID + "eventyear").value + "-" + document.getElementById(ClientID + "eventmonth").value + "-" + document.getElementById(ClientID + "eventday").value ), stateAgencyOnly : stateAgencyOnly, tryAttempt: 1 }); var ajax = new Ajax(VBPWebServiceUrl, { method: 'post', onComplete: function(resp) { FillReasonDropDown(null,resp,null); }, onCancel: function() { }, onFailure: function() { ajaxRetries++; if (ajaxRetries<3) { PopulateReasonsByLocation(); } else { window.alert(AJAX_ERROR_MSG); } } }).request(queryString); } function ChatClick(pageName) { var queryString=Object.toQueryString({data : 'chat_click',page: pageName, tryAttempt: ajaxRetries}); var ajax = new Ajax(AJAX_SERVICE_URL, { method: 'post', onComplete: function(resp) {}, onCancel: function() {}, onFailure: function() { ajaxRetries++; if (ajaxRetries<=AJAX_MAX_RETRIES) { ChatClick(pageName); } else { showErrorPopup(); } } }).request(queryString); }