function getXmlHttp(){
  var xmlhttp;
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}

function getmon(year, mon){

var q = getXmlHttp();
q.open('POST', '/decs/calendar/ajax.php', false);
q.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
q.send("year="+year+"&mon="+mon);

if(q.status == 200){
document.getElementById("calendar").innerHTML = q.responseText;
}

}

function vote(qid,aid){

    if(window.confirm("Вы уверены в своем выборе?")){

var q = getXmlHttp();
q.open('POST', '/decs/poll/ajax.php', false);
q.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
q.send("qid="+qid+"&aid="+aid);

if(q.status == 200){
document.getElementById("poll").innerHTML = q.responseText;
}


    }

}
