function ajaxinit(){
  var xmlHTTP=null;
  try{xmlHTTP=new XMLHttpRequest();}
  catch (e){try{xmlHTTP=new ActiveXObject("Msxml2.XMLHTTP");}
  catch (e){xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");}}
  return xmlHTTP;
}

function stateChanged(){
  if(xmlHTTP.readyState==4){
    if(typ==0){
      document.getElementById('commentvortex').innerHTML+=xmlHTTP.responseText;
      endcomment();
    }
    if(typ==1){
      document.getElementById('commentvortex').innerHTML=xmlHTTP.responseText;
    }
  }
  if(xmlHTTP.readyState==1 || xmlHTTP.readyState==2){
  }
}

function ajax(type,arg1,arg2){
  typ=type;
  if(typ==0){
    var frm=document.commentingform;
    var url='comment_add.php?id='+arg1+'&user='+frm.user.value+'&body='+frm.body.value+'&x='+fixPix(frm.x.value)+'&y='+fixPix(frm.y.value);
  }
  if(typ==1){
    var url='comment_load.php?id='+arg1+'&fade='+arg2;
  }
  xmlHTTP=ajaxinit();
  xmlHTTP.onreadystatechange=stateChanged;
  xmlHTTP.open("GET",url,true);
  xmlHTTP.send(null);
}