/*
 * Copyright (c) 2006-2007 Collactive. All rights reserved.
 */
// Boston Globe Automation API
BostonGlobe = function() {
	this._initReady = function(url, elem, actions) {
	    if (!this._hasCSA) {
		    Collactive.SSAUtils.activateProxy();
		    url = Collactive.ProxyUtils.proxify(url);
	    }

	    BostonGlobe.prototype._initReady.call(this, url, elem, actions);
	};

	this._createAssistant = function() {
		return new Collactive.Assistant("boston_globe",
			[],
			this._storage, this._ui);
	};

    this.emailStory = this._assistedFunction({
       	navigateFirst: false,
        clientOnly: false,
        serverOnly: false
    }, function(url, recipients, senderName, senderAddress, message, callback) {
		this._storage.clearSession();
		this._saAPI.emailStory(url, recipients, senderName, senderAddress, message,
			this._asyncCallback(function (status) {
				callback(status);
			})
		);
    });

	return this;
};

BostonGlobe.prototype = new SiteAutomationFacade('boston_globe');