var customWindow;

function openImage(imageSRC, width, height, alt) {

    if (customWindow == null || customWindow.closed) {
	  
	  var left = parseInt(screen.availWidth - width) /  2;
	  var top = parseInt(screen.availHeight - height) / 2;
	  
      var windowFeatures = "width=" + parseInt(width) + ", height=" + parseInt(height) + 
        ",status, no-resizable, left=" + left + ", top=" + top + 
        ", screenX=" + left + ", screenY=" + top;
    
        customWindow = window.open("", "myImagePopup", windowFeatures);
        createDocument(imageSRC, width, height, alt);
    } 
    else {
        customWindow.focus( );
    }

}

function createDocument(imageSRC, width, height, alt) {
	var style = "<link rel=\"stylesheet\" href=\"Style.css\">";
	
	var newContent = "<html><head>" + style + "<title>" + alt + "</title></head>";
    newContent += "<body>";
    newContent += "<img src=\"" + imageSRC + "\" width=\"" + width + "\" height=\"" + height + "\""
				 + " alt=\"" + alt + "\" title=\"" + alt + "\" id=\"popup\" onmousedown=\"javascript:window.close();\">";
    newContent += "</body></html>";

    customWindow.document.write(newContent);
    customWindow.document.close( );
}


function Close()
{
	window.close();
}

function information() {
	var infoBox = document.getElementById("infoBox");
	
	var boxContent = "<img src=\"Components/Exit.png\" id=\"exit\" onclick=\"Javascript:hideInfo();\"><br><br>" 
					+ "Drawings By: Thomas Moore<br>Website Designed By: John Moore";
	infoBox.innerHTML = boxContent;
	
	infoBox.style.display = "inline";	
	infoBox.style.top = 10;
	infoBox.style.left = 230;
	infoBox.style.position = "ABSOLUTE";
	
}

function hideInfo() {	
	var blanket = document.getElementById("blanket");
	blanket.style.display = "none";	
	var letter = document.getElementById("letter");
	letter.style.display = "none";	
}