// Returns the array type.
Function findposition (oelement) {// current oelement
If (typeof (oelement. offsetparent )! = 'Undefined '){
For (VAR posx = 0, Posy = 0; oelement = oelement. offsetparent ){
Posx + = oelement. offsetleft;
Posy + = oelement. offsettop;
}
}
VaR array = [posx, Posy];
Return array;
}
// Obtain the absolute X coordinate of the control that triggers the event on the entire page
Function findpositionx (oelement ){
If (typeof (oelement. offsetparent )! = 'Undefined '){
For (VAR posx = 0; oelement = oelement. offsetparent)
{
Posx + = oelement. offsetleft;
}
}
Return posx;
}
// Obtain the absolute y coordinate of the control that triggers the event on the entire page
Function findpositiony (oelement ){
If (typeof (oelement. offsetparent )! = 'Undefined '){
For (VAR posy = 0; oelement = oelement. offsetparent ){
Posy + = oelement. offsettop;
}
}
Return posy;
}