function ajaxCommentsFunction(type, id, postnew) {
	var xmlHttp;
	var data;
	var navn;
	var kommentar;
	try {
  	// Firefox, Opera 8.0+, Safari
  	xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
  	// Internet Explorer
  	try {
    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
  	catch (e) {
    	try {
      	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    	catch (e) {
      	alert("Your browser does not support AJAX!");
      	return false;
			}
    }
  }
  xmlHttp.onreadystatechange=function() {
  	if(xmlHttp.readyState==4) {
      var ele = document.getElementById("Comments");
      if (ele) {
      	ele.innerHTML=xmlHttp.responseText;
      }
      if (postnew) {
      	document.getElementById("navn").value="";
  			document.getElementById("kommentar").value="";
      }
		}
  }
  xmlHttp.open("POST",htmlroot+username+"/"+travelname+"/imagecomments",true);
  xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
  data = "type="+type+"&ref_id="+id;
  if (postnew) {
  	navn=document.getElementById("navn").value;
  	kommentar=document.getElementById("kommentar").value;
  	data += "&create=nospam&navn="+navn+"&kommentar="+kommentar;

  }
  xmlHttp.send(data);
}



