$(document).observe("dom:loaded", function() {
sendToFriend('/submitted_recipes/new');
});


var Popup = Class.create();
Popup.prototype = 
{
  initialize: function(options)
  {
    this.options = {
      url: '#',
      width: 455,
      height: 600
    }
    Object.extend(this.options, options || {});
    window.open(this.options.url, '', 'width='+this.options.width+',height='+this.options.height);
  }
}


//Opens a pop-up for send-to-friend link - function sits in top of lodge page and takes a rails tag.
function sendToFriend(pageurl){
	if (!document.getElementById("link_recipe_submit")) return false;
	Event.observe('link_recipe_submit', 'click', function(e) {
		new Popup({url:pageurl});
		Event.stop(e);
	});
}
