//2008-04-18 by camartin

/*BEGIN Globals*/
var gsImg=[];
var gsImgTitle=[];
var gsImgWidth='424';//fixed for all images
var gsImgHeight=[];//dynamic
var gsImgTxt=[];

url = location.protocol + '//' + location.host + '/'
sharedImgPath = url + 'shared/images/'

var counter=0;//the current counter for the image in images()
/*END Globals*/

function init_images(){

  imgPath=sharedImgPath+'contests/garden_showcase/winners/';
  txt='';

  gsImg.push(imgPath+'RomeoSupergadget1.jpg');
  gsImgTitle.push('Romeo Supergadget');
  gsImgHeight.push('288');
  txt='&quot;Laff-o-Luxury&quot;<br>Escape the daily Cog battles and come to refill your Laffs. Luxury awaits! The doorway to my Estate is surrounded by a Summer&#39;s Last Rose and a Laff-o-Dill to help make a splendid entrance. Sound trees and a Wedding Cake tree make a cool shaded area to relax just before you power up the gags for that next Cog battle! A statue of Donald, the coolest Toon ever, sits just beyond the shade glistening in the sun. And friendly, high maintenance Doodles are there to greet you as soon as you arrive. Yes, this surely is the Laff-o-Luxury!';
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'RomeoSupergadget2.jpg');
  gsImgTitle.push('Romeo Supergadget');
  gsImgHeight.push('288');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'LittleLilyFeatherfoot1.jpg');
  gsImgTitle.push('Little Lily Featherfoot');
  gsImgHeight.push('315');
  txt='My garden represents my name, as well as my personality, and favorite color. It has purple Silly Lilly flowers and a Feather gag tree to show my Toon name. Purple is my favorite color and Silly Lilly is what my family calls me. I feel that when my friends come to visit me at my house they can see by the way it looks what type of friend I am. Further more, drop trees and cannons show them they can drop in anytime and have a blast.';
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'LittleLilyFeatherfoot2.jpg');
  gsImgTitle.push('Little Lily Featherfoot');
  gsImgHeight.push('315');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'CultivatingKitty1.jpg');
  gsImgTitle.push('Cultivating Kitty');
  gsImgHeight.push('303');
  txt='This budding young Toon, Cultivating Kitty, sprouted when gardening began in Toontown. As her name suggests, gardening is her Tooniest hobby. After weeding through the pet shop, she picked her Doodle, &quot;Rosebud&quot; ... she&#39;s cream-of-the-crop! Her gag trees consist of Trap and Squirt. This way, she always has her trusty rake for gardening, (or defeating Cogs.) And, of course, Tooniful flowers need water! She has Spring-blooming flowers that match Toontastically with her Estate. Not trying to shovel it on too thick, but ... from her garden, clothing, Doodle, kart, to inside her Estate ... This Toon really digs gardening!';
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'CultivatingKitty2.jpg');
  gsImgTitle.push('Cultivating Kitty');
  gsImgHeight.push('303');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'CultivatingKitty3.jpg');
  gsImgTitle.push('Cultivating Kitty');
  gsImgHeight.push('303');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'Bananabubble1.jpg');
  gsImgTitle.push('Bananabubble');
  gsImgHeight.push('321');
  txt='My Toon garden is special, my flowers reflect my outfit. The Laff-o-Dills reflect my T-shirt and shorts, also my happy attitude. The School Daisy&#39;s represent the rainbow and the gold coins. The coins represent a heart of gold. Also, the Daffy Dill&#39;s represent the piece of clothing that tops off every Toon, with gloves. My gag trees are great if I&#39;m in a hurry and need to get gags. Finally, the tiny Feather tree represents the sprout of new friendship.';
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'Bananabubble2.jpg');
  gsImgTitle.push('Bananabubble');
  gsImgHeight.push('174');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'Bananabubble3.jpg');
  gsImgTitle.push('Bananabubble');
  gsImgHeight.push('321');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'OoopsieDaisie1.jpg');
  gsImgTitle.push('Ooopsie Daisie');
  gsImgHeight.push('129');
  txt='Ooopsie Daisie is an avid gardener and while many bunnies spend Springtime munching flowers, Ooopsie instead enjoys cultivating them. While tending her garden one afternoon, she tripped over her silver shovel (she&#39;s named Ooopsie for a reason!) Jellybeans spilled everywhere! Into her garden sailed a yellow bean, red bean, and three orange beans! Imagine her delight when she discovered a new jellybean combination! In her excitement, she named it Whoopsie Daisie, thus becoming her namesake flower. Her daisy theme continues with her Flowerpot tree and Squirt flower tree, which are fast becoming the talk of the town!';
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'OoopsieDaisie2.jpg');
  gsImgTitle.push('Ooopsie Daisie');
  gsImgHeight.push('291');
  gsImgTxt.push(txt);

  gsImg.push(imgPath+'OoopsieDaisie3.jpg');
  gsImgTitle.push('Ooopsie Daisie');
  gsImgHeight.push('291');
  gsImgTxt.push(txt);
}

function display_images(){

  init_images();

  document.write('<div class="gs_entry">');
    document.write('<div class="gs_btns">');
      document.write('<div class="gs_btns_prvs"><a href="javascript:previous_image()"><img src="'+sharedImgPath+'arrowLeft.gif" width="48" height="70" border="0" alt="Previous"  /></a></div>');
      document.write('<div class="gs_btns_next"><a href="javascript:next_image()"><img src="'+sharedImgPath+'arrowRight.gif" width="48" height="70" border="0" alt="Next"  /></a></div>');
    document.write('</div>');
    document.write('<div id="gs_winner"></div>');
    document.write('<div id="gs_winner_img"><img id="myImage" src="'+gsImg[counter]+'" width="424" height="" alt="" border="0"></div>');
    document.write('<div id="gs_winner_txt"></div>');
  document.write('</div>');

  document.getElementById("myImage").height=gsImgHeight[counter];
  document.getElementById("myImage").alt=gsImgTitle[counter];
  document.getElementById("gs_winner").innerHTML=gsImgTitle[counter];
  document.getElementById("gs_winner_txt").innerHTML=gsImgTxt[counter];
}

function next_image(){
  counter++;
  if (counter >= gsImg.length ){
    counter=0;
  }
  document.getElementById("myImage").src=gsImg[counter];
  document.getElementById("myImage").height=gsImgHeight[counter];
  document.getElementById("myImage").alt=gsImgTitle[counter];
  document.getElementById("gs_winner").innerHTML=gsImgTitle[counter];
  document.getElementById("gs_winner_txt").innerHTML=gsImgTxt[counter];
}

function previous_image(){
  counter--;
  if ( counter < 0 ){
    counter = gsImg.length - 1;
  }
  document.getElementById("myImage").src=gsImg[counter];
  document.getElementById("myImage").height=gsImgHeight[counter];
  document.getElementById("myImage").alt=gsImgTitle[counter];
  document.getElementById("gs_winner").innerHTML=gsImgTitle[counter];
  document.getElementById("gs_winner_txt").innerHTML=gsImgTxt[counter];
}
