// Get the HTTP Object

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. You cannot use these arrows to navigate through the calendar.  Please try visiting our Events section.");
      return null;
   }
}   
 
// FOR SIDEBAR

// Change the value of the outputText field

function setOutputside(){
    if(httpObject.readyState == 4){
        document.getElementById('calsidebar').innerHTML = httpObject.responseText;
    }
 
}
 
// Implement business logic    

function gotoMonthside(month){    
    httpObject = getHTTPObject();
    if (httpObject != null) {
        httpObject.open("GET", "page.php?pageid=9&month="
                        +month, true);
        httpObject.send(null); 
        httpObject.onreadystatechange = setOutputside;
    }
}

// FOR FULL PAGE

// Change the value of the outputText field

function setOutputfull(){
    if(httpObject.readyState == 4){
        document.getElementById('calfullpage').innerHTML = httpObject.responseText;
    }
 
}
 
// Implement business logic    

function gotoMonthfull(month){    
    httpObject = getHTTPObject();
    if (httpObject != null) {
        httpObject.open("GET", "page.php?pageid=10&month="
                        +month, true);
        httpObject.send(null); 
        httpObject.onreadystatechange = setOutputfull;
    }
}
 
var httpObject = null;
