//
// Cyningstan software showcase - Javascript support functions
// Copryight (C) Damian Walker 2010
//

// expand a screenshot
function expandScreen (imageFile, imageWidth, imageHeight) {
    var imageElement; // page element where picture will appear
    var xPos; // x position of image
    var yPos; // y position of image
    if (window.pageXOffset == undefined) {
	// fallback for old or non-standards-compliant browsers (like IE)
	window.location.href = imageFile;
	return (false);
    }
    xPos = window.pageXOffset + (window.innerWidth - imageWidth) / 2;
    yPos = window.pageYOffset + (window.innerHeight - imageHeight) / 2;
    imageElement = document.getElementById ('expandedscreen');
    imageElement.style.left = xPos;
    imageElement.style.top = yPos;
    imageElement.style.width = imageWidth;
    imageElement.style.height = imageHeight;
    imageElement.style.display = 'block';
    imageElement.innerHTML = '<IMG SRC="' + imageFile + '">';
    return(false);
}

