// the general server interaction method - uses Ajax to call the server with // the 'target' request... function callServer(target, handlerMethod) { req = getXMLHttpRequest(); // get the test document; will populate the headers as well:-) req.onreadystatechange = handlerMethod; req.open("GET", target, true); req.send(null); } // generic handling method; calls a page-specific javascript method when ready... function handleProcessing() { if (req.readyState==4) { var doc_val = req.responseText; // this is defined once for each page that uses Ajax, to handle it's // special case(s) handleAjaxResults(doc_val); } } function emptyAjaxHandler() { } // the XMLHttpRequest object... var req; // IE and FF don't much like each other... function getXMLHttpRequest() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } // sends a logout request to the server, then closes the current window (if opened by javascript, anyway) function logout() { // send Logout var logout_call = 'http://www1.subimo.com/ca/app/bcbslacore/CoverageAdvisor?Action=Logout'; callServer(logout_call, emptyAjaxHandler) }