var currentIndx, MyImages, Messages, tipIndex;

currentIndx = 0;
MyImages = [];
MyImages[0] = 'images/characters/FemaleMayor_img.png';
MyImages[1] = 'images/characters/GiftShop_img.png';
MyImages[2] = 'images/characters/mariaimg.png';
MyImages[3] = 'images/characters/jennaimg.png';
MyImages[4] = 'images/characters/billimg.png';
MyImages[5] = 'images/characters/raymondimg.png';
MyImages[6] = 'images/characters/postmasterimg.png';
MyImages[7] = 'images/characters/monkimg.png';
MyImages[8] = 'images/characters/Bots_img.png';
MyImages[9] = 'images/characters/Twins_img.png';
MyImages[10] = 'images/characters/DGG_img.png';
MyImages[11] = 'images/characters/Angel_img.png';
MyImages[12] = 'images/characters/HeartCart_img.png';
MyImages[13] = 'images/characters/FlowerShop_img.png';
MyImages[14] = 'images/characters/PetShop_img.png';
MyImages[15] = 'images/characters/FrameShop_img.png';
MyImages[16] = 'images/characters/Tailor_img.png';


Messages = [];

Messages[0] = '<strong>Mayor Gloria Grand</strong><br>Gloria Grand started small, organizing grassroots campaigns to promote widespread acts of kindness and charitable giving. She became an inspiration to everyone she worked with and eventually led her crew of caring folks to A Better World, where soon thereafter, she was elected mayor.';

Messages[1] = '<strong>Harmony Darling, Gifts & More Owner</strong><br>Gifts and More owner Harmony Darling\'s eclectic wares come from the far reaches of the globe. After traveling the world for years, she settled in A Better World. She maintains contact with an extensive network of friends and contacts that regularly give her great deals on the groovy goods she stocks on her shelves. ';

Messages[2] = '<strong>Clothing Boutique Seamstress: Maria Milano</strong><br>Ever since Maria was a little girl she found joy dressing herself and her dolls. She loved creating new looks from different items around the house. Now as the owner of the Town Clothing Boutique, she brings the latest fashions to A Better World. Through her exquisite fabrics and delicate manners, she lifts the spirits of her patrons.';

Messages[3] = '<strong>Stylist: Mademoiselle Jenna Gentilly</strong><br>Jenna Gentilly is a breath of sunshine and cheer for the whole town. A bonafide Better Worldian by birth, her creative talent stems from her French family background. Her warm personality works its way into a vast variety of fabulous styles available in her Salon.';

Messages[4] = '<strong>Barber: Bill Bigsley</strong><br>Known around Town simply as "Barber Bill," he was a founding figure of A Better World and a charter member of the Better World Barber Shop Quartet. Bills shoppe is legendary, both for quality cuts and the latest Town news. A visit to Bills will leave you looking good and well informed.';

Messages[5] = '<strong>Home Decor Owner: Raymond O\'Rourke</strong><br>Ray\'s eye for interior decorating isn\'t the only thing that makes his store special. He catches on to the tastes of his customers, and provides them with unparallelled service. After working as an art director for the stage and screen, he decided to leave showbiz for a friendlier way of life. Give him a bare wall or an empty table, and he\'ll give you a masterpiece.';

Messages[6] = '<strong>Post Mistress: Sherry Goodly</strong><br>Sherry, the Post Mistress General, is in charge of distributing all of the positive mail throughout A Better World. Her cheery demeanor uplifts the residents and encourages them to send their neighbors the most positive messages possible. The townsfolk are always happy to see her smiling face, bearing good news and kindness.';

Messages[7] = '<strong>Gracius The Monk</strong><br>Gracius is a monk who lives by the Grotto outside of town, and is the resident holy man of A Better World. He studied with sages and mystics around the globe. His most recent traveling brought him here, where stories of the kindness of the residents intrigued him. His warmth and understanding are legendary; he always has a listening ear and an understanding smile.'

