ImageOpen = function()
{
    var Win = null;
    var Width = 600;
    var Height = 450;
    
    function url(url)
    {
        var html = '<html><head><title></title><style>body{margin:0;padding:0;}</style></head><body onclick="window.close();">' 
	             + '<table width="100%" height="' + Height + '">' 
	             + '<tr><td align="center" valign="middle"><img src="' + url + '" id="img"></td></tr>' 
	             + '</table></body></html>';
	             
        Win = window.open(
    		'',
            'image_open',
            'resizable=no,scrollbars=yes,location=no,status=yes,width=' + (Width) + ',height=' + (Height) + ',toolbar=0'
        );
        Win.document.write(html);
	    Win.document.close();
	    Win.document.getElementById('img').onload = resizeWin;
	    Win.focus();	
    }

    function resizeWin(img)
	{
	    var img = Win.document.getElementById('img');
        Win.resizeTo(img.clientWidth + 15, img.clientHeight + 60);
	}
	
    return {
        url: url
    }
}();
