function get_code(){
    new Ajax.Request('/d/get_code', 
      {
	  method: 'get',
	  onSuccess: function(transport)
	      {
		  var code = transport.responseText;
		  update_page(code);		  
	      }			 
      });
}

function update_page(code){
    $('centered_code').update('<a href="http://www.zipcar.com/referral?promo_code=' + code + '" style="text-decoration: none; color: #4d4d4f">' + code + '</a>');
    $('url1').writeAttribute('href', 'http://www.zipcar.com/referral?promo_code=' + code);
    $('url2').writeAttribute('href', 'http://www.zipcar.com/referral?promo_code=' + code);
    $('url3').writeAttribute('href', 'http://www.zipcar.com/referral?promo_code=' + code);
       
}


//You need to update the hrefs on the links as well.
// Use the updater to update the container, or use the Request to get the code and then do the work.
// http://www.prototypejs.org/learn/introduction-to-ajax
