


function loadCalendar(url,month,year) {

	xmlhttp=null;

	if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc.

		xmlhttp=new XMLHttpRequest();

	} else if (window.ActiveXObject) {// code for IE6, IE5

		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

	}
  		
	if (xmlhttp!=null) {
	
		xmlhttp.onreadystatechange=state_Change;
	
		xmlhttp.open("GET",'/calendario/?month='+month+'&year='+year,true);
	
		xmlhttp.send(null);
  	
  	} else {
	
		alert("Tu navegador no soporta XMLHTTP.");
  	
  	}

}

function state_Change() {

	if (xmlhttp.readyState==4) { // 4 = "loaded"
	
		if (xmlhttp.status==200) { // 200 = "OK"
	    
	    	document.getElementById('calendar_container').innerHTML=xmlhttp.responseText;
	    
	  	} else {
	    
	    	alert("Erro interno " + xmlhttp.statusText);
		
		}
	
	}
	
}





function getChildNodesByType(type, parentNode) {

	var node = parentNode.firstChild;
	var nodes = new Array();

	while (node) {
	
		if (type == node.nodeType) {
	
			nodes.push(node);		
			
		}
	
		node = node.nextSibling;
	}

	return nodes;

}