/*************************************************
* This script displays the testimonials we have for Opinio
* (C) 2010-2010, ObjectPlanet, Inc., http://www.objectplanet.com
**************************************************/

/* Set up the name space */
var objectplanet;
if (!objectplanet) objectplanet = {};
objectplanet.opinio = {};

/* This module displays the testimonials  */
(function($) {
	
	/*
	 * Starts the statement viewer
	 */
	function start() {
		displayNextStatement();
		setInterval(displayNextStatement, DISPLAY_TIME);
	}

	// assign function to the global namespace
	objectplanet.opinio.start = start;
	
	
// private methods

	
	/* The logos, statements, and persons */
	var statements = [
   		["nasa.jpg", "Based on our evaluation Opinio came out to be a product that has a far superior feature set, easy to maintain both from an administration as well and ease of use standpoint. It integrated well with the overall infrastructure that the NASA.gov website had in place.<br><br>- Eashwer Srinivasan, Project Manager, NASA Portal Team"],
		["wm.jpg", "Opinio has been used in a wide variety of ways at W&M. Some examples include psychological surveys, international relations surveys, votes on faculty and student issues, surveys of satisfaction with conferences/presentations and surveys to collect data on new students.<br><br>- Mark Eaton, College of William and Mary"],
		["stfx.jpg", "Not only have we seen an increase in response rate, the time for survey administration is significantly reduced and the data obtained from Opinio is clean and coded. Consequently the overall administration time of a survey is reduced, allowing more time for analysis and additional projects.<br><br>- Gary Doucette, Manager of Management Information Systems, St. Francis Xavier University"],
		["toronto.jpg", "I appreciate being able to flexibly publish online questionnaires that can be easily sent to anyone around the world that happens to be in front of a computer.<br><br>- Researcher, Psychology Department, University of Toronto"],
		["deakin.jpg", "Following an extensive market scan, Opinio, from ObjectPlanet was selected. Opino far outweighed its competitors and was the obvious choice for Deakin. Overall Opinio is an excellent on-line survey system, with ObjectPlanet providing quality and timely support.<br><br>- Helen Jacob, Manager, Evaluation and Surveys, Deakin University"],
		["dalhousie.jpg", "With over 250 members conducting hundreds of surveys over a span of more than two years, there is no question that Opinio has rapidly become an extremely popular service at Dalhousie University.<br><br>- Poh Chua, Data Management Consultant, Information Technology Services, Dalhousie University"],
		["lafayette.jpg", "After reviewing a number of hosted services and open-source products, we selected Opinio because it offered a variety of simple-to-use features at a reasonable cost.<br><br>- Jason Alley, Instructional Technologist at Lafayette College"],
		["buffalo.jpg", "Administrators have conducted College-wide surveys, collected information on exiting students by program, and have also used the software as a form to gather information for services.<br><br>- Melissa J. Miszkiewicz, Director, Academic Computing & Technical Services, Buffalo State College"],
		["suepo.jpg", "We have been extremely satisfied with this stable, secure, flexible and user-friendly solution and would gladly recommend it to others.<br><br>- Ian Catley, Patent Examiner, European Patent Office"]
	];

	
	/* The index of the current statement displayed */
	var currentStatement = 0;
	var DIMMER_SPEED = 1000;
	var DISPLAY_TIME = 7000;
	
	
	/*
	 * Displays the next logo and statement 
	 */
	function displayNextStatement() {
		$('#testimonials').fadeOut(DIMMER_SPEED, function() {
			$('#testimonials img').attr('src', '/logos/opinio/' + statements[currentStatement][0]);
			$('#testimonials p').html(statements[currentStatement][1]);
			$('#testimonials').fadeIn(DIMMER_SPEED, function() {
				currentStatement = (++currentStatement % statements.length);
			});
		});
	}
})(jQuery);

setTimeout(objectplanet.opinio.start, 500);


/* This module displays the opinio customer logos */
(function($) {

	/* The customer logos */
	var logos = [ 
		["cox.jpg", "lexmark.jpg", "mayo.jpg", "empty.jpg", "empty.jpg"],
		["nasa.jpg", "nintendo.jpg", "roche.jpg", "cox.jpg", "stanford.jpg", "empty.jpg"],
		["sony.jpg", "stanford.jpg", "verizon.jpg", "roche.jpg", "kbr.jpg", "empty.jpg"],
		["bchydro.jpg", "thales.jpg", "siemens.jpg", "kbr.jpg", "empty.jpg", "empty.jpg"],
		["amat.jpg", "agf.jpg", "disney.jpg", "amazon.jpg", "goretex.jpg", "ibm.png"],
		["nielsen.jpg", "honda.jpg", "european-parliament.jpg", "nasa.jpg", "stanford.jpg", "ibm.png"]
	];
	
	/**
	 * Display a random set of logos
	 */
	function customers() {
		var index = Math.min(Math.round(Math.random() * logos.length), logos.length-1);
		for (i = 0; i < logos[index].length; i++) {
			$('#opinioCustomerLogos').append('<img src="/logos/opinio/small/' + logos[index][i] + '">');
		}
	}
	objectplanet.opinio.customers = customers;
})(jQuery);

