function CreateAjax(){ var xmlhttp; if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){ try { xmlhttp = new XMLHttpRequest(); } catch (e) { alert("Your browser is not supporting XMLHTTPRequest"); xmlhttp = false; } }else{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } return xmlhttp; } function CallServer(mthd,www,str,func){ request.open(mthd,www,true); if(mthd=='POST'){ request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset:UTF-8'); } request.onreadystatechange=function(){ if(request.readyState == 1){ func(0); AjaxLoading(true); } if(request.readyState == 4){ var answer = request.responseText; func(answer); AjaxLoading(false); } }; request.send(str); } var request = CreateAjax(); function AjaxLoading(bl){ var elm; if(document.getElementById('AjaxLoadingLbl')) { elm=document.getElementById('AjaxLoadingLbl'); } else { elm=document.createElement("span"); elm.id='AjaxLoadingLbl'; elm.style.position='absolute'; elm.style.background='#EEEEEE'; elm.style.color='black'; elm.style.padding='8px'; elm.innerHTML='ارتباط با مرکز ...'; document.body.appendChild(elm); } elm.style.top=0 + document.body.scrollTop; elm.style.left=screen.width/2 - 100 - document.body.scrollLeft; if(bl){ elm.style.display='block'; }else{ elm.style.display='none'; } }