Messages[8] = '<strong>FUNZI and FUNZO the Arcade Bots</strong><br>Fully-electric and automated, Funzi and Funzo are programmed for FUN! Originally activated as cleaning robots, these two artificially-intelligent friends found A Better World\'s Arcade to be the most hospitable environment for awesome gaming action.';

Messages[9] = '<strong>Aidan and Nadia Chatsworth, the ChatterBox Twins</strong><BR>Aidan and Nadia love to talk. As toddlers, they\'d babble to each other constantly. No one else knew what they were saying, but they rambled on just the same. Now, whether they\'re telling stories or sharing the latest news, Aidan and Nadia enjoy talking with each other and with all their new friends at ChatterBox.';

Messages[10] = '<strong>Debbie Darby, Director of Do-Good</strong><br>Following in the footsteps of Mayor Grand, Debbie practiced kindness, did good deeds, and served her neighbors from an early age. Her organizational skills and attention to detail landed her a job in Town Hall as the Director of Do-Good. She\'s not only a lover of good deeds, but she believes in rewarding and recognizing those who work hard for the good of others.';

Messages[11] = '<strong>Angelica, Sanctuary Of Hope Angel</strong><br>While the mysterious origins of the Angel of Hope are unknown, we do know that she has lived at the Sanctuary of Hope since the founding of A Better World. She tends the Sanctuary day and night, always offering encouragement to those who seek her there. Her expert knowledge of prayer and positivity provide her visitors with peace and comfort.';

Messages[12] = '<strong>Eliza Hartley, Heart Cart Girl</strong><br>As a teenager, Eliza\'s charm won her the favor of everyone she met. She soon found it difficult to visit with all of her numerous friends, so she put her artistic abilities to use and began creating heart-shaped greetings to send to all of her friends. People loved them so much, they\'d ask to use her designs in their own greetings. And thus, the Heart Cart was born. ';

Messages[13] = '<strong>Greta Garver, Garden Shop Girl</strong><br>Greta grew up on a farm, miles away from her nearest neighbors, so she made friends with the plants in her flower garden. She calls A Better World \"the big city,\" but it’s a nice change of pace she says, \"Especially \'cause folks are so friendly.\" When Greta isn\'t selling seeds, she\'s either in the Community Garden or helping organize the local recycling programs.';

Messages[14] = '<strong>Becky Patel, Better Pets Proprietor</strong><br>Not only does Becky Patel of Better Pets run the best pet shop around, but she\'s an advocate for endangered animals. She\'s been all over the world to see the polar bears of the Arctic, the lions of Africa, and the pandas of China. When the people of A Better World adopt a pet from Becky, they know they\'re getting an animal who\'s been well taken care of and much loved.';

Messages[15] = '<strong>Frida \"Fantastic Frames\" Fernandez</strong><br>Amateur photographer, Frida \"Fantastic Frames\" Fernandez, loves to capture images and display them for her friends. As a girl, she worked in a family portrait shop with her mother, father, and older brother. The only thing she loves more than capturing images is selecting the perfect frame for a gorgeous shot. ';

Messages[16] = '<strong>Michael Feng, Tailor</strong><br>Michael Feng\'s passion for style and fabulous clothing began early in his life. After attending a prestigious fashion school, he decided to set up shop with his own business, rather than working for another designer. He fell in love with A Better World because, \"The people of this town have remarkable taste and they love to flaunt my fabulous fashions.\"';

imagesPreloaded = [];

for (var i = 0; i < MyImages.length; i++)
{
    imagesPreloaded[i] = new Image(120, 120);
    imagesPreloaded[i].src = MyImages[i];
}

function Nexter() {
    if (currentIndx < imagesPreloaded.length - 1) {
        currentIndx = currentIndx + 1;
    } else {
        currentIndx = 0;
    }
		document.getElementById('theimage').src = imagesPreloaded[currentIndx].src;
		document.getElementById('message').innerHTML = Messages[currentIndx];
}

function Backer() {
    if (currentIndx > 0) {
        currentIndx = currentIndx - 1;
    } else {
        currentIndx = 7;
    }
		document.getElementById('theimage').src = imagesPreloaded[currentIndx].src;
		document.getElementById('message').innerHTML = Messages[currentIndx];
}

