project_info = {};
project_info['Super Sudoku'] = ["David Kanarek", "<a href=\"http://itunes.apple.com/us/app/super-sudoku/id320936261?mt=8\">Available on the App Store!</a><br />The popular Sudoku game comes to the App Store yet again! Featuring random board generation so you never get bored and true Sudoku unique-solution puzzles. New to Sudoku or stepping up a difficulty? Let the game help you out by showing you automatic pencil marks, errors, hints and more. Includes a blank board mode for solving puzzles you have elsewhere, just enter the partial solution and press solve.", "FinalProjectImages/Kanarek1.png", "FinalProjectImages/Kanarek2.png", "FinalProjectImages/Kanarek3.png"];
project_info['Workout App'] = ["Jacob Sherin", "This app allows you to customize a workout with exercises. You can add any exercise from the categorized list to your very own workout. Then, instructions and a description will appear for you until you’re ready for the next exercise, then simply scroll to get the next one. For those who don’t want to take the time to pick a workout, you can also get a shuffled workout with different exercises!", "FinalProjectImages/Sherin1.png", "FinalProjectImages/Sherin2.png", "FinalProjectImages/Sherin3.png"];
project_info['AT&T Coverage App'] = ["Jonathan Pezzino", "Ever wonder whether you’re going somewhere where there’s no cell coverage for your iPhone? Been stuck somewhere with no reception and wonder where to go? Well, now there’s an app for that. With the AT&T Coverage Viewer, you can access AT&T coverage data across the entire nation, whether you’re in the center New York City or in the mountains in Alaska with both online and offline modes. Be the master of deadzones!", "FinalProjectImages/Pezzino1.png", "FinalProjectImages/Pezzino2.png", "FinalProjectImages/Pezzino3.png"];
project_info['My Pet Zombie'] = ["Ted Brockly", "Ever wanted your own pet zombie?  Bring a zombie to life on your iphone to take with you wherever you go!  Take care of your zombie by feeding him a balanced diet of brains and cupcakes.  Show your zombie you care by actually petting him with your iphone/ipod Touch!  Teach your zombie to dance by tapping out his moves to the beat!  Your zombie may even start to like you enough to let you dress him up and show him off!<br /><br />Take care of your zombie!<br />Funny cartoon graphics!<br />Unlockable Rewards and Costumes!<br />Feed, Pet, and even Dance with your zombie!", "FinalProjectImages/Brockly1.png", "FinalProjectImages/Brockly2.png", "FinalProjectImages/Brockly3.png"];
project_info['Baby Rhythm'] = ["Jason Martens", "Baby Rhythm is an app that helps you stay sane in the first few months of your infant's life.  It helps you keep track of feedings and diaper changes giving you one less thing to think about.", "FinalProjectImages/Martens1.png", "FinalProjectImages/Martens2.png", "FinalProjectImages/Martens3.png"];
project_info['mPayy'] = ["Isaac Wilson and Eric Chan Lam Choi", "mPayy on the iPhone is as good as cash in your pocket!  This app enables secure electronic transactions directly from your checking account, with the convenience and portability of the iPhone.<br /><br /><i>Leave no debt outstanding</i><br />If you spot someone a couple of dollars, don’t just take an empty promise that they'll pay you back later, use the mPayy App to have them pay you back right away out of their bank account.<br /><br /><i>Fleamarket ATM</i><br />See something you wanted at a fleamarket or yardsale, but don’t have the cash on hand for? Just use the mPayy App to send them the money quickly, safely, and securely.<br /><br /><i>Convenient Recipient List</i><br />The app syncs with your address book so you wont have to input your friends mobile number everytime you wish to make a transaction. There are also functionalities to keep a list of favorites and to view history of recent payees.", "FinalProjectImages/mPayy1.png", "FinalProjectImages/mPayy2.png"];
project_info['InputComm'] = ["Ben Scholbrock", "Want to communicate with the iPhone software, without “jailbreaking” your only phone?  Canʼt apply for the “Made for iPod” program? This app shows a simple method to hack a signal into the phone using the headphone jack! You can write code to read an external data source without needing to bother with private, Apple-proprietary protocols.  The app is built from Appleʼs SpeakHere example, compatible with OS 2.X and 3.0. ", "FinalProjectImages/Scholbrock1.png"];
project_info['Roommates'] = ["Greg Schmidt", "Living with roommates? Need to keep track of Chores many people have to do? Need to keep track of items needed for your apartment/house? Have you forgotten why you owe someone money, or had someone forget they owe you money? With Roommates.app, you won’t forget again! Roommates.app will help you keep track of all the Chores you and others must do, will keep a synchronized list of Things needed in the apartment, and will track the Debts you and your friends owe each other.<br /><br /><i>Features:</i><br />Create and join Groups to sync your data with other people.<br />Chores will track all chores that must be completed, displaying yours separately.<br />Things will track a list of all things that are needed and all things obtained.<br />Debts will track a list of the debts each of your friends owes, including the reason!", "FinalProjectImages/Schmidt1.png", "FinalProjectImages/Schmidt2.png", "FinalProjectImages/Schmidt3.png"];
project_info['RiddleCaching'] = ["Dan Gilk", "RiddleCaching is a new spin on the classic orienteering sport of geocaching. With RiddleCaching, the goal is more complex than finding an item given by certain latitudes and longitudes. Instead, the coordinates will only get you to a locale in the vicinity of your target. It is then up to you to decipher the given riddles and find the cache for yourself. Challenge your friends and go treasure hunting with RiddleCaching!<br /><br />Not only can you find caches and browse through the ones in your area, but you can also create your own caches with a simple interface to our backend database.", "FinalProjectImages/Gilk1.png", "FinalProjectImages/Gilk2.png"];
project_info['TuneBot'] = ['Jeff Hentschel', "Have you ever had a song stuck in your head and couldn't remember the name? Just hum or sing what you remember into Tunebot and let it tell you what song you sung!<br /><br />Integrates with your music library for immediate playback<br />Integrates with the iTunes store to buy the songs you don't have.", "FinalProjectImages/Hentschel1.png", "FinalProjectImages/Hentschel2.png", "FinalProjectImages/Hentschel3.png"];
project_info['Maze'] = ['Patrick Wong', "This is not your average maze game! With fog-of-war, and the ability to change the maze structure with certain power-ups, this will bring back the fun and challenge back in maze-solving.", "FinalProjectImages/Wong1.png", "FinalProjectImages/Wong2.png", "FinalProjectImages/Wong3.png"];
project_info['Image Board Viewer'] = ['Felix Hu', "<a href=\"http://itunes.apple.com/us/app/iimageboard/id329537414?mt=8\">Available on the App Store!</a><br />Image Board Viewer is an app that grabs information from popular image boards and delivers them to your iPhone.<br />With this app, you can:<br />‐ Save and upload images to and from your local Photo Gallery<br />‐ View many types of image files, including .gifs<br />‐ Read threads and posts in a view optimized for the iPhone<br />*This app has been tested with boards from 4chan.org", "FinalProjectImages/Hu1.png"];

