// refer to http://www.quirksmode.org/js/croswin.html

var picWin = '';

function fPicWin(pic,txt) {

	popPicWin(pic,txt);
	if (!picWin.opener) picWin.opener = self;
		
	if (window.focus) {picWin.focus()}
	//return true;
}

function fPicWin(pic,txt) {

picWin=open('','picwin','toolbar=no,resizable=yes,scrollbars=no,width=410,height=471,top=100,left=300');

picWin.document.write('' +
'<html>' + 
'<head>' + 
'<title>Whole Pet Vet</title>' + 
'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' +
'<script language = "javascript">' +
'var winClock = null;' +
'clearTimeout(winClock);' +
'var pad = 75;' +
'function fitWindowSize() {' +
'	if (self.innerHeight) ' +
'	{' +
'	window.innerWidth = document.images[0].width;' +
'	window.innerHeight = document.images[0].height + pad;' +
'	}' +
'	else if (document.documentElement && document.documentElement.clientHeight)' +
'	{' +
'	window.resizeTo(500, 500);' +
'	width = 500 - (document.documentElement.clientWidth -  document.images[0].width);' +
'	height = 500 - (document.documentElement.clientHeight -  document.images[0].height) + pad;' +
'	window.resizeTo(width, height);' +
'	}' +
'	else if (document.body)' +
'	{' +
'	window.resizeTo(500, 500);' +
'	width = 500 - (document.body.clientWidth -  document.images[0].width);' +
'	height = 500 - (document.body.clientHeight -  document.images[0].height) + pad;' +
'	window.resizeTo(width, height);' +
'	}' +
'winClock = window.setTimeout(\"window.close()\",10000);' +
'}' +
'</script>' +
'<link rel="stylesheet" href="css/ie_styles.css" type="text/css">' +		
'</head>' + 
'<body bgcolor="#A0A061" marginheight="0" marginwidth="0" text="#000000" leftmargin="0" topmargin="0" onload="javascript:fitWindowSize()">');

picWin.document.write('<img src="' + pic + '">');

if (txt != null) {
	picWin.document.write(''+
'<div style="width:inherit;">'+
'<div align="center" style="padding:5px;"><span class="picCaption">'+txt+'</span>' +
'<div align="right" style="padding:15px;"><a href="javascript:window.close();" class="small">Close Window</a></div>'+
'</div>');
}

picWin.document.write('' +
'<div style="position:absolute; top:10; left:10; z-index:20;"><a href="javascript:window.close();"><img src="images/logo/small_logo.jpg" width="35" height="43" border="0"></a></div>' +
'</body>' + 
'</html>');

picWin.document.close();		
}