	var isNumber = function( v ){ return ( ! isNaN( v ) ); }
	var isFunction = function( v ){ return typeof v == 'function'; }


	getLeft = function( obj, includeMargin, localize ){

		if( ! obj ) return;
		var count = 0, border = 0, margin = 0, lastBorder = 0, cur = 0;

		if( includeMargin ){
			if( obj.currentStyle ){
				if( isNumber( margin = parseInt( obj.currentStyle.marginLeft ) ) ){ cur -= margin; }
			}else if( window.getComputedStyle ){
				if( isNumber( margin = parseInt( window.getComputedStyle( obj, null ).getPropertyValue( 'margin-left' ) ) ) ){ cur -= margin; }
			}
		}

		while( obj ){
			if( obj.currentStyle ){
				///if( obj.currentStyle.position != 'static' ) break;
				if( count > 0 ){
					if( isNumber( border = parseInt( obj.currentStyle.borderLeftWidth ) ) ){ cur += border; }
				}
			}else if( window.getComputedStyle ){ 
				///if( window.getComputedStyle( obj, null ).getPropertyValue( 'position' ) != 'static' ) break;
				if( ! isNumber( border = parseInt( window.getComputedStyle( obj, null ).getPropertyValue( 'border-left-width' ) ) ) ){ border = 0; }
				if( count > 0 ){ cur += border + lastBorder; lastBorder = border; }else{ lastBorder = 0; }
			}
			///if( obj.scrollLeft && ( count > 0 ) )	cur -= obj.scrollLeft;
			if( obj.offsetLeft )					cur += obj.offsetLeft;
			if( localize ) 							break;
			obj = obj.offsetParent;
			count++;
		}

		return cur;
	
	}

	getTop = function( obj, includeMargin, localize ){

		if( ! obj ) return;
		var count = 0, border = 0, margin = 0, lastBorder = 0, cur = 0;

		if( includeMargin ){
			if( obj.currentStyle ){
				if( isNumber( margin = parseInt( obj.currentStyle.marginTop ) ) ){ cur -= margin; }
			}else if( window.getComputedStyle ){
				if( isNumber( margin = parseInt( window.getComputedStyle( obj, null ).getPropertyValue( 'margin-top' ) ) ) ){ cur -= margin; }
			}
		}

		while( obj ){
			if( obj.currentStyle ){
				///if( obj.currentStyle.position != 'static' ) break;
				if( count > 0 ){
					if( isNumber( border = parseInt( obj.currentStyle.borderTopWidth ) ) ){ cur += border; }
				}
			}else if( window.getComputedStyle ){
				///if( window.getComputedStyle( obj, null ).getPropertyValue( 'position' ) != 'static' ) break;
				if( ! isNumber( border = parseInt( window.getComputedStyle( obj, null ).getPropertyValue( 'border-top-width' ) ) ) ){ border = 0; }
				if( count > 0 ){ cur += border + lastBorder; lastBorder = border; }else{ lastBorder = 0; }
			}
			///if( obj.scrollTop && ( count > 0 ) )	cur -= obj.scrollTop;
			if( obj.offsetTop )						cur += obj.offsetTop;
			if( localize ) 							break;
			obj = obj.offsetParent;
			count++;
		}

		return cur;
	
	}
