

function setStatus( name, href, description, image)
{								  

  if (typeof(name) == 'undefined' ) {
    name = 'No Energy Tax';
  }
  
  if ( typeof(href) == 'undefined' ) {
    href = 'http://noenergytax.com';
  }
  
  if ( typeof(description) == 'undefined' ) {
   description = 'Join The Heritage Foundation to educate more Americans about the dangers of a cap-and-trade system that will tax most forms of energy, including: coal, natural gas, heating oil, and gasoline.'; 
  }
  
  if ( typeof(image) == 'undefined' ) {
    image = 'http://noenergytax.com/styles/images/light-bulb-off.png';
  }
  
  var attachment = { 'name': name, 'href': href, 'description': description,
    'media' : [{
        'type': 'image',
        'src': image, //'http://noenergytax.com/styles/images/light-bulb-off.png',
        'href': href //'http://noenergytax.com'
    }]
   };
   
  // do this by the book...
  FB.Connect.streamPublish(
    '', // user message - can't prefill
    attachment, //{ 'name': 'No Energy Tax', "href": 'http://noenergytax.com', 'description': 'Join The Heritage Foundation to educate more Americans about the dangers of a cap-and-trade system that will tax most forms of energy, including: coal, natural gas, heating oil, and gasoline.'},
    [{ "text": "Visit noenergytax.com", "href": "http://noenergytax.com"}],
    false, false,
    function( post_id, exception ) {
      if ( post_id != 'null' ) {
       	$.post( env.local + 'actions.php',
      			{
      				action: 'set_status',
      				action_id: getCurrentActionId(),
      				status: ''
      			},
      			didSetStatus );
      	logAction( "setFbStatus: " + '' );      
      }
    }
  );
}

function didSetStatus( response )
{
	showScore( eval( '(' + response + ')' ), false );
}

/* inline automatic set status */
function setStatusInline( status_text )
{

  
  var attachment = { 'name': 'No Energy Tax', 'href': 'http://noenergytax.com', 'description': status_text,
    'media' : [{
        'type': 'image',
        'src': 'http://noenergytax.com/styles/images/light-bulb-off.png',
        'href': 'http://noenergytax.com'
    }]
   };
    
  // do this by the book...
  FB.Connect.streamPublish(
    '', // user message - can't prefill
    attachment, //{ 'name': 'No Energy Tax', "href": 'http://noenergytax.com', 'description': 'Join The Heritage Foundation to educate more Americans about the dangers of a cap-and-trade system that will tax most forms of energy, including: coal, natural gas, heating oil, and gasoline.'},
    [{ "text": "Visit noenergytax.com", "href": "http://noenergytax.com"}],
    false, false,
    function( post_id, exception ) {
      if ( post_id ) {
       	$.post( env.local + 'actions.php',
      			{
      				action: 'set_status_inline',
      				status: status_text
      			});
      
      	logAction( "setFbStatus: " + '' );      
      }
    }
  );
  
}

function willSetStatusInline( status_text )
{
	$.post( env.local + 'actions.php',
			{
				action: 'set_status_inline',
				status: status_text
			});

	logAction( "setFbStatus: " + status_text );
}


