/* Print Ads Popup
 * This creates a popup window that resizes itself to the 
 * image's dimensions
 * WH/rcd 21ème avril 2007
 */

// This is where the popup will load
PositionX = 50;
PositionY = 50;

// This is just to get the current date
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()

// Determine the browser they are using
if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

// This is our main function
function popLargerImage(imageURL,imageTitle,pageWidth,pageHeight){
	if (isNN){imgWin=window.open('about:blank','','scrollbars=auto,width='+pageWidth+',height='+pageHeight+',left='+PositionX+',top='+PositionY);
	}
	if (isIE){imgWin=window.open('about:blank','','scrollbars=auto,width='+pageWidth+',height='+pageHeight+',left='+PositionX+',top='+PositionY);
	}
	with (imgWin.document){
		writeln('<html>\n<head>\n<title>Tobacco Free California</title>\n');
		writeln('<style>');
		writeln('body {\nmargin-top:0px;\nmargin-bottom:5px;\nmargin-left:0px;\nmargin-right:5px;\nbackground-color:#FEFEF4;\n}');
		writeln('</style>');
		writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n');
		writeln('<meta name="Author" content="WH/rcd '+currentTime+'">\n');
		writeln('<sc'+'ript language="JavaScript" type="text/javascript">\n');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');	
		writeln('</sc'+'ript>');			
		writeln('</head>\n<body bgcolor="#FEFEF4" scroll="auto" onload="doTitle();self.focus()" onblur="self.close()">\n');
		writeln('<img src="_images/chew_gal_left.gif" alt="Tobacco Free California">');
		writeln('<br>');
		writeln('<img src="'+imageURL+'" hspace="10" alt="'+imageTitle+'" style="margin:auto;display:block;" />\n</body>\n</html>');		
	close();
	}
}