// 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 popPicWin(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>Cedarbrook Sauna and Steam</title>' + 
'<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' +
'<script language = "javascript">' +
'var winClock = null;' +
'clearTimeout(winClock);' +
'var pad = 120;' +
'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(750, 750);' +
'	width = 750 - (document.documentElement.clientWidth -  document.images[0].width) + pad;' +
'	height = 750 - (document.documentElement.clientHeight -  document.images[0].height) + pad;' +
'	window.resizeTo(width, height);' +
'	}' +
'	else if (document.body)' +
'	{' +
'	window.resizeTo(750, 750);' +
'	width = 750 - (document.body.clientWidth -  document.images[0].width);' +
'	height = 750 - (document.body.clientHeight -  document.images[0].height) + pad;' +
'	window.resizeTo(width, height);' +
'	}' +
'winClock = window.setTimeout(\"window.close()\",12000);' +
'}' +

'function handleError() {' +
'	return true;' +
'}' +

'picWin.onerror = handleError;' +
'</script>' +
'<link rel="stylesheet" href="/cart/skin1/skin1.css" type="text/css">' +		
'</head>' + 
'<body bgcolor="#ffffff" marginheight="0" marginwidth="0" text="#000000" leftmargin="0" topmargin="0" onload="javascript:fitWindowSize();"><center>');

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

if (txt != null) {
	picWin.document.write(''+
'<div style="width:inherit;">'+
'<div align="center" style="padding:5px;"><span class="TopLabel">'+txt+'</span>' +
'</div>');
}

picWin.document.write('' +
//'<div style="position:absolute; top:10; left:10; z-index:1;"><a href="javascript:window.close();"><img src="images/logo/popup_logo.gif" width="152" height="126" border="0"></a></div>' +

'<table width="100%"  border="0" cellspacing="0" cellpadding="5">' +
  '<tr>' +
    '<td align="left"><p><b>Cedarbrook Sauna &amp; Steam</b>' +
	'<br>(800) 426-3929 / (425) 481-3333</p><a href="javascript:window.close();">Close Window</a><br><font size="1" color="gray">automatic&nbsp;in&nbsp;12&nbsp;seconds</font></td>' +
	'' +	
    '<td align="right"><a href="javascript:window.close();"><img src="/cart/skin1/images/cedarbrooksaunalumber_logo_popup.gif" width="103" height="48" border="0" hspace="15"></a></td>' +
  '</tr>' +
'</table>' +

//'<div style="background-color:#FFFFFF;position:absolute;top:10px;left:10px;border:solid 1px #D25709;"><a href="javascript:window.close();"><img src="/cart/skin1/images/cedarbrooksaunalumber_logo_popup.gif" width="103" height="48" border="0" hspace="15"></a><div>' +

'</center></body>' + 
'</html>');

if (window.focus) {picWin.focus();}

picWin.document.close();
}
