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

function popupMedia(url,width,height) {
	winheight = parseFloat(height) + 30;
	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:white; margin:0px; padding:0px;">\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('</td>\n</tr>\n</table>\n</body>\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();
}



function popup(url,w,h) {
  window.open(url, "", "height=" + h + ",width=" + w + ",scrollbars=1, menubar=0, screenX=120, left=100, screenY=20, top=10, resizable=0, status=0, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0");
}

