/**
 * Displays testimonies from users
 *
 * @title		Testimony Display
 * @author		Colin Nolan
 * @version		v1.0.0
 * @created		28/08/11
 */
var TestimonyDisplay = function()
{
	/*
	 * Settings
	 */
	// Testimonies
var testimonies = [
	{
		comment : "It's working on my first try! it's great! thank you XJZ Remover :)",
		author 	: "Andhika",
		source	: "Comments Forum",
		date	: "06.01.12"
	},
	{
		comment : "thank you xjz remover",
		author 	: "janhenry",
		source	: "Comments Forum",
		date	: "03.01.12"
	},
	{
		comment	: "thank you sooo much",
		author	: "Voon Cj",
		source	: "Facebook",
		date	: "20.12.11"
	},
	{
		comment	: "Wow xjz you have really helped me alot. I thank you 276 times...",
		author	: "Tyler",
		source	: "Facebook",
		date	: "18.12.11"
	}
	];


	/*
	 * Instance variables
	 */
	var interface;									// UI Element



	/**
	 * Pseudo constructor
	 */
	(function() {
		interface = document.createElement("div");

		for(var i = 0; i < testimonies.length; i++) {
			var testimony = document.createElement("div");
			var comment = document.createElement("div");
			comment.className = "testimony";
			comment.innerHTML = "\"" + testimonies[i].comment + "\"";
			testimony.appendChild(comment);

			var source = document.createElement("div");
			source.className = "testimony-source";
			source.innerHTML = testimonies[i].author + ", " + testimonies[i].source + (testimonies[i].date ? " ("+ testimonies[i].date +")" : "");
			testimony.appendChild(source);

			interface.appendChild(testimony);
		}
	})();



	// Accessor
	/**
	 * Get the interface
	 * @return	{HTMLElement} Testimony display interface
	 */
	this.getInterface = function() {
		return interface;
	};
};