projected = false;

$(document).ready(function () {
   $('a.video-link').click(ShowVideo); 
   $('.sidebar-indicator').hide();
   
   $(".sidebar li").hover(function () {$('.sidebar-indicator', this).show();}, function () { $('.sidebar-indicator', this).hide(); });
   $("li.project-title").hover(function () {$('.sidebar-indicator', this).show();}, function () { $('.sidebar-indicator', this).hide(); });
   $("li.project-title").click(function() {onProjectClick(this);});
//   $("li:contains(" + pageTitle + ") .sidebar-indicator").show();
});








function setupFinalProjects() {
    var s = '<div class="fp-images">\
                <div class="fp-screenshot">\
                    <img />\
                </div>\
                <div class="fp-thumbnails">\
                    <div class="fp-thumbnail" id="1">\
                        <img />\
                    </div>\
                    <div class="fp-thumbnail" id="2">\
                    <img />\
                    </div>\
                    <div class="fp-thumbnail" id="3">\
                    <img />\
                    </div>\
                </div>\
             </div>\
             <div class="fp-text">\
                 <div class="fp-author">\
                    <strong>Author:</strong> <span class="author-name"></span>\
                 </div>\
                 <div class="fp-title">\
                    <strong>Project Title:</strong> <span class="selected-project-title"></span>\
                 </div>\
                 <div class="fp-description"></div>\
             </div>';
    $('.sub-main').html(s);
    $(".fp-thumbnail").click(function() {onThumbnailClick(this);});
}

function showProject(projectTitle) {
    if (!projected) {
        setupFinalProjects();
        projected = true;
    }
    $(".fp-thumbnail").hide().removeClass('selected');
    
    var projectArr = project_info[projectTitle];
    $(".selected-project-title").text(projectTitle);
    $(".fp-author .author-name").text(projectArr[0]);
    $(".fp-description").html(projectArr[1]);
    $(".fp-screenshot img").attr('src', projectArr[2]);
    $(".fp-thumbnail#1").addClass('selected');
    $(".fp-thumbnail#1").show();
    $(".fp-thumbnail#1 img").show().attr('src', projectArr[2]);
    
    if (projectArr.length > 3) {
        $(".fp-thumbnail#2").show();
        $(".fp-thumbnail#2 img").show().attr('src', projectArr[3]);
    }
    if (projectArr.length > 4) {
        $(".fp-thumbnail#3").show();
        $(".fp-thumbnail#3 img").show().attr('src', projectArr[4]);
    }
    
}

function onProjectClick(project_el) {
    var projectTitle = $('.project-link', project_el).text();
    showProject(projectTitle);
}

function onThumbnailClick(thumbnail_el) {
    $('.fp-thumbnail').removeClass('selected');
    $(thumbnail_el).addClass('selected');
    var imgURL = $('img', thumbnail_el).attr('src');
    
    $(".fp-screenshot img").attr('src', imgURL);
}

function ShowVideo (evt) {
    a_tag = $(evt.target);
    filename = a_tag.attr('id');
    var s1 = new SWFObject('../mediaplayer/player.swf','player','320','240','8');
    s1.addParam('allowfullscreen','true');
    s1.addParam('allowscriptaccess','always');
    s1.addParam('flashvars','file=../ndnichols/movies/' + filename);
    s1.write('video-preview');
}