var quotations = [];
quotations[0] = "The Button Bar at the bottom of the screen helps you explore A Better World. These buttons are shortcuts to your inventory, settings, and different locations in the game.";
quotations[1] = "Level up in A Better World by earning Positive Points for doing good. Leveling up earns you additional rooms, floors, and special rewards!";
quotations[2] = "Better Bucks let you buy special and exclusive items in A Better World.";
quotations[3] = "All the good deeds you perform in A Better World will be rewarded with either Positive Points or Do-Good Gold.";
quotations[4] = "Let your friends know what they mean to you by sending kind messages from The Positive Post in Town.";
quotations[5] = "The Gratitude Grotto is located in A Better World's Countryside. To get there, simply follow the path pointing to the Countryside!";
quotations[6] = "A Better World has two mini-games, ThreeCycle and Thump-A-Thought. To play both games, click on your avatar when you are in your home.";
quotations[7] = "In the mini-game 'Thump-A-Thought,' you are given a number of 'thoughts gremlins' that you need to thump, and you are scored based on time. Simply click on the gremlins in order to thump them out.";
quotations[8] = "The objective of the mini-game 'ThreeCycle' is to match 3 or more recyclable items and rid the grid of rubbish. Earn Do-Good Gold and Positive Points for playing!";
quotations[9] = "Gray Clouds form over your character when you're not doing 'good' in A Better World. Clear them away at the Grotto and the Post, by visiting and gifting to friends, and by doing other good deeds.";
quotations[10] = "Does your friend have a gray cloud? Help them get rid of it by sending them a post, a gift, or visiting them at home!";
quotations[11] = "If you want to change your avatar's appearance, head to Town and go to the Salon for female players, or to the Barber Shop for male players.";
quotations[12] = "Positive Points are experience points in the game. Players achieve these from doing positive activities in A Better World. These will let you move up in levels and have access to exciting new features and goods in the stores.";
quotations[13] = "Friends' Houses are entered either by clicking on their house in the village, or by clicking on your friend in the friends section of the Button Bar.";
quotations[14] = "When you are visiting a friend's house, you can tour their home and check out their room designs and items. You can also give your friends gifts by dragging an item from your inventory into your friend's room.";
quotations[15] = "In your home, you are able to store, display, and arrange items that you purchase in the various shops or that were given to you by a friend!";
quotations[16] = "The size and exterior of your home will continue to grow and improve as you level up through A Better World! Continue playing to see these changes.";
quotations[17] = "When your house reaches three floors, you get an elevator! Use it to travel up and down in style!";
quotations[18] = "When you join A Better World, you can really customize your character! Choose from a cool selection facial features, hair color, hairstyle, to clothing.";
quotations[19] = "The Gratitude Grotto, located in the Countryside, is a place where you can express your gratitude and also see what other players are grateful for.";
quotations[20] = "To vote on others' posts in the Gratitude Grotto, click on either the positive (happy face) or sad (unhappy face) icons. All your votes will earn you Do-Good Gold!";
quotations[21] = "The Positive Post is located in Town, and allows you to send and receive positive messages with your friends. Sending a Positive Post earns you Do-Good Gold!";
quotations[22] = "The Village is where your house is and where you can visit your friend's houses. Point, click, and walk to explore all of the houses in the village!";
quotations[23] = "The Town is a walkable area where the Clothing Boutique, Home Decor, Salon, Barber Shop, Emporium, and Town Hall are located. Simply click on the building facades to enter.";
quotations[24] = "The Countryside is a beautiful, natural setting where you can walk to the Town, the Village and Gratitude Grotto.";

var tipIndex = quotations.length;
function NextTip() {
    if (tipIndex < quotations.length - 1) {
        tipIndex = tipIndex + 1;
    } else {
        tipIndex = 0;
    }
		document.getElementById('quotation').innerHTML = quotations[tipIndex];
}

function BackTip() {
    if (tipIndex > 0) {
        tipIndex = tipIndex - 1;
    } else {
        tipIndex = 7;
    }
		document.getElementById('quotation').innerHTML = quotations[tipIndex];
}

