var reportElem;
function showlayer(layerID) {
	var theDiv = document.getElementById(layerID);
if(theDiv.style.display=="none" || theDiv.style.display==""){
theDiv.style.display="block";
} else { 
theDiv.style.display="none";
}
theDiv.onmouseout = mouseOut;
return;
}

function mouseOut(evt) {
if(!evt || typeof(evt) == 'undefined') evt = window.event;
if(checkMouseOut(this,evt)) {
	var theDiv = document.getElementById('sm_1');
if(theDiv.style.display=="none" || theDiv.style.display==""){
theDiv.style.display="block";
} else { 
theDiv.style.display="none";
}
// alert("ok"+theDiv);
}
}

// Check whether the mouse has really left the element
function checkMouseOut(elem,evt) {
var boundaries = getBoundaries(elem);
if(evt.clientX <= boundaries.left || evt.clientX >= boundaries.right || evt.clientY <= boundaries.top || evt.clientY >= boundaries.bottom) return true;
else return false;
}

// Returns an object containing four properties - top, right, bottom, left - containing the co-ordinates of the four corners of the element
function getBoundaries(elem) {
var boundaries = getRealOffsets(elem);
boundaries.right = boundaries.left + elem.clientWidth;
boundaries.bottom = boundaries.top + elem.clientHeight;
return boundaries;
}

// Gets the absolute offsets of an element
function getRealOffsets(elem) {
var offsets = new Object();
offsets.left = elem.offsetLeft;
offsets.top = elem.offsetTop;
var parent = elem.offsetParent;
while(parent != document.body) {
offsets.left += parent.offsetLeft;
offsets.top += parent.offsetTop;
parent = parent.offsetParent;
}

return offsets;
}
