
function publishFacebook() 
        {	
			FB.ui(
				  {
					method: 'stream.publish',
					attachment: {
					  name: 'Here Come The Birds Free Album Download!',
					  caption:'Here Come The Birds Free Album Download!',
					  description: ('Download the new album in full for free this week only at www.herecomethebirds.com.au'),
					  href: 'http://www.herecomethebirds.com.au/'
					},
					display: 'popup',
					action_links: [
					  { text: 'Here Come The Birds', href: 'http://www.herecomethebirds.com.au/' }
					]
				  },
				  function(response) {
					if (response && response.post_id) {
						alert('Thank you for sharing!');
						toggleLink('DownloadLink');
					} else {
                		alert('Please share this to receive the free download');
					}
				  }
				);

		}
	
	
	/*function publishFacebook() 
        { 
            FB_RequireFeatures(["Connect"], function() 
            {   
                //FB.init('cccd4a6fe9d3f65231bff74246d99247', 'xd_receiver.htm');   
                //FB.init('cccd4a6fe9d3f65231bff74246d99247');   
                FB.init('132612836754991');   
                FB.ensureInit(function() {     
                    var message = "Download the new album in full for free this week only at http://www.herecomethebirds.com.au";
                    var attachment = {
                            'name': 'Here Come The Birds Free Album Download!',
                            'href': 'http://www.herecomethebirds.com.au', 'caption': '{*actor*} just downloaded the new album in full by Here Come The Birds',
                            'description': 'Download the new album in full for free this week only at www.herecomethebirds.com.au',
                            "media": [{ 'type': 'image', 'src': 'http://www.herecomethebirds.com.au/images/FB_youngneverdie.gif', 'href': 'http://www.herecomethebirds.com.au'}]
                     };
                     var action_links = [{ 'text': 'Here Come The Birds Free Album Download', 'href': 'http://www.herecomethebirds.com.au'}];
                     FB.Connect.streamPublish(message, attachment, action_links, null, 'Here Come The Birds Free Album Download', callback, true, null);
                }); 
            });

        }
        
        
        function callback(post_id, exception, data) 
        {	
            if (post_id == null || post_id == "null"){
                alert('Please share this to download the single');
                //toggleLink('DownloadLink');
            } else{
                alert('Thank you for sharing');
                toggleLink('DownloadLink');
            }
        }*/
        
        function toggleLink(DivToToggle)
        {
            var div = document.getElementById(DivToToggle);
            
            if(div.style.visibility == 'hidden') {
                div.style.visibility = 'visible';
            }
            else {
                div.style.visibility = 'hidden'
            }
            
            
            if(div.style.display == 'none')	{
                div.style.display = 'block';
            }
            else {
                div.style.display = 'none'
            }
        }// JavaScript Document
