function killMyBox(){
	boxskn=document.getElementById("boxCSS");
	boxskn.style.display="none";
	boxskn.style.visibility="hidden";
}
function showProfile(event, pID) {
	boxskn=document.getElementById("boxCSS");
	var xmlhttp = GetXmlHttpObject();
	var url="http://crimson-veil.com/includes/ajax/profileQView.php";
	url=url+"?pID="+pID;
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		boxskn.style.visibility='visible';
		boxskn.style.display='inline';
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			if (window.event) {
				x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
				if((x+500) > screen.availWidth) {
					x = x - ((x + 500) - screen.availWidth) - 25;
				}
				boxskn.style.top = x + 'px';
    			boxskn.style.left = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop + 'px';
			} else {
				x = event.pageX;
				if((x+500) > screen.availWidth) {
					x = x - ((x + 500) - screen.availWidth) - 25;
				}
				boxskn.style.top=event.pageY + 'px';
				boxskn.style.left=x + 'px';
			}
			boxskn.innerHTML=xmlhttp.responseText;
		} else {
			boxskn.innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
		}
	}
	xmlhttp.send(null);
}
function showEntityStatsQV(event, entityType, entityID) {
	boxskn=document.getElementById("boxCSS");
	var xmlhttp = GetXmlHttpObject();
	var url="http://crimson-veil.com/includes/ajax/statsQView.php";
	url=url+"?eType="+parseInt(entityType);
	url=url+"&eID="+parseInt(entityID);
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		boxskn.style.visibility='visible';
		boxskn.style.display='inline';
		if (window.event) {
				x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
				if((x+500) > screen.availWidth) {
					x = x - ((x + 500) - screen.availWidth) - 25;
				}
				boxskn.style.left = x + 'px';
    			y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
    			h = document.getElementById("siteDisplay").offsetHeight;
    			if((y+350) > h) {
    				y = y - 300;
    			}
    			boxskn.style.top = y + 'px';
			} else {
				x = event.pageX;
				if((x+500) > screen.availWidth) {
					x = x - ((x + 500) - screen.availWidth) - 25;
				}
				h = document.getElementById("siteDisplay").offsetHeight;
				y = event.pageY;
				if((y+350) > h) {
					y = y - 375;
				}
				boxskn.style.top=y + 'px';
				boxskn.style.left=x + 'px';
			}
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			boxskn.innerHTML=xmlhttp.responseText;
		} else {
			boxskn.innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
		}
	}
	xmlhttp.send(null);
}
function GetXmlHttpObject() {
	try{
		// Opera 8.0+, Firefox, Safari
		return new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
}
