function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {}
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
   try { return new XMLHttpRequest();          } catch(e) {}
   alert("XMLHttpRequest not supported");
   return null;
};
function ajax(src, file) {
var contaner = document.getElementById(src);
contaner.innerHTML = '<div style="position:fixed; top:50%; left:50%; width:48px; height:48px; background: url(images/loading.gif) no-repeat;"></div>';
    var req = Inint_AJAX();
    req.onreadystatechange = function () { 
         if (req.readyState==4) {
              if (req.status==200) {
                   document.getElementById(src).innerHTML=req.responseText;
              } 
         }
    };
    req.open("GET", file);
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
	req.send(null);
}
function calendar(year, month) {
link = !year||!month?"calendar.php":"calendar.php?year="+year+"&month="+month;
ajax('calendar', link);
}
function country(src, val){
link="city.php?data="+src+"&val="+val;
ajax(src,link);
}
function cal_link(y,m,d){
link="dynamic_time.php?year="+y+"&month="+m+"&day="+d;
ajax('prayer', link);
}
function month(year, month) {
link = !year||!month?"dynamic_month.php":"dynamic_month.php?year="+year+"&month="+month;
ajax('month', link);
}
