var images = [
	'images/header_bg.jpg',
	'images/title.png',
	'images/btn_dig_over.png',
	'images/portfolio/eurosport/image_01_large.jpg',
	'images/portfolio/eurosport/image_02_large.jpg',
	'images/portfolio/eurosport/image_03_large.jpg',
	'images/portfolio/eurosport/image_04_large.jpg',
	'images/portfolio/eurosport/image_05_large.jpg',
	'images/portfolio/eurosport/image_06_large.jpg',
	'images/portfolio/eurosport/image_07_large.png',
	'images/portfolio/eurosport/image_08_large.png',
	'images/portfolio/synaptis/image_01_large.png',
	'images/portfolio/synaptis/image_02_large.png',
	'images/portfolio/synaptis/image_03_large.jpg',
	'images/portfolio/osiris/image_01_large.png',
	'images/portfolio/osiris/image_02_large.png',
	'images/portfolio/osiris/image_03_large.png',
	'images/portfolio/rwd/image_01_large.png',
	'images/portfolio/rwd/image_02_large.png',
	'images/portfolio/rwd/image_03_large.png',
	'images/portfolio/easyres/image_01_large.png',
	'images/portfolio/easyres/image_02_large.png',
	'images/portfolio/easyres/image_03_large.png',
	'images/portfolio/emji/image_01_large.png',
	'images/portfolio/emji/image_02_large.png',
	'images/portfolio/emji/image_03_large.png',
	'images/portfolio/acrobat/image_01_large.jpg'
	
];

$(images).each(function() {
	var image = $('<img />').attr('src', this);
});


// Button Rollover
$(document).ready(function(){
 
$('img.a').hover(
	function() {
	$(this).stop().animate({'opacity': '0'}, 'fast');
	},
	function() {
	$(this).stop().animate({'opacity': '1'}, 'normal');
	});
 
});


// Artist Statement Slider
$(document).ready(function(){

	$('.slideArtistStatement').click(function(e){
	   e.preventDefault();
	  $('#artistStatement').slideToggle('slow', 'easeOutQuad');
	  $(this).toggleClass('active');
	  // Closes the timeline if the artist statement is open
	  	if ($('.slideTimeline').is('.active')) { 
			$('#timeline').slideToggle('slow' , 'easeOutQuad');
	 		$('.slideTimeline').toggleClass('active');
		} 
	    
	});
	
});


// Timeline Slider
$(document).ready(function(){

	$('.slideTimeline').click(function(e){
	   e.preventDefault();
	  $('#timeline').slideToggle('slow', 'easeOutQuad');
	  $(this).toggleClass('active');
	  // Closes the artist statement if the timeline is open
	  	if ($('.slideArtistStatement').is('.active')) { 
			$('#artistStatement').slideToggle('slow', 'easeOutQuad');
	 		$('.slideArtistStatement').toggleClass('active');
		} 
	  
	});
	
    // Scrolling
    
    
   $('#timeline li.acrobat').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#acrobat', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeInQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});
	
	$('#timeline li.emji').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#emji', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeOutQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});
	
	$('#timeline li.easyres').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#easyres', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeOutQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});

	$('#timeline li.rwd').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#rwd', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeOutQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});

	$('#timeline li.osiris').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#osiris', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeOutQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});
	
	$('#timeline li.synaptis').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#synaptis', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeOutQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});

	$('#timeline li.eurosport').click(function(e) { 
	  e.preventDefault();
  	  $.scrollTo('#eurosport', 500, function(){
	 	$('#timeline').slideToggle('slow', 'easeOutQuad');
	 	$('.slideTimeline').toggleClass('active');
  		});
	});
	
	
	
	
});


// Center
jQuery.fn.center = function () {
    this.css('position','absolute');
    this.css('top', (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + 'px');
    this.css('left', (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + 'px');
    return this;
}


// Modal
$(document).ready(function() { 
 
    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
        var id = $(this).attr('href');
     
        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
     
        //Set height and width to mask to fill up the whole screen
        $('#mask').css({'width':maskWidth,'height':maskHeight});
         
        //transition effect    
        //$('#mask').fadeIn(1000);   
        $('#mask').fadeTo('normal',0.97); 
     
        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();
               
        //Set the popup window to center
        $(id).css('top',  winH/2-$(id).height()/2);
        $(id).css('left', winW/2-$(id).width()/2);
		    
        //transition effect
        $(id).fadeIn(1000);
	
		//center function
		$('#portfolio .window').center();
		
		//redundant code for older browsers
		var maskHeight = $(document).height();
        var maskWidth = $(window).width();
     
        //Set height and width to mask to fill up the whole screen
        $('#mask').css({'width':maskWidth,'height':maskHeight});
	
    });
     
    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
		$('#mask, .window').fadeOut(600);
        //$('#mask, .window').hide();
	
    });    
     
    //if mask is clicked
    //$('#mask').click(function () {
        //$(this).hide();
        //$('.window').hide();
    //});       
     
});


