	
	/**
	 * @version
	 *   $Id: rollover_amp_activity.js,v 1.3 2007/09/16 12:23:22 cabernet Exp $
	 * @author
	 *   F. Zaslavskiy
	 * @copyright
	 *   Copyright (c) 2006 Zerve, Inc.
	 * 
	 * This file implements the rollover data source for activity on amp.
	 * See rollover.js for more information.
	 * 
 	 * The format of data that is expected is javascript object.
 	 * Each attribute of the object will be the activity_id
 	 * and the value of each attribute will be a javascript array: [ activity_img_url, ratings_img, teaser_text ] 
 	 * 
	 */
	
	function ZRolloverAmpActivity( data ) {
		
		this._data = data;

	}
	
	/**
	 * Returns data based on content id or null if there is no
	 * rollover to display for this id.
	 */
	ZRolloverAmpActivity.prototype.getData = function( id ) {

		if( this._data[id] != null ) {
			if( this._data[id][0] == null && this._data[id][1] == null && this._data[id][2] == null ) {
				return null;
			}
			return this._data[id];
		} else { 
			throw new Error( 'No data exist for id: ' + id );
		}

	}
	
	/**
	 * Returns the html based on the data provided.
	 */
	ZRolloverAmpActivity.prototype.getHtml = function( data ) {

		var str = '';
		str += '<div style="margin: 3px 0px 3px 0px;"><b>';
		str += data[1] + '</b></div>';
		if( data[2] != null ) {
			str += '<img border="1" style="margin-right:6px;float:left" src="' + data[2] + '" />';
		}
		str += '<div class="st" style="line-height:1.2em;">';
		if( data[3] != null ) {
			str += '<img border="0" src="' + data[3] + '" /></div>';
		}
		if( data[4] != null ) {
			str += '<div class="st" style="line-height:1.2em;margin-top: 3px;">';
			str +=  data[4] ;
		}
		str += '</div>';
		return str;

	}