// Place the following line of code in the head of the page calling the script:
// <script type="text/javascript" SRC="scripts/popupviewer.js" language="JavaScript"></script>

// Place the following code in the body of the document at the location required for the popup
// window, substituting parameters inside {}.
// <a href="javascript:viewImg('{filename}',{width},{height})">{link text or img file}</a>

// This script requires a blank file named "viewer.html" and an images sub directory named "full-size"

// Function to create popup of fullsize image from thumbnail

function viewImg(image,w,h)
{
	var img = image;
	var path = "images/full-size/";
	var imgPath = path + img;
	var URL = "viewer.html";
	var winw = w;
	var winh = h;
	var winl = (screen.width - winw) / 2;
	var wint = (screen.height - winh) / 2;
	var winProps = 'width='+winw+',height='+winh+',top='+wint+',left='+winl+',menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no';
	var winPopUp = window.open(URL, '', winProps);
	winPopUp.document.write('<html>'+
    '<head>'+
    '<title>A J Fabrications Ltd</title>'+
    '<style type="text/css">'+
    'body {margin: 0px; top:0px; left:0px; }'+
    '</style>'+
    '</head>'+
    '<body>'+
    '<script type="text/javascript" SRC="scripts/popupviewer.js" language="JavaScript"></script>'+
    '<img src="'+imgPath+'" border="0" onMouseDown="javascript:winClose();">'+
    '</body>'+
    '</html>');
}

// Function to close property detail page

function winClose ()
{
	window.close();
}