function jah(url,target) {
    // native XMLHttpRequest object
//    document.getElementById(target).innerHTML = 'sending...';
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {jahDone(target);};
        req.open("GET", url, true);
        req.send(null);
    }
}    

function jahDone(target) {
    // only if req is "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            results = req.responseText;
            document.getElementById(target).innerHTML = results;
        } else {
            document.getElementById(target).innerHTML="jah error:\n" +
                req.statusText;
        }
    }
}

function getPage(url,target) {
  var xmlhttp = getXmlHttp()
  xmlhttp.open('GET', url, false);
  xmlhttp.send(null);
  if(xmlhttp.status == 200) {
    document.getElementById(target).innerHTML = xmlhttp.responseText;
    document.getElementById("ppp1").style.visibility="hidden";
    document.getElementById("ppp2").style.visibility = "hidden";
  }
}
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 CloseAllAnswers(cnt)
{
  for (var i=1; i<=cnt; i++)
  {
    elAnw = document.getElementById('question' + i);
    elAnw.className = "consult_question";

    
    elAnw = document.getElementById('answer' + i);
    elAnw.style.display = 'none';
    
    elAnw = document.getElementById("img_question" + i);
    elAnw.src = "images/close_q.gif";
    
    elAnw = document.getElementById("question_num" + i);
    elAnw.className = "consult_question_num";
  
  }
}

function SetVisibilityAnswers(elQuestion)
{
  CloseAllAnswers(3);
  elQuestion.className = "consult_question_active"
  var num = elQuestion.id.substr(elQuestion.id.length-1);
  var tst = 'answer' + num;
  
  var elAnw = document.getElementById(tst);
  elAnw.style.display = '';
  
  elAnw = document.getElementById("img_question" + num);
  elAnw.src = "images/open_q.gif";
  
  elAnw = document.getElementById("question_num" + num);
  elAnw.className = "consult_question_num_active";

}
function ShowCalendar(el_id) {
    var el = document.getElementById(el_id);
    var tst = '<table><tr>';
    var myDays = ["Ïí", "Âò", "Ñð", "×ò", "Ïò", "Ñá", "Âñ"]
    var i;
    var line = 0;
    var lineDay = 0;
    var classN = '';
    for (i = 0; i < 31; i++) {
        var value = '';
        if (line = 0) {
            value = myDays[i];
            classN = 'calendar_dayname';
        }
        lineDay++;
        if (lineDay == 7) {
            tst = tst + "</tr>"
            lineDay = 0;
            line++;
        }
        tst = tst + "<td>" + value + "</td>";
    }
    tst = tst + "</tr></table>";
    el.innerHTML = tst;
}

