function createQCObject() { 
   var req; 
   if(window.XMLHttpRequest){ 
      // Firefox, Safari, Opera... 
      req = new XMLHttpRequest(); 
   } else if(window.ActiveXObject) { 
      // Internet Explorer 5+ 
      req = new ActiveXObject("Microsoft.XMLHTTP"); 
   } else { 
      alert('Problem creating the XMLHttpRequest object'); 
   } 
   return req; 
} 

// Make the XMLHttpRequest object 
var http = createQCObject(); 

function displayQCalendar(m,y) {
	var tokForQs = "";
	var qs = window.location.href.split('?')[1];
	if (qs) {
		var arrQs = qs.split('&');
		var tokCat, tokMcat; 
		for (x in arrQs) {		
			if (arrQs[x].split('=')[0] == "mcat") {
				tokMcat = arrQs[x];
			} else if (arrQs[x].split('=')[0] == "cat") {
				tokCat = arrQs[x];
			}
		}
		if (tokCat != "" && tokMcat != "") {
			tokForQs = tokCat + "&" + tokMcat + "&";
		}
	}
	var ran_no=(Math.round((Math.random()*9999))); 
	http.open('get', '/_NewSite/include/Calendario.php?'+tokForQs+'m='+m+'&y='+y+'&ran='+ran_no);
   	http.onreadystatechange = function() {
		if(http.readyState == 4 && http.status == 200) { 
      		var response = http.responseText;
      		if(response) { 
				document.getElementById("quickCalender").innerHTML = http.responseText; 
      		} 
   		} 
	} 
   	http.send(null); 
}

