﻿
var infoWidth = 400;


function showInfo(sectionName){
    if (document.getElementById){
		    document.getElementById("presentationInfo").innerHTML = document.getElementById(sectionName).innerHTML;
		    document.getElementById("presentationInfo").style.display = 'block';
		    document.onmousemove = newXY;
    }
}

function hideInfo(){
    document.getElementById("presentationInfo").style.display = 'none';
    document.onmousemove = "";
}


function newXY(e){
    if (document.getElementById){
	    var posx = 0;
	    var posy = 0;
	
	    if (!e) e = window.event;
	    if (e.clientX || e.clientY){
		    posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		    posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	        
		    document.getElementById("presentationInfo").style.top  =  ((posy+20).toString() + "px");
		    
		    
		    if ((e.clientX + infoWidth + 35) < pageWidth()){
		        document.getElementById("presentationInfo").style.left  =  ((posx+10).toString() + "px");
		    }else{
		        document.getElementById("presentationInfo").style.left  =  ((posx-(infoWidth+10)).toString() + "px");
		    }			    
		    
		   
	    }
    }
}

function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;}

function pageHeight() {return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;}


