function ShowContent(smallpicturepath, imagecontainerdiv, e) {

if (!e) var e = window.event;
	
var largepicturepath =  smallpicturepath.replace("com_hotproperty/images/thb","com_hotproperty/images/std");
document['picpopup'].src = largepicturepath;
var imglarge = new Image();
imglarge.src = largepicturepath;
var imgsmall = new Image();
imgsmall.src = smallpicturepath;


//here we find the browser window size over here. Browser window size in pixels
        var x = 0;
        if (self.innerHeight)
        {
                x = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                x = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                x = document.body.clientWidth;
        }
		
        var y = 0;
        if (self.innerHeight)
        {
                y = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                y = document.documentElement.clientHeight;
        }
        else if (document.body)
        {
                y = document.body.clientHeight;
        }
		
//here we calculate the offsets left and top from the div relevant to the page
var curleft = curtop = 0;
obj = document.getElementById(imagecontainerdiv);
	
	if (obj.offsetParent) {
	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} 
	while (obj = obj.offsetParent);
	}


//alert( ' e.clientY: ' +  e.clientY);




//Here we calculate horizontal picture location depending on what pictures we working with at the moment: left or right pictures.
if(curleft<x/2)
{
curleft = curleft + imgsmall.width/2 + 30;
}
else
{
curleft = curleft - imglarge.width + imgsmall.width/2;
}


//Here we calculate vertical picture offset from thumbnail.If picture in upper part of the screen - it aligns down and vice versa.
if(e.clientY < y/2)
{
curtop = curtop  + imgsmall.height/2;
}
else
{
curtop = curtop - imglarge.height + imgsmall.height/2;
}



//test code
//alert('window size y: ' + y + 'offsettop: ' + document.getElementById(imagecontainerdiv).offsetHeight );
//alert (img.height + '-img.height   img.width -' + img.width);
//alert(curleft + '-left  top -' + curtop);

document.getElementById('largepicdiv').style.top = curtop + 'px';
document.getElementById('largepicdiv').style.left = curleft + 'px';
document.getElementById('largepicdiv').style.display = 'block';
}


function HideContent() {
document.getElementById('largepicdiv').style.display = 'none';
}



