// JavaScript Document UTF-8



function sh(obj) {
	var result = "";
	for (var i in obj)
		result += "." + i + " = " + obj[i] + "<br>\n";

	mo = document.getElementById("mm2");
	mo.innerHTML += result;

	}

var polecamyJS = {
	
	ini: function () {
		var el = document.getElementById('pol'),
		lista = el.getElementsByTagName('A'); // pętla po znalezionych elementach i wyświetlenie ich zawartości HTML
		for(i=0;i<lista.length;i++){
			lista[i].onclick = this.click;
			}
		},

	click: function(){

		try {
			var str = this.getAttribute('href');
			var re = /v=(\d+)/i;
			found = str.match(re);
			if (found==null){
				var re = /_id(\d+)/i;
				found = str.match(re);
				}
			tag = this.firstChild.tagName
			url = 'http://' + (window.location.host) + '/?'+u1+'=p&r='+PolecamyRodzaj+'&v='+(found[1]+'&tag='+tag);
			window.location=(url);
			return false;
		}

		catch(e){}
	},


	start: function () { 
		alert ('a')
		},
	
	koniec: function () { 
		alert ('bez przecinka na koc')
		}
		
	};

polecamyJS.ini();
