var quoteIndex = 0;
/*var quotes = [ 
    ["Cloudscaling has had great success with OpenNebula. Unlike many of the other open source virtual infrastructure management tools, ONE is cleanly written, modular, and easily extensible. We use it regularly in our labs and in some client engagements. Highly recommended.","Randy Bias, CEO, Cloudscaling","http://cloudscaling.com/"],
    ["This open-source toolkit fits snuggly into existing data center environments to build any type of cloud deployment. OpenNebula can be used to manage virtual infrastructure in the data center or to manage a private cloud.","20 Coolest Cloud Infrastructure Vendors - ChannelWeb","http://www.crn.com/hardware/222600295;jsessionid=CYF0EEKP4CCHPQE1GHRSKH4ATMY32JVN?pgno=15"],
]*/
var quotes = [ 
    "th_dashboard.png",
    "th_host.png",
    "th_login.png",
    "th_vm.png",
]

function show_quote(){
    quote = quotes[quoteIndex++ % (quotes.length)];
    img = '<a href="http://opennebula.org/documentation:rel2.2:sunstone"><img src="/_media/'+quote+'" alt="screenshot" /></a>';
    $('#quotes').html(img);
}
function cycle_quote(index) {
    $('#quotes').fadeOut('slow',function(){
        show_quote();
    }).fadeIn('slow');
}
function fisherYates ( myArray ) {
  var i = myArray.length;
  if ( i == 0 ) return false;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}
$(document).ready(function(){
    //fisherYates(quotes);
    show_quote();
    setInterval(function(){
        cycle_quote();
    },14000);
});

