[jQuery] Sucker Fish Drop Down Menu, Jquery Style...

[jQuery] Sucker Fish Drop Down Menu, Jquery Style...

Hi all,
I've very nearly finished a Jquery version of suckerfish dropdowns.
I've got it so that dropdowns will not leave the boundry of the
browser. I'm using these two functions to a. get the current postion
and b. get the browser width. I was wondering if there was a
better/smaller Jquery way of doing either/both.
The functions are
function getWidth(){
var myWidth = 0
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
} else if( document.documentElement && (
document.documentElement.clientWidth) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
} else if( document.body && ( document.body.clientWidth) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
}
return myWidth;
}
function findPosX(obj){
    var curleft = 0;
    if(obj.offsetParent)
    while(1)
        {
            curleft += obj.offsetLeft;
                if(!obj.offsetParent)
                break;
                obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
}
Any ideas?
thanks
Mark
--
www.markpanay.com - Jargon Free Development
www.labellife.com - Music Industry 2.0
www.tunecast.co.uk - Music for your website
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/