"use strict";
///////////////////////////////////////////////////////////////////
//
// ray_kroc_award_winners(number[, path])
//
// Function to draw a number of images of ray kroc award winners
// Parameters:
//    1. number, the number of winners to draw
//    2. path, optional, allows to set a different path to the images folder

// Global variables to manage the existance of duplicate images.
var MAX_RKAW_IMAGES = 14;
var rkaw = new Array();
for(var i = 1; i <= MAX_RKAW_IMAGES; ++i)
  rkaw.push(i);
var MAX_QUOTE_IMAGES = 8;
var quotes = new Array();
for(var i = 1; i <= MAX_QUOTE_IMAGES; ++i)
  quotes.push(i);

var money_images = new Array();
money_images.push("pocket_money.png", "holding_money.png", "hand_money.png", "brick_money.png", "giving_money.png", "spread_money.png", "coin_purse.png");


function ray_kroc_award_winners(number, path){
  if(number <= 0) return;
  for(var i=0; i < number; ++i){
    if(rkaw.length)
      document.write('<img style="margin: 0px 1px 0px 1px" src="' + (path?path:'') + 'images/rkaw_' + rkaw.splice(Math.floor(Math.random() * rkaw.length),1) + '.png" alt="Ray Kroc Award Winner" />');
  }
}

///////////////////////////////////////////////////////////////////
//
// goldcards_saving_money([path])
//
// Function to draw an image of people saving money
// Parameters
//   path, optional, allows to set a different path to the images folder
//
function goldcards_saving_money(path){
    if(money_images.length)
      document.write('<img style="margin: 0px 0px 0px 0px" src="' + (path?path:'') + 'images/' + money_images.splice(Math.floor(Math.random() * money_images.length),1) +'" width="150" height="150" alt="Saving Money" />');
}

///////////////////////////////////////////////////////////////////
//
// goldcards_quotes(number[, path])
//
// Function to draw a number of images of goldcards quotes
// Parameters
//    1. number, the number of quotes to draw
//    2. path, optional, allows to set a different path to the images folder
//
function goldcards_quotes(number, path){
  if(number <= 0) return;
  for(var i=0; i < number; ++i){
    if(quotes.length)
      document.write('<img style="margin: 0px 20px" src="' + (path?path:'') + 'images/quote_' + quotes.splice(Math.floor(Math.random() * quotes.length),1) + '.png" alt="Goldcards Quotes" />');
  }
}
