/**
 * Activity Object model class. Implements Playable.
 */
function AO () {
	
	// private
	this.__course;
	this.__shortDesc;
	this.__longDesc;
	
	this.__prerequisite;
	this.__productNumber;
	this.__minGrade; // int
	this.__maxGrade; // int
	this.__recommendedTime; // int - in minutes
	this.__systemReq;

	this.__comingSoon; // boolean
	this.__itemNum; 

	this.__thumbnails = new Array(); 	// array - thumbnail images
	this.__videos = new Array();		// array - preview videos	
		
	this.__defaultThumbnailIndex;	// int - index of default thumbnail in the __thumbnails array
	
	this.__previewPath; // image url beginning
	
	this.__aoType;
	this.__learnerOutcomes;
	this.__keyword;
	
	this.__relatedLOs = new Array(); 	// array - LO
	
	// protected
	
	// public
	this.getCourse = function (){
		return this.__course;
	}
	this.getCourse = function (limit) {
		var tmpCourse = this.__course;
		if(this.__course.length > limit)
				tmpCourse = this.__course.substring(0,limit) + "...";
		return tmpCourse;
	}
	this.setCourse = function(course){
		this.__course = course;
	}
	
	this.getShortDesc = function () {
		return this.__shortDesc;
	}
	this.getShortDesc = function (limit) {
		var tmpDesc = this.__shortDesc;
		if(this.__shortDesc.length > limit)
				tmpDesc = this.__shortDesc.substring(0,limit) + "...";
		return tmpDesc;
	}
	this.setShortDesc = function (shortDesc){
		this.__shortDesc = shortDesc;
	}
	
	this.getLongDesc = function () {
		return this.__longDesc;
	}
	this.setLongDesc = function (longDesc){
		this.__longDesc = longDesc;
	}
	
	this.getPrerequisite = function () {
		return this.__prerequisite;
	}
	this.getPrerequisite = function (limit) {
		var tmpPrereq = this.__prerequisite;
		if(this.__prerequisite.length > limit)
				tmpPrereq = this.__prerequisite.substring(0,limit) + "...";
		return tmpPrereq;
	}
	this.setPrerequisite = function (prerequisite){
		this.__prerequisite = prerequisite;
	}
	
	this.getProductNumber = function () {
		return this.__productNumber;
	}
	this.setProductNumber = function (productNumber){
		this.__productNumber = productNumber;
	}
	
	this.getMinGrade = function () {
		return this.__minGrade;
	}
	this.setMinGrade = function (minGrade){
		this.__minGrade = minGrade;
	}
	
	this.getMaxGrade = function () {
		return this.__maxGrade;
	}
	this.setMaxGrade = function (maxGrade){
		this.__maxGrade = maxGrade;
	}
	
	this.getRecommendedTime = function () {
		return this.__recommendedTime;
	}
	this.getRecommendedTime = function (limit) {
		var tmpTime = this.__recommendedTime;
		if(this.__recommendedTime.length > limit)
				tmpTime = this.__recommendedTime.substring(0,limit) + "...";
		return tmpTime;
	}
	this.setRecommendedTime = function (recommendedTime){
		this.__recommendedTime = recommendedTime;
	}
	
	this.getSystemReq = function (){
		return this.__systemReq;
	}
	this.setSystemReq = function (systemReq){
		this.__systemReq = systemReq;
	}
	
	/// returns boolean value
	this.isComingSoon = function () {
		return this.__comingSoon;
	}
	this.setComingSoon = function (comingSoon){
		this.__comingSoon = comingSoon;
	}
	
	this.getItemNum = function (){
		return this.__itemNum;
	}
	this.setItemNum = function (itemNum){
		this.__itemNum = itemNum;
	}
	
	this.getThumbnails = function (){
		return this.__thumbnails;
	}
	this.setThumbnails = function (thumbnails){
		this.__thumbnails = thumbnails;
	}
	
	this.getVideos = function (){
		return this.__videos;
	}	
	this.setVideos = function (videos){
		this.__videos = videos;
	}
	
	this.getDefaultThumbnailIndex = function () {
		return this.__defaultThumbnailIndex;
	}
	this.setDefaultThumbnailIndex = function (index){
		this.__defaultThumbnailIndex = index;
	}
	
	this.getPreviewPath = function () {
		return this.__previewPath;
	}
	this.setPreviewPath = function (path){
		this.__previewPath = path;
	}
	
	this.getAOType = function () {
		return this.__aoType;
	}
	this.setAOType = function (type) {
		this.__aoType = type;
	}
	
	this.getLearnerOutcomes = function () {
		return this.__learnerOutcomes;
	}
	this.setLearnerOutcomes = function (learnerOutcomes) {
		this.__learnerOutcomes = learnerOutcomes;
	}
	
	// wrapper
	this.getDefaultThumbnail = function () {
		if(this.__defaultThumbnailIndex != null && this.__defaultThumbnailIndex != undefined)
			return this.__thumbnails[this.__defaultThumbnailIndex];
		else
			return new Preview();
	}
	
	this.getKeyword = function () {
		return this.__keyword;
	}
	this.setKeyword = function (keyword) {
		this.__keyword = keyword;
	}
	
	this.getRelatedLOs = function () {
		return this.__relatedLOs;
	}
	this.setRelatedLOs = function(loList) {
		this.__relatedLOs = loList;
	}
}
	

AO.prototype = new Playable();