function getXMLHttp() {
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}

function event_detail(occID) {
	detail = document.getElementById('e_'+occID+'_d');
	if (!document.loading && !detail) {
		xmlhttp = getXMLHttp();
		document.getElementById('e_'+occID+'_i').src = "/g/loading.gif";
		document.loading = true;
		xmlhttp.onreadystatechange = function() {
			if (xmlhttp.readyState == 4 && xmlhttp.status) {
				details = document.createElement('div');
				details.setAttribute('id','e_'+occID+'_d');
				details.className = 'eventdetail';
				details.innerHTML = xmlhttp.responseText;
				document.getElementById('e_'+occID).appendChild(details);
				document.getElementById('e_'+occID+'_i').src = "/g/minus.gif";
				show_hide(occID);
				document.loading = false;
			}
		}
		xmlhttp.open("GET", 'event_details.php?id='+occID, true);
		xmlhttp.send(null);
	} else {
		show_hide(occID);
	}
}

function show_hide(occID) {
	detail = document.getElementById('e_'+occID+'_d');
	if (detail) {
		if (detail.style.display=='block') {
			document.getElementById('e_'+occID+'_i').src = "/g/plus.gif";
			document.getElementById('e_'+occID+'_t').style.display = "block";
			detail.style.display = 'none';
		} else {
			document.getElementById('e_'+occID+'_i').src = "/g/minus.gif";
			document.getElementById('e_'+occID+'_t').style.display = "none";
			detail.style.display = 'block';
		}
	}
}