/*
Komennot:

Näytä:
showGraph('layerinID', this);

Piilota:
hideGraph('layerinID');


*/

function sniffBrowsers() {
	
}

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function showGraph(tipId, openElement){
	var curElement = document.getElementById(tipId);
	if (openElement != undefined){
		curElement.style.display='block';
		liftObj = curElement.offsetHeight;
		var xLoc = findPosX(openElement) +"px";
		var yLoc = (findPosY(openElement) - liftObj) +"px";
		
		curElement.style.left = xLoc;
		curElement.style.top = yLoc;
	}	
}

function hideGraph(tipId){
	document.getElementById(tipId).style.display='none';
}


function getBodyHeight()
{
    var x,y;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
    return y;
	
}


//-->
