function WindowSize() { this.Height = 0; this.Width = 0; } function GetWindowSize() { var WS = new WindowSize(); if (typeof( window.innerWidth ) == "number") // Не Интернет-эксплорер { WS.Height = window.innerHeight; WS.Width = window.innerWidth; } else if (typeof(document.documentElement.clientHeight) == "number") //IE 6+ in 'standards compliant mode' { WS.Height = document.documentElement.clientHeight; WS.Width = document.documentElement.clientWidth; } else { WS.Height = document.body.clientHeight; WS.Width = document.body.clientWidth; } return WS; } function SwitchHintOn(event, HDiv, HText) { e = event || window.event; ws = GetWindowSize(); DivObj = document.getElementById(HDiv); DivObj.firstChild.nodeValue = HText; if (e.clientX > ws.Width/2) // рисуем слева DivObj.style.left = e.pageX-DivObj.offsetWidth-5 + "px"; else DivObj.style.left = e.pageX+15+"px"; if (e.clientY > ws.Height/2) // рисуем выше DivObj.style.top = e.pageY-DivObj.offsetHeight-5 + "px"; else DivObj.style.top = e.pageY+15+"px"; DivObj.style.visibility = "visible"; } function SwitchHintOff(HDiv) { DivObj = document.getElementById(HDiv); DivObj.style.visibility = "hidden"; }