//request variable
var xmlhttp_cal_request;
//request problem message variable
var lang_problem_with_request = "Request Problem!";
//cal folder
var f = "./eventmanager/"

//image preload
if (document.images){loading_image = new Image(22,22); loading_image.src=f+"images/25.gif";}


function get_cal(year, month)
{
//calebdar
var url = f+"get_cal.php?cal_month="+month+"&cal_year="+year;

xmlhttp_cal_request =  get_xml_http_request_object();
//state change function
xmlhttp_cal_request.onreadystatechange = function() {get_cal_progress(xmlhttp_cal_request); };
//open channel
xmlhttp_cal_request.open('GET', url, true);
//send request      
xmlhttp_cal_request.send(null);
}


function  get_cal_progress(request)
{
var get_cal_content = "";

if (request.readyState == 4) {
// everything is good, the response is received
if (request.status == 200) {
get_cal_content = request.responseText;

} //close if status 200 block
else {get_cal_content = ''+lang_problem_with_request+' '+request.status;}
document.getElementById('mirical_cal_box').innerHTML = get_cal_content;

}//close if state 4
 else {document.getElementById('mirical_cal_box').innerHTML = "<div style='text-align: center; padding-top: 45px;'><img src='"+f+"images/25.gif'></div>"; 

}  // still not ready

} //close get_cal_progress


function p_ev(c_id)
{
document.getElementById('mirical_ev_container_'+(c_id)).style.visibility = "hidden";
document.getElementById('mirical_ev_container_'+(c_id-1)).style.visibility = "visible";

document.getElementById('mirical_ev_container_'+(c_id)).style.disabled = "true";
document.getElementById('mirical_ev_container_'+(c_id-1)).style.disabled = "false";
}

function n_ev(c_id)
{
document.getElementById('mirical_ev_container_'+(c_id)).style.visibility = "hidden";
document.getElementById('mirical_ev_container_'+(c_id+1)).style.visibility = "visible";

document.getElementById('mirical_ev_container_'+(c_id)).style.disabled = "true";
document.getElementById('mirical_ev_container_'+(c_id+1)).style.disabled = "false";
}

