var ypos = 0;

$(document).bind('mousemove',function(e) {
	ypos = e.pageY;
});

function popup(element) {
	//element = document.getElementById(element);
	
	//element.style.left = getMouse('x',event);
	
	$("#"+element).css('left',getX());
	$("#"+element).css('top',ypos);
	
	$("#"+element).show();
}

function popout(element) {
	$("#"+element).hide();
}

function getMouse(coord,e) {
	var posx = 0;
	var posy = 0;
	
	if (!e) var e = window.event;
	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 + 25;
	posy = posy - 100;
	if (coord == 'x') { return posx + "px"; }
	else { return posy + "px"; }
}

function getX() {
  myWidth = 0;
  myHeight = 0;
  if (typeof(window.innerWidth) == 'number') {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
	winWidth = window.width;
  }

  winMid = myWidth/2;
  myX = winMid + 125;
  return myX + "px";
}
