$(document).ready(function() {
    
});

function showShareUI()
{   
    var conf= {
        enabledProviders: 'facebook,twitter,yahoo,messenger,google,linkedin,myspace'
    }

    var act = new gigya.services.socialize.UserAction();
    
    act.setTitle("Hunting | Realtree ®");
    
    act.setDescription("Official site of Realtree ®, creator and marketer of Realtree camouflage patterns | Hunting articles & how to | TV shows | Resources | Games | Downloads | Mobile");

    act.addMediaItem(
    {   
        type: 'image',      // Type of the media (image/flash/mp3)  
        src: 'http://c1935252.r52.cf0.rackcdn.com/share-default.png',   // URL to the image source  
        href: 'http://www.realtree.com'    // URL to redirect the user when he clicks the image  
    }
    );  
 
    var operationMode = 'multiSelect';

    var share_params =
    {
        userAction: act  // The UserAction object enfolding the newsfeed data.	
        ,
        operationMode: operationMode// Opens the Share Plugin either in Simple or Multiselect mode according to the user connection status. 
        ,
        snapToElementID: "btnShare" // Snaps the Simple Share Plugin to the share button
        ,
        onError: onError  // onError method will be summoned if an error occurs. 
        ,
        onSendDone: onSendDone // onError method will be summoned after 
        // Gigya finishes the publishing process.
        ,
        context: operationMode			
        ,
        showMoreButton: true // Enable the "More" button and screen
        ,
        showEmailButton: true // Enable the "Email" button and screen
    }
    
    gigya.services.socialize.showShareUI(conf,share_params);
}


// onError event handler
function onError(event) {
    alert('An error has occured' + ': ' + event.errorCode + '; ' + event.errorMessage);
}

// onSendDone event handler. 
// Displays in the status field, the list of providers to which the newsfeed has been 
// successfully published.
function onSendDone(event)
{
    alert('Thanks for sharing');
}
