var offset=5;function confinedDisplay(a,e){var c=document.getElementById(a);if(!e)return;e=e||window.event;var d={x:0,y:0};if(e.pageX||e.pageY){cursor_x=e.pageX;cursor_y=e.pageY}else{var f=document.documentElement;var b=document.body;cursor_x=e.clientX+(f.scrollLeft||b.scrollLeft)-(f.clientLeft||0);cursor_y=e.clientY+(f.scrollTop||b.scrollTop)-(f.clientTop||0)}screen_x=screen.availWidth;screen_y=screen.availHeight;scroll_x=document.documentElement.scrollLeft;scroll_y=document.documentElement.scrollTop;var g=c.offsetHeight;var h=c.offsetWidth;c.style.position="absolute";if(cursor_x-scroll_x>=screen_x-h*1.5)c.style.left=(cursor_x-h-offset)+"px";else c.style.left=(cursor_x+offset)+"px";if(cursor_y-scroll_y<=g)c.style.top=scroll_y+offset+"px";else if(cursor_y-scroll_y+g*2>=screen_y)c.style.top=(cursor_y-g-offset)+"px";else c.style.top=(cursor_y+offset)+"px"};