function setPostMenu(id){
    var el=null;
    for(var i=1;i<4;i++){
        if(el=document.getElementById('postTab'+i)){
            if(i==id){
                document.getElementById('postTab'+i).style.borderColor='#FFFFFF';
            }else{
                document.getElementById('postTab'+i).style.borderColor='#CFCFCF';
            }
        }
    }
}
function sendMail(user){
    var appName=document.getElementById('appName').value;
    var appPhone=document.getElementById('appPhone').value;
    var appMail=document.getElementById('appMail').value;
    var eduMail=document.getElementById('eduMail').value;
    var appCity=document.getElementById('appCity').value;
    var appEduProg=document.getElementById('appEduProg').value;
    ahah('index.php#userData='+user+'&act=sendApp&appName='+appName+'&appPhone='+appPhone+'&appMail='+appMail+'&eduMail='+eduMail+'&appCity='+appCity+'&appEduProg='+appEduProg,'postAppB',2);
}
function ahah(url,target,showType){
    document.body.style.cursor = 'wait';
    var el=document.getElementById(target);
    if(target=='onSiteBoxCnt')setOnSiteBox();
    if(showType==1)setOpacity(el,5);
    url=url.replace("#","?rnd="+Math.random()+"&");
    el.innerHTML = 'loading data...';
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = function() {ahahDone(el,showType);};
        req.open("GET", url, true);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = function() {ahahDone(el,showType);};
            req.open("GET", url, true);
            req.send();
        }
    }
}
function ahahDone(el,showType) {
   // only if req is "loaded"
   if (req.readyState == 4) {
       // only if "OK"
       if (req.status == 200 || req.status == 304) {
           results = req.responseText;
           if(showType==1){
            putInPreBox(results,el);
           }else{
            el.innerHTML = results;
           }
           document.body.style.cursor = 'default';
           execJS(el);
       } else {
           el.innerHTML="ahah error:\n" + req.statusText;
       }
   }
}
var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
var bMoz = (navigator.appName == 'Netscape');
function execJS(node) {
  var st = node.getElementsByTagName('SCRIPT');
  var strExec;
  for(var i=0;i<st.length; i++) {     
    if (bSaf) {
      strExec = st[i].innerHTML;
    }
    else if (bOpera) {
      strExec = st[i].text;
    }
    else if (bMoz) {
      strExec = st[i].textContent;
    }
    else {
      strExec = st[i].text;
    }
    try {
      eval(strExec.split("<!--").join("").split("-->").join(""));
    } catch(e) {
      alert(e);
    }
  }
}