		
var quotes = [ [ 'There&rsquo;s no question that Store Ops-Center has made the operations team 20% more efficient.','Lewis Feinstein, VP Operations, The Shoe Company' ],
			[ 'Opterus&rsquo; Store Ops-Center is the foundation that replaces typical email with a communication vehicle that is far more flexible, efficient, centralized and exception based.', 'Robin Nelson, Director, Information Technology, Roots Canada Ltd' ] ,
			[ 'We will now know that communications are reaching the right person and we will get the crucial feedback that the task is complete and we&rsquo;re ready for our customers.', 'Dionne Dumitru, Chief Operating Officer, Weekends Only' ] ,
			[ 'Opterus allows us to independently and seamlessly manage both brands from the same instance of Store Ops-Center.', 'Peter Gerhardt, Chief Financial Officer, Town Shoes' ] ,
			[ 'We are very excited about the Opterus solution because of the enhanced functionality that it provides when compared to our previous system. &#8230; More importantly, the Opterus team has been extremely responsive throughout the entire process. Store Ops-Center has met and exceeded our expectations.', 'Kevin Campbell, AVP Store Operations, Bob&rsquo;s Stores' ] ,
			[ 'The problem with communication &#8230; is the illusion that it has been accomplished.', 'George B. Shaw' ] ,
			[ 'The Roundy&rsquo;s team reviewed operational compliance solutions from several application vendors. Throughout the process, we were seeking a solution that would help us control the flow of daily messages to our operations team. We selected Opterus because it provides us with a single channel for communications that allows us to communicate objectives across the enterprise and streamline and monitor execution.', 'John Boyle, Group Vice President, Roundy&rsquo;s'] ,
			[ 'The Opterus team has been great to work with as we went from business requirements, to lab evaluation, to proof of concept and now to deployment. The Courts and Opterus teams have accomplished all this through web conferences and conference calls, Across multiple time zones and thousands of miles. The fact that this solution is ready for deployment without Opterus ever having to visit our offices speaks volumes to the world class technology platform they provide.', 'Joe Greenway, Deputy Country Director, Courts Malaysia' ] ,
			[ 'We believe Opterus provides a solution that Is intuitive, easy-to-use and easy-to-understand. We were excited about Store Ops-Center as soon as we saw it. We&rsquo;ve been pleased at how quickly the solution has been rolled out to our stores, and look forward to the benefits.', 'Sirena Berriochoa, Kiosk Operations Manager, Rosetta Stone'  ] ,
			[ 'Make things as simple as possible, but not simpler.', 'Albert Einstein' ] ,
			[ 'Training for SOC was EASY! &#8230; Actually got a round of applause when I trained the Visual and Marketing Teams.', 'Mary Johns, Manager of Store Operations, Bob&rsquo;s Stores' ] 
			];
			
			
			
var quoteDiv, quoteByDiv, curQuote = 0, rotateSpeed = 4000;
var startcolor = '142a2b';  
var endcolor = 'bbdde7';
function rotateQuote()
{
	quoteDiv = document.getElementById(  'qtText'  );
	quoteByDiv = document.getElementById(  'qtName' );
	colorFade( 'qt_cntr',
			  'color',
			  startcolor,
			  endcolor,
			  40,
			  40,
			  function(){ changeText(); 
			   		   colorFade(  'qt_cntr',
						  	      'color',
						  	      endcolor,
						  	      startcolor,
						  	      40, 
						  	      40,
						  	      function(){ setTimeout( 'rotateQuote()' , rotateSpeed ); } ) } );
	
}
			
function changeText()
{
	quoteDiv.innerHTML =  quotes[ curQuote ][0];
	quoteByDiv.innerHTML =  quotes[ curQuote ][1];
	curQuote = ( curQuote + 1 ) % quotes.length;				
}
			
			
// main function to process the fade request //
function colorFade(id,element,start,end,steps,speed,fn) 
{
  var startrgb,endrgb,er,eg,eb,step,rint,gint,bint,step;
  var target = document.getElementById(id);
  steps = steps || 20;
  speed = speed || 20;
  clearInterval(target.timer);
  endrgb = colorConv(end);
  er = endrgb[0];
  eg = endrgb[1];
  eb = endrgb[2];
  if(!target.r) {
    startrgb = colorConv(start);
    r = startrgb[0];
    g = startrgb[1];
    b = startrgb[2];
    target.r = r;
    target.g = g;
    target.b = b;
  }
  rint = Math.round(Math.abs(target.r-er)/steps);
  gint = Math.round(Math.abs(target.g-eg)/steps);
  bint = Math.round(Math.abs(target.b-eb)/steps);
  if(rint == 0) { rint = 1 }
  if(gint == 0) { gint = 1 }
  if(bint == 0) { bint = 1 }
  target.step = 1;
  target.timer = setInterval( function() { animateColor(id,element,steps,er,eg,eb,rint,gint,bint, fn) }, speed);
}

// incrementally close the gap between the two colors //
function animateColor(id,element,steps,er,eg,eb,rint,gint,bint,fn) 
{
	var target = document.getElementById(id);
	var color;
	if( target.step <= steps ) 
	{
	    var r = target.r;
	    var g = target.g;
	    var b = target.b;
	    if( r >= er ) 
	    {
	      r = r - rint;
	    } 
	    else 
	    {
	      r = parseInt(r) + parseInt(rint);
	    }
	    if(g >= eg) 
	    {
	      g = g - gint;
	    } 
	    else 
	    {
	      g = parseInt(g) + parseInt(gint);
	    }
	    
	    if(b >= eb) 
	    {
	      b = b - bint;
	    } 
	    else 
	    {
	      b = parseInt(b) + parseInt(bint);
	    }
	    
	    color = 'rgb(' + r + ',' + g + ',' + b + ')';
	    if(element == 'background') 
	    {
	      target.style.backgroundColor = color;
	    } 
	    else if(element == 'border') 
	    {
	      target.style.borderColor = color;
	    } 
	    else 
	    {
	      target.style.color = color;
	    }
	    
	    target.r = r;
	    target.g = g;
	    target.b = b;
	    
	    target.step = target.step + 1;
	  } 
	  else 
	  {
	    clearInterval(target.timer);
	    color = 'rgb(' + er + ',' + eg + ',' + eb + ')';
	    if(element == 'background') 
	    {
	      target.style.backgroundColor = color;
	    } 
	    else if(element == 'border') 
	    {
	      target.style.borderColor = color;
	    } 
	    else 
	    {
	      target.style.color = color;
	    }
	    if ( typeof(fn) == "function" )
	    { 
	    	fn();
	    }
	  }
	}

// convert the color to rgb from hex //
function colorConv(color) 
{
  var rgb = [ parseInt(color.substring(0,2),16), 
  		    parseInt(color.substring(2,4),16), 
    		    parseInt(color.substring(4,6),16) ];
  return rgb;
}
