﻿var xmlhttp;
function CreateXmlHttp()
{
    if(window.ActiveXObject)
    {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    if(window.XMLHttpRequest)
    {
      xmlhttp=new XMLHttpRequest();
    }
}

function StateChange()
{
     if(xmlhttp.readystate==4&&xmlhttp.status==200)
     {
       if(xmlhttp.responseText!=""&&xmlhttp.responseText!=null)
       {
          document.getElementById("divContent").innerHTML=xmlhttp.responseText;
       }
       else
       {
          document.getElementById("divContent").innerHTML="無相關信息,請點選另一個月！";
       }
       
     }
}

function RequsetXmlHttp(date)
{
  CreateXmlHttp();
  
  document.getElementById("divContent").innerHTML="正加載數據......";
  
  xmlhttp.onreadystatechange=StateChange;
  
  xmlhttp.open("get","AjaxService.aspx?ADate="+date,true);
  
  xmlhttp.send();
}

function BindImg(url)
{
  document.getElementById("imgNum").src=RequsetXmlHttp(url);
}
