function getHTTPObject(){
if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
else if (window.XMLHttpRequest) return new XMLHttpRequest();
else {
alert("Your browser does not support AJAX.");
return null;
}
}


function setOutput(){
if(httpObject.readyState == 4){
document.getElementById('calendar').innerHTML = httpObject.responseText;
}

}

function setall(month,year)
{document.getElementById('caltype').value=0;
showmonth(month,year);
}

function setfishing(month,year)
{document.getElementById('caltype').value=1;
showmonth(month,year);
}

function setdiving(month,year)
{document.getElementById('caltype').value=2;
showmonth(month,year);
}

function setother(month,year)
{document.getElementById('caltype').value=3;
showmonth(month,year);
}

function showmonth(month,year){
var typetrip=document.getElementById('caltype').value;
httpObject = getHTTPObject();
if (httpObject != null) {
httpObject.open("GET", "calendar_paint.php?queryMonth=" + month + "&queryYear=" + year + "&queryType=" + typetrip + "&ms="+ new Date().getTime(), true);
                httpObject.send(null); 
                httpObject.onreadystatechange = setOutput;
                }
                }


var httpObject = null;

