/*@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') {
//	
//  var xmlhttp = new XMLHttpRequest();
//}
if( typeof XMLHttpRequest == "undefined" ){
	
	XMLHttpRequest = function(){
		
	  try{ return new ActiveXObject("Msxml2.XMLHTTP.6.0") }catch(e){}
	  try{ return new ActiveXObject("Msxml2.XMLHTTP.3.0") }catch(e){}
	  try{ return new ActiveXObject("Msxml2.XMLHTTP") }catch(e){}
	  try{ return new ActiveXObject("Microsoft.XMLHTTP") }catch(e){}
	  throw new Error("This browser does not support XMLHttpRequest or XMLHTTP.")
	}
	;
}

var xmlhttp = new XMLHttpRequest();

function ShowPic(img){
	
	xmlhttp.open('POST', "update_picture.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "img=" + img;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}		
	
	document.getElementById("show_pic").innerHTML = xmlResponse;	
	document.getElementById("show_pic").className = "vis";
}




function show_events(event) {
	
	document.getElementById('event_div').style.display = "block";
	document.getElementById('event_here').innerHTML = "<img src='admin/img/loading.gif' border='0'>";
	var xmlhttpTRUE = new XMLHttpRequest();
		
	xmlhttpTRUE.onreadystatechange = 
	function () {
		
		if( xmlhttpTRUE.readyState == 4 ){
			
			var xmlResponse = xmlhttpTRUE.responseText;	
			document.getElementById('event_here').innerHTML = xmlResponse;	
			
			//getMouseXY;
			//var StyleTop = getMouseX();
			//var StyleLeft = getMouseY();
			//alert(StyleTop + "-" + StyleLeft);
			//var StyleTop = 400;
			//document.getElementById("event_div").style.top = StyleTop + "px";
			//document.getElementById("event_div").style.left = StyleLeft + "px";
		}
	};	
	
	xmlhttpTRUE.open('POST', "show_events.php", true);
	xmlhttpTRUE.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	sendString = "event=" + event;
	
	xmlhttpTRUE.send(sendString);
}