// Assign the value to the input with the id passed in 
function updateText( idRef, val ) { 
 // Make sure browser supports getElementById  
 if(!document.getElementById ) return; 
 // Find the input by it's id 
 var inputObj = document.getElementById( idRef ); 
 if( inputObj ) { 
 // Update the value 
 inputObj.value = val; 
 } 
} 
// Attach all of the behaviors requiured on the page 
function attachBehaviors() { 
 // Make sure browser supports getElementById  
 if(!document.getElementById ) return; 
 
 // Find the link by it's id 
 var linkObj = document.getElementById( 'join' ); 
 if( linkObj ) {
 // Attach the onclick handler 
 linkObj.onclick = function() { 
  updateText( 'message', 'Wish you could go to the field with Doctors Without Borders? Get an insider\'s view at www.bethere1st.org/ #bethere1st' ); 
 }; 
 }
 
 var linkObj = document.getElementById( 'help' ); 
 if( linkObj ) {
 // Attach the onclick handler 
 linkObj.onclick = function() { 
  updateText( 'message', 'Help Doctors Without Borders be there 1st when there is an emergency. www.bethere1st.org/ #bethere1st' ); 
 }; 
 } 
 
 var linkObj = document.getElementById( 'save' ); 
 if( linkObj ) {
 // Attach the onclick handler 
 linkObj.onclick = function() { 
  updateText( 'message', 'It costs $1 to protect someone against Meningitis. How many lives can you save? www.bethere1st.org/ #bethere1st' ); 
 }; 
 }  
 
} 
// Define the onload method and tell it to attachBehaviors 
window.onload = function() { 
 attachBehaviors(); 
}; 