function getHTTPObject(){try{if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Msxml2.XMLHTTP")}else{throw ("XMLHttpRequest not supported")}}}catch(a){throw"Ajax.getHTTPObject(): "+a}}function is_ajax_error(b,a){if(b.getElementsByTagName("error").length>0){if(b.getElementsByTagName("validation").length>0){alert(b.getElementsByTagName("validation")[0].firstChild.nodeValue)}else{if(top._GENERIC_GIS_UTILS){top._GENERIC_GIS_UTILS.open_new_window(_ERROR_PAGE_URL+"?message="+b.getElementsByTagName("error")[0].firstChild.nodeValue,500,300,false,false)}else{alert("Error: "+b.getElementsByTagName("error")[0].firstChild.nodeValue)}}return true}return false}function process_ajax_call(f,a,b){try{var c=getHTTPObject();c.open("POST",a,true);c.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");c.onreadystatechange=function(){if(c.readyState==4){if(c.status==200){if(!c.responseXML){alert(_MSG_SESSION_EXPIRED);if(top.document.getElementById("module_name")){if(top.document.getElementById("module_name").value=="map-visio"){top.window.location.href=_URL_MAP_VISIO;return}}top.window.location.href=_HOST;return}if(!is_ajax_error(c.responseXML,this)){b.call(c,false)}else{b.call(c,true)}}else{alert("Errore ajax connesione: "+c.responseText)}}};c.send(f)}catch(d){throw"Ajax.process_ajax_call(): "+d}}function process_ajax_sync_call(f,a,b){try{var c=getHTTPObject();c.open("POST",a,false);c.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");c.send(f);if(c.readyState==4){if(c.status==200){if(!is_ajax_error(c.responseXML,this)){b.call(c,false)}else{b.call(c,true)}}else{alert("Errore ajax connesione: "+c.responseText)}}else{alert("Errore ajax connesione: "+c.responseText)}}catch(d){throw"Ajax.process_ajax_sync_call(): "+d}}function execut_map_ajax_call(c,a){try{loading_message(true);process_ajax_call(c,a,function(d){if(!d){reset_extra_graphics(_ALL_DRAWING_ENGINES);reload_map("type=map&action=load")}else{loading_message(false)}})}catch(b){throw"Ajax.execut_map_ajax_call(): "+b}};
