function extendSource(source, defaults) {
        var property;
        for (property in defaults) {
            if (source.hasOwnProperty(property) === false) {
                source[property] = defaults[property];
            }
        }
        return source;
    }
this function will extend source object with defaults object.

@param object source     this is the source object
@param object defaults   this is the default object
@return object