Destinations.igoogle = function() {
    Destinations.register("igoogle");
    
    return {
        id: 'igoogle',
        displayName: 'iGoogle Widget',
        
        select: function() {
            $('#igoogle-content').show();
        },
        
        init: function() {
            $("#igoogle-link").click(function(event){
                var iGooglePHP = getPath() + "iGoogleXML.php?";
                iGooglePHP += "title=" + encodeURIComponent(Wall.getProp('title'));
                iGooglePHP += "&flashvars=" + encodeURIComponent(Wall.getQueryString());

                var iGoogleRoot = "http://fusion.google.com/add?source=atgs&moduleurl=" + encodeURIComponent(iGooglePHP);

                $(this).attr('href', iGoogleRoot);
                Builder.trackState(true);
            });
        }
    };
}();

