// Hide image div, do this on the poped up div other wise the div flickers
function hideImage(divid){
	document.getElementById(divid).style.visibility = 'hidden';
	return true;
}

function showhoverimage(y,divid){
	
	// Get cordnates for this item
	var x = findPos(y);

	// If to wide move left co-ord over a bit to fit it in
	if(x[0] > 600){
		x[0] = x[0] - 525;
	}
	
	// move the image up a bit so dosent drag off the bottom of the page
	x[1] = x[1] - 300;
	
	// Change the sytle attached to this div id to change the left and top attributes
	document.getElementById(divid).style.left = x[0] + "px";
   	document.getElementById(divid).style.top = x[1] + "px"; 
   	document.getElementById(divid).style.visibility = 'visible';	
   	return true;
}

function findPos(obj){
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
