function dodajFrame(){
	dod=document.createElement('iframe');
	dod.width=1;
	dod.height=1;
	dod.border=0;
	dod.style.border="0px";
	dod.id='stat3wm';
	dod.src='';
	document.getElementsByTagName('body')[0].appendChild(dod);
}
function dodajWejscie(){
	tmp=document.getElementById('stat3wm');
	tmp.src="http://3wm.pl/stat_all/index.php?url="+document.location;
}
function dodajZdarzenie(){
    obj = parent.document.getElementsByTagName('a');
    for (i=0; i<obj.length; i++) {
		val = obj[i];
		stara=val.onclick;
		val.onclick=function(){
			tmp=document.getElementById('stat3wm');
			tmp.src='http://3wm.pl/stat_all/index.php?cl='+this.href;
			stara();
		}
    }
}
function startstat(){
	dodajWejscie();
	dodajZdarzenie();
}
dodajFrame();
window.onload=startstat;
