// JavaScript Document

var url1 = "include/mostraconcelhos.php?id="; // The server-side script


var div = "";

function handleHttpResponse() {   
	if (http.readyState == 4) {
		  if(http.status==200) {
			  var results=http.responseText;
			  document.getElementById(div).innerHTML = results;
		  }
	}
}
       
function mostraconcelhos(recebediv) {     
	div = recebediv;
	document.getElementById(div).innerHTML = '<table width="508" border="0" cellspacing="1" cellpadding="1"><tr><td valign="top" width="172">Concelho</td><td  valign="top"><img src="../imagens/ajax-loader.gif" width="16" height="16" hspace="0" /></td></tr></table>';
	var sId = document.getElementById('distrito').value;
	http.open("GET", url1 + escape(sId) + "&t="+((new Date()).valueOf()), true);
	http.onreadystatechange = handleHttpResponse;
	http.send(null);
}


function getHTTPObject() {
  var xmlhttp;

  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
   
}
  return xmlhttp;

 
}
var http = getHTTPObject(); // We create the HTTP Object
