document.onclick = doSomething;

function popwin(cesta, nazov, width, height) 
	{
	WinFeatures = 'toolbar=no,scrollbars=yes,status=no,resizable=no,width='+width+',height='+height;
	ShowWindow = window.open(cesta,nazov,WinFeatures);
	}


function doSomething(e)
{
	

	//var targ;
	if (!e) var e = window.event;
	// e gives access to the event in all browsers
	
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug

	targ = targ.parentNode;

	//alert(targ.tagName); // porovnavat na A  funguje v IE, FF



		if (targ.parentNode.className == 'profil') 
		{

			riadok=targ.parentNode.href.split('?');

			nazov=riadok[1].split('&id_user=');
			nazov=nazov[1].split('&');
			nazovokna='id'+nazov[0];

			popwin ("http://www.hokejportal.sk/pages_user/profil.php?"+riadok[1],nazovokna,473,500);
		
			return false;


		}

		if (targ.parentNode.className == 'pro') 
		{

			riadok=targ.parentNode.href.split('?q=');

			nazov=riadok[1].split('/');

			nazovokna='id'+nazov[0];

			popwin ("http://www.hokejportal.sk/pages_user/profil.php?p=profil&id_user="+nazov[1]+"&username="+nazov[2],nazovokna,473,500);


		
		return false;


		}

		
		if (targ.parentNode.className == 'reply') 
		{

		pid	= targ.parentNode.id;
		outdform=dform.replace('{parent-id}',pid);
		targ.parentNode.className='reply2';
		targ.parentNode.innerHTML=outdform;

		
		return false;


		}
}
