// JavaScript Document
function zoom() {
	if (document.getElementById) {
		allLinks=document.getElementsByTagName('a');
		for (i=0;i<allLinks.length;i++) {
			if(allLinks[i].className=='imgZoom') {
				allLinks[i].onclick=function(){a_tags(this);return false}
			}
		}
	}
}
function a_tags(co) {
	imageURL=co.href;
	imageTitle=co.title;
	
	w_imgWin=300;
	h_imgWin=100;
	od_L=screen.availWidth/2-w_imgWin/2;
	od_G=screen.availHeight/2-h_imgWin/2;	
	imgWin=window.open('','','status=no,width='+w_imgWin+',height='+h_imgWin+',left='+od_L+',top='+od_G+',scrollbars=no,resizable=yes');
	imgWin.focus();

	with (imgWin.document){
		writeln(	'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
		writeln(	'<html><head><title>Penetron Polska</title>');

		writeln(	'<style type="text/css">body{margin:0;padding:0px;overflow:hidden; background-color:#CAD5E7}');
		writeln(	'img{border:0}');
		writeln(	'#obraz{visibility:hidden}\n #loader{padding:40px; color:black}');
		writeln(	'a{font:bold 12px arial;color:#fff};a:hover{color:#FFCC00}');
		writeln(	'table td,body{font:normal 12px arial;color:#fff; }');
		writeln(	'.tresc{padding:6px; background-color:#4F6284}');
		
		writeln(	'</style>');
		
		
		writeln(	'<scr'+'ipt type="text/javascript">');
		
		writeln(	'function reSizeToimage(){');
		writeln(		'resizeTo(300,300);');	
		writeln(		'if (window.outerHeight){');
		writeln(			'h=window.outerHeight-window.innerHeight');
		writeln(			'w=window.outerWidth-window.innerWidth');
		writeln(		'}')	
		writeln(		'if (document.body.clientHeight && !window.outerHeight){'); 
		writeln(			'h=300-document.body.clientHeight;');
		writeln(			'w=300-document.body.clientWidth;');
		writeln(		'}')
		writeln(		'window.resizeTo(document.images[0].width+w+20,document.images[0].height+h+50);');
		writeln(		'document.getElementById("obraz").style.visibility="visible";document.getElementById("loader").style.display="none";')
		writeln(	'};')
			
		writeln(	'function MoveWindow () {')			
		writeln(		'var imgW = document.images[0].width+40;');
	    writeln(		'var imgH = document.images[0].height+90;');
		writeln(		'window.moveBy(-((imgW-300)/2),-((imgH-100)/2));');
		writeln(	'};')	
		
		writeln(	'function init(){');
		writeln(		' MoveWindow(); reSizeToimage();window.focus();}');
//		writeln(	'window.onload=init');
		writeln(	'window.onload=setTimeout(init, 50)');
		
		writeln(	'</scr'+'ipt>');
		
		/***************BODY*******************************************/	
		writeln('</head><body>');
		writeln('<div id="loader">...Trwa ładowanie...</div>');
		writeln('<table width="100%" height="100%" cellspacing=0><tr><td valign="middle" align="center" colspan=2><img onClick="self.close()" title="zamknij" id="obraz" src="'+imageURL+'"></td></tr>');
		writeln('<tr><td class="tresc">'+imageTitle+'</td>');
		writeln('<td align=right class="tresc"><a href="javascript:void(0)" onClick="self.close()">zamknij</a></td>');
		writeln('</tr></table>');
		writeln('</body></html>');
		close();
	}	
}


