// JavaScript Written By Marc Castles MCWeb - version 1
// You can change the background color below

function popupMedia(url,width,height) {
	winheight = parseFloat(height) + 40;
	winwidth =  parseFloat(width) + 30;

	newWin=window.open('', 'popupwin','resizable=0,HEIGHT='+winheight+',WIDTH='+winwidth+', scrollbars=0', true);
	newWin.document.write('<html>\n');
	newWin.document.write('<head>\n');
	newWin.document.write('<title>Image</title>');
	newWin.document.write('<script language="javascript" type="text/javascript">\n<!--\n');
	newWin.document.write('var arrTemp=self.location.href.split("?");\n');
	newWin.document.write('var picUrl = (arrTemp.length>1)?arrTemp[1]:"";\n');
	newWin.document.write('var NS = (navigator.appName=="Netscape")?true:false;\n');
	newWin.document.write('function fitMedia() {\n');
	newWin.document.write('	iWidth = (NS)?window.innerWidth:document.body.clientWidth;\n');
	newWin.document.write('	iHeight = (NS)?window.innerHeight:document.body.clientHeight;\n');
	newWin.document.write('	iWidth = '+winwidth+' - iWidth;\n');
	newWin.document.write('	iHeight = '+winheight+' - iHeight;\n');
	newWin.document.write('	window.resizeBy(iWidth, iHeight);\n');
	newWin.document.write('	var posLeft = (window.screen.width - '+winwidth+')/2;\n');
	newWin.document.write('	window.moveTo(posLeft,80);\n');
	newWin.document.write('};\n');
	newWin.document.write('-->\n</script>\n');

	newWin.document.write('<style>html,body{height:100%;padding:0px;}</style>\n');
	newWin.document.write('</head>\n');
	newWin.document.write('<body style="background-color:#555555; margin:0px; padding:8px;">\n');
	newWin.document.write('<table border=0 style="height:100%; width:100%; text-align:center;"><tr><td>\n');
	newWin.document.write('<img src="'+url+'" width="'+width+'" height="'+height+'" alt="" />');
	newWin.document.write('\n<div align="center"><a href="javascript:window.close()">');
	newWin.document.write('<img src="http://cacoastinfo.com/images/icon_closeWindow.gif" width="86" height="18" border="0"></a></div>');
	newWin.document.write('</td>\n</tr>\n</table></body>');
	newWin.document.write('\n<script language="javascript" type="text/javascript">\n<!--\n');
	newWin.document.write('fitMedia();\n');
	newWin.document.write('-->\n</script>\n');	
	newWin.document.write('</html>');
	newWin.document.close()
	newWin.focus();
}
