var showed=0;
var lf_showed=0;
function getBodyScrollTop(){
 return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
var X, Y;

function mouseXY(e)
{
  var x = 0, y = 0;

  if (!e) e = window.event;

  if (e.pageX || e.pageY)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else if (e.clientX || e.clientY)
  {
    x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
    y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
  }

  return {"x":x, "y":y};
}
document.onmousemove = function(e){var mCur = mouseXY(e); X= mCur.x; Y= mCur.y-220;}


function showInfo(id, text)
{
	text='<span style="padding-left: 350px;"><a href="#" onclick="showInfo('+id+',0); return false;">закрыть</a></span><p>'+text+'</p>';
	if(!showed)
	{
		sy = getBodyScrollTop()-0;
		$('#info_window').css({top:Y, left:(X-410)}).empty().fadeIn(400).append(text);
		showed=id;
	}
	else{
		$('#info_window').fadeOut(300);
		showed=0;
	}
}

function showLoginForm()
{
	if(!lf_showed)
	{
		$('#divlogin').css({top: (Y+230), left:(X+10)}).fadeIn(400);
		lf_showed=1;
	}
	else{
		$('#divlogin').fadeOut(300);
		lf_showed=0;
	}
}

