﻿(function($){
    $.fn.Position = function(){
        var $this = $(this);
        var objCoords = GetCoords($this[0]);
            
        return objCoords;
    };
    
    
    function GetCoords(obj){
        var intX = 0;
        var intY = 0;
        
        while(obj.offsetParent){
            intX += obj.offsetLeft;
            intY += obj.offsetTop;
            obj = obj.offsetParent;
        }
        
        return{x:intX,y:intY};
    };
    
})(jQuery);