
if (document.captureEvents) document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = torch;

function torch(e) {

var t;
var bd=_gel('baseDiv');
var bdy=bd.offsetTop;
var bdx=bd.offsetLeft;
var pt="not_set";
if (!e) {
	var e=window.event;
}
if (e.target) {
	t=e.target;
} else if (e.srcElement) {
	t=e.srcElement;
}
if (t.nodeType==3) { 
	t = t.parentNode;
}
var ttn=t.tagName;
var tid = "no_id_present";
if (t.id) { 
	tid = t.id + '#0';
} else if (t.parentNode) {
	var i = 1;
	var ttmp = t;
	var noid = true;
	while (ttmp.parentNode && noid==true) {
		if (ttmp.id) {
			tid = ttmp.id + '#' + i;
			noid = false;
		} else {
			ttmp = ttmp.parentNode;
			i++;
		}
	}
}

var posx = 0;
var posy = 0;
if (e.pageX || e.pageY) 	{
	posx = e.pageX;
	posy = e.pageY;
}
else if (e.clientX || e.clientY) 	{
	posx = e.clientX + document.body.scrollLeft
		+ document.documentElement.scrollLeft;
	posy = e.clientY + document.body.scrollTop
		+ document.documentElement.scrollTop;
}

posx = posx - bdx;
posy = posy - bdy;

var pi = new Image();
var pd = '?event=torch&x=' + encodeURIComponent(posx) + '&y=' + encodeURIComponent(posy) + '&page=' + encodeURIComponent(yt.getConfig('SERVLET_NAME')) + '&pagetype=' + encodeURIComponent(pt) + '&elementtype=' + encodeURIComponent(ttn) + '&knownid=' + encodeURIComponent(tid) + '&url=' + encodeURIComponent(document.location);
pi.src = "/gen_204" + pd;
}
