function changeImg(tag, src){
tag.src= src;
return true;
}

function bigFoto(url,width,height) {          
var wind = window.open(url,"displayWindow",'width=' + width + ',height='+ height +',left=20,top=20,resizable=1,scrollbars=no,menubar=no');          
 wind.focus();          
}


function upsizedfoto(tyt,nazwa,szer,wys) {
config='left=100,top=100,width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
stadion=window.open('','',config)
stadion.document.write('<html><head>');
stadion.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
stadion.document.write('<title>'+tyt+'</title>');
stadion.document.write('<script language="javascript">');
stadion.document.write('setTimeout(');
stadion.document.write('"self.close()');
stadion.document.write(';",70000)');stadion.document.write('</');
stadion.document.write('script>');
stadion.document.write('</head>');
stadion.document.write('<body bgcolor=white leftmargin=0 topmargin=0 marginheight=0 marginwidth=0>');
stadion.document.write('<div align=center><a href=# onclick="javascript:self.close();"><img src='+nazwa+' border=0></a></div>');
stadion.document.write('</body></html>');
stadion.document.close();
stadion.focus();
}

function showBigImage(nazwa,tytul){
var tyt=tytul;
var szer='350'
var wys='350';
config='left=100,top=100,width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
stadion=window.open('','',config)
stadion.document.write('<html><head>');
stadion.document.write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8">');
stadion.document.write('<title>'+tyt+'</title>');
stadion.document.write('<script language="javascript">');
stadion.document.write('setTimeout(');
stadion.document.write('"self.close()');
stadion.document.write(';",70000)');stadion.document.write('</');
stadion.document.write('script>');


stadion.document.write('<script language="javascript" src="/fw/static/scripts/jquery.js">');
stadion.document.write('</');
stadion.document.write('script>');

stadion.document.write('<script language="javascript">');
stadion.document.write('function fitPic(){ if(window.innerWidth){ var iWidth = window.innerWidth; var iHeight = window.innerHeight; } else { var iWidth = document.body.clientWidth; var iHeight =document.body.clientHeight; } var iWidth = document.images[0].width - iWidth; var iHeight = document.images[0].height - iHeight; window.resizeBy(iWidth,iHeight);}');
stadion.document.write('</');
stadion.document.write('script>');

stadion.document.write('</head>');
stadion.document.write('<body bgcolor=white leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 onload="fitPic()">');
stadion.document.write('<div align=center><a href=# onclick="javascript:self.close();"><img src='+nazwa+' border=0></a></div>');



stadion.document.write('</body></html>');
stadion.document.close();
stadion.focus();
}



function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

function buildTable(tabl,arr){
var toAdd="<tr>";
for(i=0;i<=arr.length;i=i+6){

	if((i%30==0)&&(i!=0)){
	
	toAdd=toAdd+"</tr><tr>";
	for(j=i-30;j<i;j=j+6){
	toAdd=toAdd+"<td><a href=\""+arr[(j+3)]+"\" title=\""+arr[(j+4)]+"\" >"+arr[(j+5)]+"</a>"+"</td>";
	}
	
	if(i!=arr.length){
	toAdd=toAdd+"</tr><tr>";
	}

	}
	if(i!=arr.length){
	toAdd=toAdd+"<td><a href=\""+arr[(i+0)]+"\"/><img src=\""+arr[(i+2)]+"\" alt=\""+arr[(i+1)]+"\" ></td>";
	  }
	}
	
		
	i=i-6;
	if(i%30!=0){
	toAdd=toAdd+"</tr><tr>";
	for(j=i-(i%30);j<i;j=j+6){
	toAdd=toAdd+"<td><a href=\""+arr[(j+3)]+"\" title=\""+arr[(j+4)]+"\" >"+arr[(j+5)]+"</a>"+"</td>";
	}
	}
	
	toAdd=toAdd+"</tr>";
	
	
tabl.innerHTML=toAdd;

	
}

window.onload = externalLinks;




