var undefined;
var wunInfo;
var wunInfoContent;

var createwunInfoBox = function() {
	var tipDiv = document.createElement('div');
	
	tipDiv.id = "wunInfo";
	tipDiv.className = "wunInfoBottom";
	tipDiv.innerHTML = "<div class=\"wunInfoTop\"><div class=\"wunInfoContent\" id=\"wunInfoContent\">text</div></div>";
	
	document.body.appendChild(tipDiv);
}

var wunShowInfo = function(e, content) {
    if(document.getElementById('wunInfo') == undefined) {
        createwunInfoBox();
    }

	wunInfo = document.getElementById('wunInfo');
	wunInfoContent = document.getElementById('wunInfoContent');
	wunInfoContent.innerHTML = content;
			
	wunMoveInfo(e);
	
}

var wunHideInfo = function() {
	wunInfo.style.display = "none";
}

var wunMoveInfo = function(e) {
	if (wunInfo != undefined) {
		e = e || window.event;
		var cursor = {x:0, y:0};
		if (e.pageX || e.pageY) {
			cursor.x = e.pageX;
			cursor.y = e.pageY;
		}
	 	else {
			cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
			cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
		}
		
		
		//wunInfo.style.top = cursor.y + - 110 + "px";
		wunInfo.style.top = cursor.y - 15 + "px";
		wunInfo.style.left = cursor.x + 15 + "px";
		wunInfo.style.display = "block";
	}
}