//Portfolio Image Replacement

$(window).load(function() {
	$('#contentEurosport #thumbs a').click(function(evt) {
		//don't follow link
		 evt.preventDefault();
		$('.activeEurosport').removeClass('activeEurosport');
  		$(this).addClass('activeEurosport');
		$('#contentEurosport #projectName h2').html($(this).attr('title'));
		 //get path to new image
	   	 var imgPath = $(this).attr('href');
	   
		 //get reference to old image
		 var oldImage = $('#contentEurosport #images img');
					
		 //create HTML for new image
	     var newImage = $('<img src="' + imgPath +'">');
			 	
  			$('#contentEurosport #images').css({'height': $('#contentEurosport #images img').height()});
			 
			 //make new image invisible
			 newImage.hide();
			 //add to the #photo div
			 $('#contentEurosport #images').prepend(newImage); 
			 //fade in new image
			 newImage.fadeIn(500);		
		 	//fade out old image and remove from DOM
			 oldImage.fadeOut(500,function(){
		     $(this).remove();
		     $('#contentEurosport #images').css({'height': $('#contentEurosport #images img').height()});
				});
			 	
	}); // end click
		
		$('#contentEurosport #thumbs a:first').click();


$('#contentSynaptis #thumbs a').click(function(evt) {
		//don't follow link
		 evt.preventDefault();
		$('.activeSynaptis').removeClass('activeSynaptis');
  		$(this).addClass('activeSynaptis');
		$('#contentSynaptis #projectName h2').html($(this).attr('title'));
		 //get path to new image
	     var imgPath = $(this).attr('href');
		 //get reference to old image
		 var oldImage = $('#contentSynaptis #images img');
		//create HTML for new image
	    var newImage = $('<img src="' + imgPath +'">');
			 	
  		$('#contentSynaptis #images').css({'height': $('#contentSynaptis #images img').height()});
	 	
	 	//make new image invisible
		newImage.hide();
		
		//add to the #photo div	 
		 $('#contentSynaptis #images').prepend(newImage); 
		//fade in new image
		newImage.fadeIn(500);
		 //fade out old image and remove from DOM
			 oldImage.fadeOut(500,function(){
		     $(this).remove();
		     $('#contentSynaptis #images').css({'height': $('#contentSynaptis #images img').height()});
				});	 
		
	}); // end click
		
		$('#contentSynaptis #thumbs a:first').click();
		
		
$('#contentOsiris #thumbs a').click(function(evt) {
		//don't follow link
		 evt.preventDefault();
		$('.activeOsiris').removeClass('activeOsiris');
  		$(this).addClass('activeOsiris');
		$('#contentOsiris #projectName h2').html($(this).attr('title'));
		 //get path to new image
	     var imgPath = $(this).attr('href');
		 //get reference to old image
		 var oldImage = $('#contentOsiris #images img');
		//create HTML for new image
	    var newImage = $('<img src="' + imgPath +'">');
			 	
  		$('#contentOsiris #images').css({'height': $('#contentOsiris #images img').height()});
	 	
	 	//make new image invisible
		newImage.hide();
		
		//add to the #photo div	 
		 $('#contentOsiris #images').prepend(newImage); 
		//fade in new image
		newImage.fadeIn(500);
		 //fade out old image and remove from DOM
			 oldImage.fadeOut(500,function(){
		     $(this).remove();
		     $('#contentOsiris #images').css({'height': $('#contentOsiris #images img').height()});
				});	 
		
	}); // end click
		
		$('#contentOsiris #thumbs a:first').click();


$('#contentRWD #thumbs a').click(function(evt) {
		//don't follow link
		 evt.preventDefault();
		$('.activeRWD').removeClass('activeRWD');
  		$(this).addClass('activeRWD');
		$('#contentRWD #projectName h2').html($(this).attr('title'));
		 //get path to new image
	     var imgPath = $(this).attr('href');
		 //get reference to old image
		 var oldImage = $('#contentRWD #images img');
		//create HTML for new image
	    var newImage = $('<img src="' + imgPath +'">');
			 	
  		$('#contentRWD #images').css({'height': $('#contentRWD #images img').height()});
	 	
	 	//make new image invisible
		newImage.hide();
		
		//add to the #photo div	 
		 $('#contentRWD #images').prepend(newImage); 
		//fade in new image
		
		newImage.fadeIn(500);
		
		 //fade out old image and remove from DOM
			 oldImage.fadeOut(500,function(){
		     $(this).remove();
		     $('#contentRWD #images').css({'height': $('#contentRWD #images img').height()});
				});	 
		
	}); // end click
		
		$('#contentRWD #thumbs a:first').click();


$('#contentEasyres #thumbs a').click(function(evt) {
		//don't follow link
		 evt.preventDefault();
		$('.activeEasyres').removeClass('activeEasyres');
  		$(this).addClass('activeEasyres');
		$('#contentEasyres #projectName h2').html($(this).attr('title'));
		 //get path to new image
	     var imgPath = $(this).attr('href');
		 //get reference to old image
		 var oldImage = $('#contentEasyres #images img');
		//create HTML for new image
	    var newImage = $('<img src="' + imgPath +'">');
			 	
  		$('#contentEasyres #images').css({'height': $('#contentEasyres #images img').height()});
	 	
	 	//make new image invisible
		newImage.hide();
		
		//add to the #photo div	 
		 $('#contentEasyres #images').prepend(newImage); 
		//fade in new image
		
		newImage.fadeIn(500);
		
		 //fade out old image and remove from DOM
			 oldImage.fadeOut(500,function(){
		     $(this).remove();
		     $('#contentEasyres #images').css({'height': $('#contentEasyres #images img').height()});
				});	 
		
	}); // end click
		
		$('#contentEasyres #thumbs a:first').click();


	$('#contentEMJI #thumbs a').click(function(evt) {
		//don't follow link
		 evt.preventDefault();
		$('.activeEMJI').removeClass('activeEMJI');
  		$(this).addClass('activeEMJI');
		$('#contentEMJI #projectName h2').html($(this).attr('title'));
		 //get path to new image
	     var imgPath = $(this).attr('href');
		 //get reference to old image
		 var oldImage = $('#contentEMJI #images img');
		//create HTML for new image
	    var newImage = $('<img src="' + imgPath +'">');
			 	
  		$('#contentEMJI #images').css({'height': $('#contentEMJI #images img').height()});
	 	
	 	//make new image invisible
		newImage.hide();
		
		//add to the #photo div	 
		 $('#contentEMJI #images').prepend(newImage); 
		//fade in new image
		
		newImage.fadeIn(500);
		
		 //fade out old image and remove from DOM
			 oldImage.fadeOut(500,function(){
		     $(this).remove();
		     $('#contentEMJI #images').css({'height': $('#contentEMJI #images img').height()});
				});	 
		
	}); // end click
		
		$('#contentEMJI #thumbs a:first').click();

});



