
function subscribe() {
for (i = 0; i < document.subscriber.agency.length; ++i)
if (document.subscriber.agency.options[i].selected == true)
id = document.subscriber.agency.options[i].value;
document.getElementById("subscribe-month").innerHTML = '<img src="/templates/default/style/img/loader.gif" />';
var url = "/xml/subscribe.php";
var params = "id=" + id;
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.onreadystatechange = handleServerResponseSubscirbe;
xmlHttp.send(params);
}
function handleServerResponseSubscirbe() 
{
  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
xmlResponse = xmlHttp.responseXML;
xmlRoot = xmlResponse.documentElement;  
value = xmlRoot.getElementsByTagName("value");
document.getElementById("subscribe-month").innerHTML = value.item(0).firstChild.data
} 
else {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}

