﻿
	    var conf =
        {
            APIKey: '2_TMm5ycl6N7Ps1xcmtL28sflGEQPALtxpypENLarhxHCvYyoKskMllf8o0iplikZv'
        };

	    function onLoad() {
	        // get user info
	        gigya.services.socialize.getUserInfo(conf, { callback: renderUI });

	        // register for connect status changes
	        gigya.services.socialize.addEventHandlers(conf, 
	                  { onConnect: renderUI, onDisconnect: renderUI });

	    }

	    function renderUI(res) {
	        var connected = (res.user != null && res.user.isConnected);
	        document.getElementById('btnGetFriends').disabled = !connected;

	        if (!connected)
	            document.getElementById('friends').innerHTML = "";
	    }

	    function getFriends() {
	        gigya.services.socialize.getFriendsInfo(conf, { callback: getFriends_callback });
	        document.getElementById('btnGetFriends').disabled = true;
	    }

	    function getFriends_callback(response) {
	        document.getElementById('btnGetFriends').disabled = false;
	        document.getElementById('friends').innerHTML = "";
	        if (response.status == 'OK') {
	            var array = response.friends.asArray();
	            var html = " ";
	            for (var i = 0; i < Math.min(251, array.length); i++) {
	                if (array[i].thumbnailURL)
	                    html += "<a class='nob'" + "  title='" + array[i].nickname +  "'>"
+"<img onclick='profclick(this.src);' style='height: 32px; width: 32px; border-style: solid; border-width: 1px; margin: 7px' src='" + array[i].thumbnailURL + "' >";
"</a>"

	            }
	            document.getElementById('friends').innerHTML = html;
	        }
	    }

"<a title='" + person.getField("displayName") +  "'>"


        var conf = 
        {
            APIKey: '2_TMm5ycl6N7Ps1xcmtL28sflGEQPALtxpypENLarhxHCvYyoKskMllf8o0iplikZv'
        };
        
        function onLoad()
        {
            // get user info
            gigya.services.socialize.getUserInfo(conf,{callback:renderUI});	    
            
            // register for connect status changes
            gigya.services.socialize.addEventHandlers(conf, { onConnect:renderUI, onDisconnect:renderUI}   ); 
            
        }
 

        // Create and Publish User's Action
        // This method is associated with the "btnPublishAction" click
        function showShareUI() {

		    // Constructing a UserAction Object
		    var act = new gigya.services.socialize.UserAction();

		    // Setting the default user message 
		    // (will be presented as default text in the edit box on the Share UI)
		    act.setUserMessage("Your comment here...");

		    // Setting the title and description 
		    // (will be presented in the preview on the Share UI)
		    act.setTitle("Cursorwiz");
		    act.setDescription("I've just been making cursors at Cursorwiz.com"   );
		    // Adding an image (will be presented in the preview on the Share UI)
	        var image = {
	            src: 'http://www.cursorwiz.co.uk/images/pointing.png',
	            href: 'http://www.cursorwiz.com',
	            type: 'image'
	        }
			act.addMediaItem(image);
            // Setting a link back to the publishing source
		    act.setLinkBack("http://www.cursorwiz.com");
		    // Adding Action Link
		    act.addActionLink("Make your own Cursors and Icons Here!","http://www.cursorwiz.com");





			// Parameters for the showShareUI method, including the UserAction object
			var params = 
			{
			    userAction: act,  // The UserAction object enfolding the newsfeed data.			                                  
			    onError: onError,  // onError method will be summoned if an error occurs. 
			    onSendDone: onSendDone // onError method will be summoned after 
			                        // Gigya finishes the publishing process.
			};

			// Show the "Share" dialog
			gigya.services.socialize.showShareUI(conf, params);

		}
		
		// onError event handler
		function onError(event) {
		    alert('An error has occured' + ': ' + event.status + '; ' + event.statusMessage);
		}

		// onSendDone event handler. 
		// Displays in the status field, the list of providers to which the newsfeed has been 
		// successfully published.
		function onSendDone(event)
		{
//		    document.getElementById('status').style.color = "green";
//		    document.getElementById('status').innerHTML =                             'The newsfeed has been posted to: ' 
//		            + event.providers;
		}    







