//Shows on mouseover a box with text which is css styled
function showHint(id, obj, e)
{

		var oMyHint, x, y;

		oMyHint = document.getElementById( "nxpinboard_myHint"+id );

		var pObj = obj;
		x = y = 0;

	if (e.pageX || e.pageY)     {
		x = e.pageX;
		y = e.pageY;
	}
	else if (e.clientX || e.clientY)    {
		x = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		y = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}

	oMyHint.style.display = "block";
	// Position of the block
	oMyHint.style.top = (y - 260) + "px";
	oMyHint.style.left = (x - 110) + "px";

};

// Hides on mouseout the box
function hideHint(id)
{
	var oMyHint;
	oMyHint = document.getElementById( "nxpinboard_myHint"+id );
	oMyHint.style.display = "none";
};

// Changes the z-index of the postit you clicked on so it will be in the front
function changeZindex(id){

	var numberOfPostits = document.getElementsByName('nxpinboard_showpostit').length;
	var highestZindex = 0;

	// Gets the highest z-index
	for(i = 0; i < numberOfPostits; i++){
		if(parseInt(document.getElementsByName('nxpinboard_showpostit')[i].style.zIndex) > parseInt(highestZindex) && document.getElementsByName('nxpinboard_showpostit')[i].style.zIndex != ''){
			highestZindex = parseInt(document.getElementsByName('nxpinboard_showpostit')[i].style.zIndex);
		}
		if(parseInt(document.getElementsByName('nxpinboard_pin')[i].style.zIndex) > parseInt(highestZindex) && document.getElementsByName('nxpinboard_pin')[i].style.zIndex != ''){
			highestZindex = parseInt(document.getElementsByName('nxpinboard_pin')[i].style.zIndex)-1;
		}
	}

	// Sets the new z-index so the postit that was clicked on will be in the front
	document.getElementById('nxpinboard_myPostit'+parseInt(id)).style.zIndex = parseInt(highestZindex)+5;
	document.getElementById('nxpinboard_pin_'+parseInt(id)).style.zIndex = parseInt(highestZindex)+6;

}
