		
		var numberOfItems = 15;
		var currentID = '';
		var visitedLinks = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
		
		function emptyContent() {
			$('#main').empty();
			$('#textContent').empty();
		}
	
		function loadContent(contentID) {
			$('#main').fadeOut('fast', function () {
				$('#main').append('<a class="lightbox" href="img/portfolio' + contentID + '.jpg"> <img src="img/portfolio' + contentID + '_thumb.jpg"/></a>');
				$('#main').fadeIn('slow');
				$('a.lightbox').lightBox(); // Select all links with lightbox class
			});
		}
		
		function loadText(contentID) {
			currentID = contentID;
			if(contentID == "portfolio")
			{
				visitedLinks[15] = 1;
			}
			else if(contentID == "contact")
			{
				visitedLinks[16] = 1;
			}
			else if(contentID == "music")
			{
				visitedLinks[17] = 1;
			}
			else
			{
				visitedLinks[contentID-1] = 1;
			}
			$('#textContent').fadeOut('fast', function () {
				if(contentID == 1)
				{
					$('#textContent').append('<h2>Chromocam Dots</h2><p>Paid App</p><p>A new style of iPhoneography app, featured in the New and Noteworthy section of the iTunes front page.  Creates abstract artwork in a simple and fun way.  See <a href="http://www.chromocam.com">chromocam.com</a> for more info.</p><p>A one-man project, I handled development, design, marketing, web design, and testing coordination.  Includes twitpic integration, and unlike many iPhoneography applications, stable full-resolution export and proper orientation.</p><p>Featured on <a href="http://www.creativeapplications.net/iphone/chromocam-dots-iphone/">CreativeApplications.Net</a>, <a href="http://pocketplastic.com/app-review-chromocam-dots">Pocket Plastic</a>, <a href="http://the-palm-sound.blogspot.com/2010/05/chromocam-dots.html">The Palm Sound</a>, and <a href="http://topapps.eu/chromocam-dots-iphone-app-review/">topapps.eu</a>');
				}
				if(contentID == 2)
				{
					$('#textContent').append('<h2>My Tie</h2><p>Developed for New Morgan Studios</p><p>Multiple localizations integrated into this app resulted in the app consistantly being in the Top 10 Paid apps in multiple countries.</p><p>My Tie shows you step by step guides to six of the most popular necktie knots. Each step includes instructions and a photo view. My Tie is easy to navigate, simply swipe from step to step. My Tie is the best way to keep all these knots right in your pocket.</p>');
				}
				if(contentID == 3)
				{
					$('#textContent').append('<h2>iPhone Animal Kill Counter</h2> <p>Free App</p> <p>An informational counter showing the numbers of animals slaughtered every second, worldwide. The app is a favorite of the vegan and vegetarian community, and has been downloaded over 10,000 times.</p> <p>The Animal Kill Counter was first made available by Barna Mink, whom I would like to thank for introducing such a poignant piece of material.  Additional assistance was given by Action for Animals Kansas.</p> <p>The counter featured in this app is based off of 2003 statistics published by the Food and Agriculture Organization of the United Nations. The United States consumes almost 20% of land animals slaughtered with less than 5% of the world\'s population.</p>');
				} 
				if(contentID == 4)
				{
					$('#textContent').append('<h2>Farm Clock & Cafe Clock</h2> <p>Paid Apps</p> <p>Taking advantage of the wave of social games overtaking much of the world\'s social networks, these apps are utilities designed to help the user track the crops, trees, dishes, and animals in their facebook games.  The app uses an SQLite database to store all of the different items and integrates content updates as simple to maintain XML files.</p>');
				} 
				if(contentID == 5)
				{
					$('#textContent').append('<h2>iRorschach</h2><p>Paid App</p><p>iRorschach is an application that lets you administer the classic Rorschach Inkblot psychological test. First, the user scrolls through the actual inkblots first created by Herman Rorschach, which have been used for almost a century. After the user has deciphered the images for themself, a review of each card is presented, with common answers, commentary for each card, and general tips and analysis for the test as a whole.</p>');
				} 
				if(contentID == '6')
				{
					$('#textContent').append('<h2>Slider App</h2><p>In Development for a Client</p><p>A quickly made custom slider app, with the ability to remotely update content by simply editing a line of XML and uploading new images to a web server.  Tracks user time, has multiple difficulty levels, includes sound effects, and runs smoothly.</p>');
				} 
				if(contentID == '7')
				{
					$('#textContent').append('<h2>iDreamIt</h2><p>Developed for Michelle Andrews</p><p>An app to turn your dreams into lotto numbers using pythagorean numerology.  The client was very pleased with this app, as she won $500 within a week of contracting the app in the pick 3 Michigan lottery.</p>');
				} 
				if(contentID == '8')
				{
					$('#textContent').append('<h2>Prototype Twitter App</h2><p>Unreleased</p><p>A basic twitter app, done as an exercise.</p>');
				} 
				if(contentID == '9')
				{
					$('#textContent').append('<h2>ARDJ</h2><p>Interactive Art Exhibit</p><p>People Doing Strange Things With Electricity<br>Seattle, WA 2009</p><p>Augmented Reality (AR) technology meets digital DJing. Show sponsored by the Andy Warhol Foundation.  Videos <a href="http://www.youtube.com/user/djayuh#p/u/19/kUsJ_5_DTO0">here</a>.</p><p>Coverage <a href="http://www.synthtopia.com/content/2009/07/21/ardj-augmented-reality-dj-system/">here</a>, <a href="http://www.workingdj.com/2009/07/22/djing-with-scraps-of-paper/">here</a>, and <a href="http://www.sequencer.de/blog/?p=6170">here</a>.</p><p>Source and downloads <a href="http://www.lipert.net/ardj/">here</a>.</p>');
				} 
				if(contentID == '10')
				{
					$('#textContent').append('<h2>ARDJ v1.5</h2><p>Free Open Source Software</p><p>Shadow Art Fair<br>Ypsilanti, MI 2009</p><p>Augmented Reality DJ Software for Mac OS X.  A sequel to the interactive art exhibit. Videos <a href="http://www.youtube.com/watch?v=ccTHPE1QeJQ">here</a>.</p><p>Coverage <a href="http://ar.m-ato.me/tag/ardj/">here</a>, and <a href="http://audiolemon.blogspot.com/2010/01/how-to-use-ar-midi-tool-with-augmented.html">here</a>.</p><p>Source and downloads <a href="http://www.lipert.net/ardj/">here</a>.</p>');
				} 
				if(contentID == '11')
				{
					$('#textContent').append('<h2>Petalix</h2><p>Typeface</p><p>A chunky grid-based typeface. Ideal for posters or titles.  Sharp, edgy, and organic.');
				} 
				if(contentID == '12')
				{
					$('#textContent').append('<h2>Kawaiinails.com</h2><p>Website Installation and Development</p><p>Installation of ZenCart, plus many custom modifications.</p>');
				} 
				if(contentID == '13')
				{
					$('#textContent').append('<h2>Arduinome</h2><p>Custom Electronic Music Interface</p><p>Custom homebrew "monome" done with arduino processor.  Interfaces with open source software to explore creating electronic music in innovative and unconventional ways.</p>');
				} 
				if(contentID == '14')
				{
					$('#textContent').append('<h2>Processing Sketches</h2><p>Generative Graphics</p><p>Experimental processing sketches exploring the algorithms behind early \'Demoscene\' style graphics.  Sketches at <a href="http://www.openprocessing.org/portal/?userID=3033">openprocessing.org</a>.  Also a part of the <a href="http://www.rmx.cz/monsters/">Processing Monsters</a> project.</p>');
				} 
				if(contentID == '15')
				{
					$('#textContent').append('<h2>Personal Blog</h2><p>Design, Development, & Content</p><p>Custom tumblr theme with multiple hacks.  All pages use the same html, with additional Javascript, JQuery, and JFeed, as well as numerous CSS & API tricks. Content updates focus on software development, freelancing, app reviews, and personal creative projects. </p><p> <a href="http://blog.lipert.net">blog.lipert.net</a></p>');
				} 
				if(contentID == 'portfolio')
				{
					$('#textContent').append('<h2>Portfolio</h2><p>Welcome.</p><p>I am a freelance software developer focusing on lightning fast turnaround pop-software development as well as creative abstractions of computer science.  I graduated from the University of Michigan with a Bachelor\'s of Science in Electrical Engineering.  I have recently moved back to Portland, OR and I am currently seeking freelance projects, creative collaborators, and co-conspirators.</p><p>Resume and references upon request.</p><p>This design is a collaboration between myself and <a href="http://www.laura-andrews.com">Laura Andrews</a>.</p>');
				} 
				if(contentID == 'contact')
				{
					$('#textContent').append('<h2>Contact</h2><p>If you are interested in my work and would like to work together, collaborate or just chat, feel free to send me an e-mail.</p> <p><a href="mailto:danlipert@gmail.com">danlipert@gmail.com</a></p> <p>Phone: (513) 327-8370</p> <p>I can provide my CV and references upon request. Send me an e-mail and I will get back to you as soon as I can.</p>');
				}
				if(contentID == 'music')
				{
					$('#textContent').append('<h2>Music</h2> <p><a href="http://www.soundcloud.com/easterislandhead">Soundcloud</a></p> <p><a href="http://8bitcollective.com/members/easterislandhead/">8bitcollective</a><p><a href="http://www.myspace.com/easterislandhead">Myspace</a></p> <p><a href="http://www.youtube.com/djayuh">YouTube</a></p>');
				}
					$('#textContent').fadeIn('slow');
			});
		}
				
		function changeColor(id) { 
			element = document.getElementById(id); 
			element.style.color = getColorFromID(id);
		} 
		
		function resetColor(id) { 
			if(id == "portfolio")
			{
				if(visitedLinks[15] == 0)
				{
					element = document.getElementById(id); 
					element.style.color = '#777'; 
				}
			}
			else if(id == "contact")
			{
				if(visitedLinks[16] == 0)
				{
					element = document.getElementById(id); 
					element.style.color = '#777'; 
				}
			}
			else if(id == "music")
			{
				if(visitedLinks[17] == 0)
				{
					element = document.getElementById(id); 
					element.style.color = '#777'; 
				}
			}


			else if(visitedLinks[id-1] == 0)
			{
				element = document.getElementById(id); 
				element.style.color = '#777'; 
			}
		} 
		
		function changeHeaderColor(id) {
			headerElement = document.getElementById('header');
			headerElement.style.color = getColorFromID(id);
		}
		
		function getColorFromID(id) {
			if(id == '0')
			{
				returnColor = '#FF0000';
			} else if(id == '1') {
				returnColor = '#ACDFE8';
			} else if(id == '2') {
				returnColor = '#CCCBCA';
			} else if(id == '3') {
				returnColor ='#D4CB97';
			} else if(id == '4') {
				returnColor = '#FE8A7E';
			} else if(id == '5') {
				returnColor = '#FF2676';
			} else if(id == '6') {
				returnColor = '#965EA6';
			} else if(id == '7') {
				returnColor = '#57CAFF';
			} else if(id == '8') {
				returnColor = '#A3ED53';
			} else if(id == '9') {
				returnColor = '#91EAED';
			} else if(id == '10') {
				returnColor = '#71C4D0';
			} else if(id == '11') {
				returnColor = '#D8BADB';
			} else if(id == '12') {
				returnColor = '#D1EE68';
			} else if(id == '13') {
				returnColor = '#EDC168';
			} else if(id == '14') {
				returnColor = '#ED9482';
			} else if(id == '15') {
				returnColor = '#ED8282';
			} else if(id == 'portfolio') {
				returnColor = '#9C266A';
			} else if(id == 'contact') {
				returnColor = '#955283';
			} else if(id == 'music') {
				returnColor = '#AED8BB';
			}
			return returnColor;
		}
		

