﻿function GetXmlHttpObject(handler){var objXmlHttp=null;if(!window.XMLHttpRequest){objXmlHttp=GetMSXmlHttp();if(objXmlHttp!=null){objXmlHttp.onreadystatechange=handler}}else{objXmlHttp=new XMLHttpRequest();if(objXmlHttp!=null){objXmlHttp.onload=handler;objXmlHttp.onerror=handler;try{objXmlHttp.onreadystatechange=handler}catch(e){}}}return objXmlHttp}function GetMSXmlHttp(){var xmlHttp=null;var clsids=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP.2.6","Microsoft.XMLHTTP.1.0","Microsoft.XMLHTTP.1","Microsoft.XMLHTTP"];for(var i=0;i<clsids.length&&xmlHttp==null;i++){xmlHttp=CreateXmlHttp(clsids[i])}return xmlHttp}function CreateXmlHttp(clsid){var xmlHttp=null;try{xmlHttp=new ActiveXObject(clsid);lastclsid=clsid;return xmlHttp}catch(e){}}function SendXmlHttpRequest(xmlhttp,url){xmlhttp.open('GET',url,true);xmlhttp.send(null)}var xmlHttp;var callBackHandler;var callBackHandler2;var callBackHandlerLogout;var callBackHandlerMail;var callBackHandlerMail2;var callBackHandlerFlightGroupMail;function ExecuteAjaxCall(url){try{url=url+"&n="+Math.floor(Math.random()*5);xmlHttp=GetXmlHttpObject(CallbackMethod);SendXmlHttpRequest(xmlHttp,url)}catch(e){}}function ExecuteAjaxCall2(url){try{url=url+"&n="+Math.floor(Math.random()*5);xmlHttp=GetXmlHttpObject(CallbackMethod2);SendXmlHttpRequest(xmlHttp,url)}catch(e){}}function ExecuteAjaxCallLogout(url){try{url=url+"&n="+Math.floor(Math.random()*5);xmlHttp=GetXmlHttpObject(CallbackMethodLogout);SendXmlHttpRequest(xmlHttp,url)}catch(e){}}function ExecuteAjaxCallMail(url){try{url=url+"&n="+Math.floor(Math.random()*5);xmlHttp=GetXmlHttpObject(CallbackMethodMail);SendXmlHttpRequest(xmlHttp,url)}catch(e){}}function ExecuteAjaxCallMail2(url){try{url=url+"&n="+Math.floor(Math.random()*5);xmlHttp=GetXmlHttpObject(CallbackMethodMail2);SendXmlHttpRequest(xmlHttp,url)}catch(e){}}function ExecuteAjaxCallFlightGroupMail(url){try{url=url+"&n="+Math.floor(Math.random()*5);xmlHttp=GetXmlHttpObject(CallbackMethodFlightGroupMail);SendXmlHttpRequest(xmlHttp,url)}catch(e){}}function CallbackMethod(){try{if(callBackHandler){if(xmlHttp.readyState==4||xmlHttp.readyState=='complete'){var response=xmlHttp.responseText;if(response.length>0){callBackHandler(1,response)}else{callBackHandler(0,'Errore nell\'invio dei dati ...')}}else{callBackHandler(0,' ')}}}catch(e){}}function CallbackMethod2(){try{if(callBackHandler2){if(xmlHttp.readyState==4||xmlHttp.readyState=='complete'){var response=xmlHttp.responseText;if(response.length>0){callBackHandler2(1,response)}else{callBackHandler2(0,'Errore nell\'invio dei dati ...')}}else{}}}catch(e){}}function CallbackMethodLogout(){try{if(callBackHandlerLogout){if(xmlHttp.readyState==4||xmlHttp.readyState=='complete'){var response=xmlHttp.responseText;if(response.length>0){callBackHandlerLogout(1,response)}else{callBackHandlerLogout(0,'Errore nell\'invio dei dati ...')}}else{}}}catch(e){}}function CallbackMethodMail(){try{if(callBackHandlerMail){if(xmlHttp.readyState==4||xmlHttp.readyState=='complete'){var response=xmlHttp.responseText;if(response.length>0){callBackHandlerMail(1,response)}else{callBackHandlerMail(0,'Errore nell\'invio dei dati ...')}}else{}}}catch(e){}}function CallbackMethodMail2(){try{if(callBackHandlerMail2){if(xmlHttp.readyState==4||xmlHttp.readyState=='complete'){var response=xmlHttp.responseText;if(response.length>0){callBackHandlerMail2(1,response)}else{callBackHandlerMail2(0,'Errore nell\'invio dei dati ...')}}else{}}}catch(e){}}function CallbackMethodFlightGroupMail(){try{if(callBackHandlerFlightGroupMail){if(xmlHttp.readyState==4||xmlHttp.readyState=='complete'){var response=xmlHttp.responseText;if(response.length>0){callBackHandlerFlightGroupMail(1,response)}else{callBackHandlerFlightGroupMail(0,'Errore nell\'invio dei dati...')}}else{}}}catch(e){}}function SetCallBackHandler(handler){callBackHandler=handler}function SetCallBackHandler2(handler){callBackHandler2=handler}function SetCallBackHandlerLogout(handler){callBackHandlerLogout=handler}function SetCallBackHandlerMail(handler){callBackHandlerMail=handler}function SetCallBackHandlerMail2(handler){callBackHandlerMail2=handler}function SetCallBackHandlerFlightGroupMail(handler){callBackHandlerFlightGroupMail=handler}
