/*
 * Copyright (c) 2006-2007 Collactive. All rights reserved.
 */
// Yahoo News Site Automation API
YahooNews = function() {
	this._createAssistant = function() {
		return new Collactive.Assistant("yahoo_news",
			[],
			this._storage, this._ui);
	};

    this.emailStory = this._assistedFunction({
       	navigateFirst: true,
        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);
			})
		);
    });

	//overriding the following to help animations work faster
	this._displayListener = function(displayed, smallmode) {
		
        this._uiDisplayed = displayed;
        if (this._saAPI == null) {
            return;
        }
		
        if (smallmode) {
            this._saAPI.enterSmallMode();        
        } else {
	        if (this._uiDisplayed) {
	            this._saAPI.invisiblize();
	        } else {
	            this._saAPI.visiblize();
	        }
		}
	};	

	return this;
};

YahooNews.prototype = new SiteAutomationFacade('yahoo_news');