x = 20;
y = 70;

function hidePopup() {
    obj = document.getElementById('popupImage');
    obj.innerHTML = '';
    obj.style.visibility = 'hidden';    
}

function setVisible(url, width, height, closeIcoUrl) {
    obj = document.getElementById('popupImage');
    if(url != undefined && url != '')
    {
        var img = new Image();
        img.src = url;
	    obj.innerHTML = "<div style='position: absolute; left:" + eval(width-45) + "px;'><a href='#' onclick='hidePopup();'><img src='" + closeIcoUrl + "' border='0' /></a></div><br /><br />";
	    obj.innerHTML += "'<img src='" + url + "' border='0' />";
    }
    else
        obj.innerHTML = '';

    obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';    
    placeIt('popupImage', width, height);
}

function placeIt(obj, imgWidth, imgHeight) {
	obj = document.getElementById('popupImage');
	/*
	if (document.documentElement)
		theLeft = document.documentElement.scrollLeft;
	else if (document.body)
		theLeft = document.body.scrollLeft;
	else
		theLeft = window.innerWidth;
	*/
	var scrW = 0;
	var scrH = 0;
	//IE
	if(!window.innerWidth)
	{
		if(!(document.documentElement.clientWidth == 0))
			scrW = document.documentElement.clientWidth;
		else	//quirks mode
			scrW = document.body.clientWidth;
	}
	//w3c
	else
		scrW = window.innerWidth;

	var theLeft = Math.round(scrW / 2)-Math.round(imgWidth/2);
	obj.style.left = theLeft + 'px';
	obj.style.top = '50px';
}

function RollOver(imgName, imgStatus) {
    document.getElementById(imgName).src = eval(imgName + imgStatus + ".src");
}