//Portfolio Project Description Selection

$(document).ready(function(){

  $('#contentEurosport #thumbs li#text1').click(function() {
  	$('#contentEurosport #projectDescription').html("Spotlights are the main selling vehicles on the home page of soccer.com.  With limited space and a tight turnaround, they're basically large banners, but it's an industry-wide concept that does the trick. At least 4 spotlights are created each week that can be put into email templates as needed.");
  	});
  $('#contentEurosport #thumbs li#text2').click(function() {
  	$('#contentEurosport #projectDescription').html("Being authentic comes up a lot in marketing but it's especially hard to earn back credibility with fans (i.e. customers) if you misrepresent their country or club jersey.");
  	});
  $('#contentEurosport #thumbs li#text3').click(function() {
  	$('#contentEurosport #projectDescription').html("Very seldom do males get worked up over shoes as much as new expensive soccer boots.  Authenticity plays a role, but it's even more important to make the product look amazing via impactful photography and post-production.");
  	});
  $('#contentEurosport #thumbs li#text4').click(function() {
  	$('#contentEurosport #projectDescription').html("10% off messages flood my in-box daily.  Very few make me feel I need to act immediately.  It's a creative challenge that I try to embrace every time it comes up.");
  	});
  $('#contentEurosport #thumbs li#text5').click(function() {
  	$('#contentEurosport #projectDescription').html("Most major vendors have ad agencies provide some type of creative for their larger campaigns.  The key is to be able to integrate internal assets to make a cohesive presentation.");
  	});
  $('#contentEurosport #thumbs li#text6').click(function() {
  	$('#contentEurosport #projectDescription').html("eCatalog makers are pretty ubiquitous these days.  In 2006 there were only a couple players in the field offering a handful of expensive solutions.  Consequently, I had the laborious task of building an application from scratch.  Now I know why people pay for these services.");
  	});
  $('#contentEurosport #thumbs li#text7').click(function() {
  	$('#contentEurosport #projectDescription').html("This was a small game created to promote the 2006 World Cup in Germany. Most of the graphics and animation were rendered in Swift3D then imported into Flash. Lego has not filed a lawsuit yet.");
  	});
  $('#contentEurosport #thumbs li#text8').click(function() {
  	$('#contentEurosport #projectDescription').html("In 2009 adidas requested an upload-your-photo application to go along with their 12th Man campaign.  I created 5 of these, each for their main sponsored teams. That same year in the Communication Arts Interactive Design Annual there was a comment from one of the judges saying that if they saw another upload-your-photo site they would go nuts.");
  	});
  	
  	
  $('#contentSynaptis #thumbs li#text1').click(function() {
  	$('#contentSynaptis #projectDescription').html("A Flash-based general promotional CD used for mailers and prospective client takeaways at trade shows and sales meetings. I also recorded the voice-overs and music beds.");
  	});
  $('#contentSynaptis #thumbs li#text2').click(function() {
  	$('#contentSynaptis #projectDescription').html("PNM is New Mexico's largest electricity provider.  These were part of a an eLearning interface for their migration to PeopleSoft focusing on the efficiencies of the new system vs their old one.");
  	});
  $('#contentSynaptis #thumbs li#text3').click(function() {
  	$('#contentSynaptis #projectDescription').html("Building a well designed eLearning course is a complex task and takes some skill.  These were part of internal training for putting together a Learning Design Plan using the analogy of house construction.");
  	});
  $('#contentSynaptis #thumbs li#text4').click(function() {
  	$('#contentSynaptis #projectDescription').html("Trade Shows are a necessary evil.  Thankfully designing the booths are more enjoyable than participating and it's pretty rewarding to see your work at 6' x 9'.");
  	});
  	
  	
  $('#contentOsiris #thumbs li#text1').click(function() {
  	$('#contentOsiris #projectDescription').html("With this I said goodbye to HTML and embraced full Flash websites. No more would I be limited by cross-platform browser incompatibility and display issues. Eventually we all learn it's better in theory than in practice.");
  	});
  $('#contentOsiris #thumbs li#text2').click(function() {
  	$('#contentOsiris #projectDescription').html("<p>The desconstructed Egyptian motifs and orbital paterns for this card always remind me of the movie Stargate... for better or worse.</p>");
  	});
  $('#contentOsiris #thumbs li#text3').click(function() {
  	$('#contentOsiris #projectDescription').html("It's hard think of a client I looked forward to visiting on site more than House-Autry.  Aside from being pleasant and easy to work with, their offices had a noticable smell of flour and spice that made you want to fry something.");
  	});
  	
  $('#contentRWD #thumbs li#text1').click(function() {
  	$('#contentRWD #projectDescription').html("This promotional CD project was the last time I used Macromedia Director. After that, Flash took over as my primary interactive tool. I remember being a bit upset having to ditch Lingo for ActionScript.");
  	});
  $('#contentRWD #thumbs li#text2').click(function() {
  	$('#contentRWD #projectDescription').html("<p>Latitude360 creative used a lot of green, so much so that I still have some initial hesitancy choosing to work with those hues.</p>");
  	});
  $('#contentRWD #thumbs li#text3').click(function() {
  	$('#contentRWD #projectDescription').html("<p>One of many 1-sheets and mailers done to promote eLearning services.</p>");
  	});
  	
  	
  $('#contentEasyres #thumbs li#text1').click(function() {
  	$('#contentEasyres #projectDescription').html("<p>The interfaces had to be easily customizable to accomodate different business types and booking system complexity.</p>");
  	});
  $('#contentEasyres #thumbs li#text2').click(function() {
  	$('#contentEasyres #projectDescription').html("<p>Easyres wanted to position itself as a one-stop resource for its clients by offering brochure and catalog marketing services.</p>");
  	});
  $('#contentEasyres #thumbs li#text3').click(function() {
  	$('#contentEasyres #projectDescription').html("At around 40 pages, this was the largest print piece I have worked on by myself. It definitely made me aware of how much more I enjoyed doing interactive design.");
  	});
  	
  	
  	
 $('#contentEMJI #thumbs li#text1').click(function() {
  	$('#contentEMJI #projectDescription').html("1999 is getting a little hazy but I do remember this site being a bit of a beast to complete. The complexities of health care do not change all that much except for the costs increasing.");
  	});
  $('#contentEMJI #thumbs li#text2').click(function() {
  	$('#contentEMJI #projectDescription').html("Bear Rock Cafe had a promising start but the francise seems to have fallen on harder times.  They used this version for at least 3 years which I always thought was flattering considering that's an eternity in web years.");
  	});
  $('#contentEMJI #thumbs li#text3').click(function() {
  	$('#contentEMJI #projectDescription').html("<p>This was another very detailed project but it reminded me of my childhood Tonka toys so I kept a pretty good attitude.</p>");
  	});
 	
  
});



