/*
tip_centerwindow.js  v. 1.21

The latest version is available at
http://www.walterzorn.com
or http://www.devira.com
or http://www.walterzorn.de

Initial author: Walter Zorn
Last modified: 3.6.2008

Extension for the tooltip library wz_tooltip.js.
Centers a sticky tooltip in the window's visible clientarea,
optionally even if the window is being scrolled or resized.
*/
// Make sure that the core file wz_tooltip.js is included first
function Ctrwnd_DoCenter(){if(tt_aV[CENTERWINDOW]){var a,b,c,d;return tt_ie||!tt_aV[CENTERALWAYS]?(c=tt_GetScrollX(),d=tt_GetScrollY()):(c=0,d=0),a=(tt_GetClientW()-tt_w)/2+c+tt_aV[OFFSETX],b=(tt_GetClientH()-tt_h)/2+d+tt_aV[OFFSETY],tt_SetTipPos(a,b),!0}return!1}typeof config=="undefined"&&alert("Error:\nThe core tooltip script file 'wz_tooltip.js' must be included first, before the plugin files!"),config.CenterWindow=!1,config.CenterAlways=!1;var ctrwnd=new tt_Extension;ctrwnd.OnLoadConfig=function(){if(tt_aV[CENTERWINDOW]){if(tt_aV[STICKY])return tt_aV[CENTERALWAYS]&&(tt_ie?tt_AddEvtFnc(window,"scroll",Ctrwnd_DoCenter):tt_aElt[0].style.position="fixed",tt_AddEvtFnc(window,"resize",Ctrwnd_DoCenter)),!0;tt_aV[CENTERWINDOW]=!1}return!1},ctrwnd.OnMoveBefore=Ctrwnd_DoCenter,ctrwnd.OnKill=function(){return tt_aV[CENTERWINDOW]&&tt_aV[CENTERALWAYS]&&(tt_RemEvtFnc(window,"resize",Ctrwnd_DoCenter),tt_ie?tt_RemEvtFnc(window,"scroll",Ctrwnd_DoCenter):tt_aElt[0].style.position="absolute"),!1}
