$(document).ready(function(){

    /***************************************************************
     * SETUP UP GLOBAL VARS & ARRAYS.                             	 *
     *                                                          		 *
     ***************************************************************/
    var arr           = [$('#thumbsbg'), $('.coda-nav'), $('.thleft a'), $('.thright a')];
    var arrWork       = [$('#coda-nav-left-1'), $('#work'), $('#coda-nav-right-1')];
    var btns          = [$('.thumbPrev'), $('.thumbNext'), $('.moreInfo'), $('.launchPro')];
    var arrY          = ['200px', '180px', '250px', '190px', '200px', '140px', '180px','75px', '90px',   '190px']
    var arrX          = ['320px', '100px', '90px' , '350px', '320px', '370px', '340px', '310px', '350px','250px']
		var arrContent    = ['<ul><li>McDonalds</li><li>Burrell</li><li>Art Direction, Flash Development (AS 3.0, OOP)</li></ul>', 
													'<ul><li>Toyota</li><li>Burrell Communications</li><li>Art Direction, Flash Development (AS 3.0, OOP)</li></ul>', 
													'<ul><li>American Airlines</li><li>Burell Communications</li><li>Art Direction, Flash Development (AS 3.0, OOP)</li></ul>', 
													'<ul><li>Burrell Communications</li><li>Jeph Johnson</li><li>Art Direction,  Flash Development (AS 3.0, OOP)</li></ul>', 
													'<ul><li>Barclay Metals</li><li>Jeph Johnson</li><li>Wordpress child theme(Art Direction, Design & Development), Market Widget(Php), Logo Design</li></ul>',
													'<ul><li>DFS</li><li>Scentsa</li><li>Interactive kiosk: Art Direction, Design</li></ul>',
													'<ul><li>RCI</li><li>BGT Partners</li><li>Microsite: Art Direction,  Flash Development (AS 3.0, GAIA Frameworks, OOP)</li></ul>',
													'<ul><li>IBOT</li><li>JWT</li><li>Art Direction, Design,<br/>Flash Development (AS 3.0, XML)</li></ul>',
													'<ul><li>Santa Margherita</li><li>The Well</li><li>Art Direction, Design</li></ul>',
													'<ul><li>X.Y.Z. Boutique</li><li>Jeph Johnson</li><li>Art Direction, Design</li></ul>']
    
		var arrayOfImages =  ['images/projects/mcd/burger.png', 
													'images/projects/mcd/nugs.png', 
													'images/projects/mcd/spoon.png', 
													'images/projects/toyota/rav4/rav4.png', 
													'images/projects/toyota/prius/prius_car.png',  
													'images/projects/toyota/corolla/corolla.png', 
													'images/projects/mcd/burger.png', 
													'images/projects/mcd/nugs.png', 
													'images/projects/mcd/spoon.png', 
													'images/projects/aa/black_pumps.png', 
													'images/projects/burrell/orna.png', 
													'images/projects/barclay/gold.png', 
													'images/show_bg.png', 
													'images/mcd_logo.png', 
													'images/toyota_logo.png', 
													'images/aa_logo.png', 
													'images/burrell_logo.png', 
													'images/barclay_logo.png', 
													'images/projects/aa/board.png', 
													'images/hello.png', 
													'images/sayhello.png',
													'images/projects/ibot/pumpkin.png',
													'images/projects/ibot/abe.png',
													'images/projects/santa/santa.png',
													'images/projects/xyz/coco.png']

    var intrans;
    var onetime;
    var $this = $('body');
    var percentCounter = 0;
		var imgs;
		var location= $('nav ul li a').attr("href");
		var swipeOptions = {triggerOnTouchEnd: true,swipeStatus: swipeStatus,allowPageScroll: "vertical",threshold: 200}
		$(function () {imgs = $(".panel");imgs.swipe(swipeOptions);});
   	$(window).load(function() {init();});
		
		function loader() {
        $(arrayOfImages).each(function (i, value) {
            var lastID =arrayOfImages.length - 1;
            $('<img/>')[0].src = this;
            if (i == lastID) {
                $(this).queue("fx", function () { 
                    //alert(this);
                    percentCounter = (i / arrayOfImages.length) * 100;
                });
            } else {
                //alert("hello");
            }
        });
				$('#loader').stop().fadeIn("fast"), function () {}

    }
		
		function init() {
        //alert("hello");
				for (var i = 0; i <= 17; i++) {
            $('.show' + i).cycle({
                fx: 'fade',
                speed: 200,
                continuous: 1
            });
        }
        for (var i = 0; i <= arrX.length; i++) {
            $('.item' + i + ' img').css({
                'padding-left': arrX[i],
                'padding-top': arrY[i]
            });
            $('.rightinfo' + i).html(arrContent[i]);
        }
				//remove preloader///
				$('#loader img').stop().fadeOut("slow"), function () {$(this).remove()}
        //fade in work section
        $('.container').stop(true, true).fadeIn('slow', function () {})
				//fade in my thumbnails////
				
				/*$('.item0 img').css({'opacity': 0,'filter': 'alpha(opacity=0)'})
				 $('.item0 img').stop(true, true).delay(500).animate({
           'padding-top': 200,
					 'opacity': 1,
            duration: 600,
            easing: "BackeaseOutExpo",
            complete: function () {}
        });
				*/
				
				
				//twitter/////
        $('#tweets').tweetable({
            username: 'JephJohnson',
            time: true,
            limit: 3,
            replies: true,
            position: 'append'
        });
				//rss feed////
        $('#test').rssfeed('http://instagram.heroku.com/users/3870178.atom', {
            limit: 4,
            header: false
        });
        //set up my active link
        //$('nav ul li a').first().addClass('active1');
				//$('.navSlider img').css({'opacity': 1,'filter': 'alpha(opacity=1)'})
			
        $('.navSlider img').stop(true, true).animate({opacity: 1}, 100);
				//$(this).find("a").addClass("coda-nav ul li a.current")
   			
				///////////EMAIL CAPTCHA//////////////////////////////
				$("a[rel='email']").each(function(){
						// Modify the mailto: value
						var mailtoVal = $(this).attr('href');
						mailtoVal = mailtoVal.replace("[email]","mailto:");
						mailtoVal = mailtoVal.replace("[at]","@");
						mailtoVal = mailtoVal.replace("[dot]",".");
						// Auto-generate title tags for users
						var mailtoTitle = mailtoVal.replace("mailto:","Email: ");
						$(this).attr('title',mailtoTitle);
						// onClick Event
						$(this).click(function(){
							window.location.href = mailtoVal;
							return false;
						});
				});
				/////////////////////////////////////////////////////
    }
    
		/////Jquery Address /////
    $.address.init(function (event) {}).change(function (event) {
				switch ($.address.value()) {
        case "/work":
            $('nav ul li a').first().addClass('active1');
						$("nav ul li a:eq(1)").attr("href", "#profile");
						$("nav ul li a").last().attr("href", "#contact");
            return false;
            break;
        case "/profile":
            if (!onetime) {
                $("nav ul li a:eq(1)").addClass('active1');
                $('#work').hide();
                $("#about").stop(true, true).delay(500).fadeIn("slow"), function () {}
            }
						$("nav ul li a:eq(1)").removeAttr('href');
						$("nav ul li a").last().attr("href", "#contact");
            return false;
            break;
        case "/contact":
            if (!onetime) {
                $("nav ul li a").last().addClass('active1');
                $('#work').hide();
                //$('#work', '#contact').hide();
                $("#contact").stop(true, true).delay(500).fadeIn("slow"), function () {}
            }
						$("nav ul li a:eq(1)").attr("href", "#profile");
						$("nav ul li a").last().removeAttr('href');
            return false;
            break;
        }

    });
	  $('nav ul li a').bind({
        click: function () {
						$('nav ul li a').removeClass('active1');
            onetime = true;
            switch ($("nav ul li a").index(this)) {
            case 0:
                if ($('#about').is(":visible")) {
                    $('#about').fadeOut(function () {
                        $("#work").stop(true, true).delay(500).fadeIn("fast"), function () {}
                    })
                } else if ($('#contact').is(":visible")) {
                    $('#contact').fadeOut(function () {
                        $("#work").stop(true, true).delay(500).fadeIn("fast"), function () {}
                    })
                } else {
                    aninmUn();
                }
                $(this).addClass('active1');
								//$(this).removeAttr('href');
								break;
            case 1:
                $(this).addClass('active1');
								
                abtSlide();
                break;
            case 2:
                $(this).addClass('active1');
								
                contSlide();
                break;
            }
        }

    });
		
		function swipeStatus(event, phase, direction, distance) {
				//If we are moving before swipe, and we are going Lor R in X mode, or U or D in Y mode then drag.
				if (phase == "move" && (direction == "up" || direction == "down")) {
				}if (phase == "end") {
						if (direction == "up") $('.go-preva').trigger('click'); 
						else if (direction == "down") $('.go-nexta').trigger('click');
						
				}
		}


    $(document).keydown(function (e) {
        var keyCode = e.keyCode || e.which,
            arrow = {
                up: 38,
                down: 40,
                enter: 13,
                esc: 27,
                launch: 76
            };
        switch (keyCode) {
        case arrow.up:
						if (window.Shadowbox.isOpen()==true || $('#about').is(":visible") || $('#contact').is(":visible")){}
						else {	$('.go-preva').trigger('click');}
            return false
            break;
        case arrow.down:
						//alert(window.Shadowbox.isOpen());
						if (window.Shadowbox.isOpen()==true || $('#about').is(":visible") || $('#contact').is(":visible")){}
						else {$('.go-nexta').trigger('click');}
            return false
            break;
        case arrow.enter:
            if (intrans) return false;
            if ($('#about').is(":visible") || $('#contact').is(":visible")) {
                return false;
            } else {
                aninmUn();
            }
            return false;
            break;
        case arrow.esc:
            if (intrans) return false;
							if (window.Shadowbox.isOpen()==true || $('#about').is(":visible") || $('#contact').is(":visible")){}
							else { aninmClose();}
           	break;
        case arrow.launch:
            $('.launchPro a').trigger('click');
            //if (intrans) return false;
            break;
        }

    });

    function aninmUn() {
        if (intrans) return false;
        else intrans = true;
				
				$('nav ul li a').first().addClass('active1');
				$('nav ul li a').first().removeAttr('href');
				 
					$("hgroup").stop(true, true).animate({
            color: "#fff",
            duration: 600,
            easing: "easeOutExpo"
        });
        $(".close").stop(true, true).animate({
            top: '115px',
            duration: 600,
            easing: "easeOutExpo",
            complete: function () {}
        });
        $.each(arr, function (i, v) {
            v.animate({
                top: '0px'
            }, 600, "easeOutExpo", function () {
                intrans = false;
            })
        });
				
				
    };

    function aninmClose() {
        if (intrans) return false;
        else intrans = true;
				
					$('nav ul li a').first().removeClass('active1');
				 	$('nav ul li a').first().attr("href", location);
					
					$("hgroup").stop(true, true).animate({
							color: "#333",
							duration: 600,
							easing: "easeOutExpo"
					});
					$.each(arr, function (i, v) {
							v.animate({
									top: '-200px'
							}, 600, "easeOutExpo", function () {
									intrans = false;
							})
					});
		};
		function abtSlide() {
        if ($("#thumbsbg").position().top < 0 && (intrans)) {
            $('#work').fadeOut(function () {
                $("#about").stop(true, true).delay(500).fadeIn("fast"), function () {
                    intrans = false;
                }
            })
        } else if ($('#contact').is(":visible")) {
            $('#contact').fadeOut(function () {
                $("#about").stop(true, true).delay(500).fadeIn("fast"), function () {
                    intrans = false;
                }
            })
        } else {
            $('#work').fadeOut(function () {
                $("#about").stop(true, true).delay(500).fadeIn("fast"), function () {
                    intrans = false;
                }
            })
            aninmClose();
        }

    }

    function contSlide() {
        if ($("#thumbsbg").position().top < 0 && (intrans)) {
            $('#work').fadeOut(function () {
                $("#contact").stop(true, true).delay(500).fadeIn("fast"), function () {
                    intrans = false;
                }
            })

        } else if ($('#about').is(":visible")) {
            $('#about').fadeOut(function () {
                $("#contact").stop(true, true).delay(500).fadeIn("fast"), function () {
                    intrans = false;
                }
            })
        } else {
            $('#work').fadeOut(function () {
                $("#contact").stop(true, true).delay(500).fadeIn("fast"), function () {
                    intrans = false;
                }
            })
            aninmClose();
        }
    }
    $('#coda-slider-1').codaSlider({
        dynamicArrows: false,
        dynamicTabs: false,
        crossLinking: false
    });
    //Handle my ThumbNaviagation Slider
    var slider = $('.navSlider').bxSlider({
        auto: false,
        controls: false,
        speed: 400,
        pager: false,
        displaySlideQty: 4,
        moveSlideQty: 2,
        infiniteLoop: false,
        easing: 'easeOutExpo'
    });

    window.navSlider = slider

    $('.go-prev').bind('click', function (e) {
			 slider.goToPreviousSlide()
        return false;
    });

    $('.go-next').bind('click', function (e) {
        slider.goToNextSlide();
        return false;
    });
    //end my ThumbNaviagation Slider
    var slide0 = $('.slider0').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
    var slide1 = $('.slider1').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
    var slide2 = $('.slider2').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });

    var slide3 = $('.slider3').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });

    var slide4 = $('.slider4').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
		
		var slide5 = $('.slider5').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
		
		var slide6 = $('.slider6').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
		
		var slide7 = $('.slider7').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
		
		var slide8 = $('.slider8').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });
		
		var slide9 = $('.slider9').bxSlider({
        auto: false,
        controls: false,
        pager: false,
        easing: 'easeOutExpo',
        mode: 'fade'
    });

    $('.thumbPrev').bind('click', function (e) {
        switch (currentPanel) {
        case 1:
            if (intrans) return false;
            else intrans = true;

            slide0.goToPreviousSlide();

            switch (slide0.getCurrentSlide()) {
            case 0:
                $('.item0').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item0 img").css({
                        'padding-top': 200,
                        'padding-left': 320
                    });
                    $(".item0 img").attr({
                        src: "images/projects/mcd/burger.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
                //Shadowbox.setup($(".launchPro a").attr({href: "projects/mcd/qpc/300x250.swf", title:"McDonalds QPC", rel:"shadowbox;height=250;width=300"}));
                return false;
                break;
            case 1:
                $('.item0').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item0 img").css({
                        'padding-top': 260,
                        'padding-left': 300
                    });
                    $(".item0 img").attr({
                        src: "images/projects/mcd/nugs.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;;
                break;
            case 2:
                $('.item0').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item0 img").css({
                        'padding-top': 245,
                        'padding-left': 240
                    });
                    $(".item0 img").attr({
                        src: "images/projects/mcd/spoon.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
                return false;
                break;
            }
            break;
        case 2:
            if (intrans) return false;
            else intrans = true;

            slide1.goToPreviousSlide();

            switch (slide1.getCurrentSlide()) {
            case 0:
                $('.item1').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item1 img").css({
                        'padding-top': 180,
                        'padding-left': 100
                    });
                    $(".item1 img").attr({
                        src: "images/projects/toyota/rav4/rav4.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
                return false;
                break;
            case 1:
                $('.item1').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item1 img").css({
                        'padding-top': 200,
                        'padding-left': 180
                    });
                    $(".item1 img").attr({
                        src: "images/projects/toyota/prius/prius_car.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;
                break;
            case 2:
                $('.item1').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item1 img").css({
                        'padding-top': 180,
                        'padding-left': 247
                    });
                    $(".item1 img").attr({
                        src: "images/projects/toyota/corolla/corolla.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
                //$('.rightinfo1').html('<ul><li>Toyota</li><li>Burrell Communications</li><li>Flash Development (Art Direction, AS 3.0, OOP)</li></ul>');
								//Shadowbox.setup($(".launchPro a").attr({href: "projects/mcd/oat/300x250.swf", title:"McDonalds Oatmeal", rel:"shadowbox;height=250;width=300"}));
                return false;
                break;
            }
            break;
        case 3:
            if (intrans) return false;
            else intrans = true;

            slide2.goToPreviousSlide();

            switch (slide2.getCurrentSlide()) {
            case 0:
                $('.item2').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item2 img").css({
                        'padding-left': 90,
                        'padding-top': 250
                    });
                    $(".item2 img").attr({
                        src: "images/projects/aa/board.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
                return false;
                break;
            case 1:
                $('.item2').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item2 img").css({
                        'padding-left': 50,
                        'padding-top': 275
                    });
                    $(".item2 img").attr({
                        src: "images/projects/aa/black_pumps.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;
                break;
            }

            break;
        case 4:
            if (intrans) return false;
            else intrans = true;

            $('.item3').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item3 img").css({
                    'padding-left': arrX[3],
                    'padding-top': arrY[3]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
        case 5:
            if (intrans) return false;
            else intrans = true;

            $('.item4').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item4 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 6:
            if (intrans) return false;
            else intrans = true;
            $('.item5').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item5 img").css({
                    'padding-left': arrX[5],
                    'padding-top': arrY[5]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 7:
            if (intrans) return false;
            else intrans = true;
            $('.item6').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item6 img").css({
                    'padding-left': arrX[6],
                    'padding-top': arrY[6]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 8:
           	if (intrans) return false;
            else intrans = true;
						
												$('.item7').css({
														'opacity': 0,
														'filter': 'alpha(opacity=0)'
												}).delay(100).queue(function (next) {
														$(".item7 img").css({
																'padding-left': arrX[7],
																'padding-top': arrY[7]
														});
														$(".item7 img").attr({
																src: "images/projects/ibot/abe.png"
														});
														next();
												}).delay(300).animate({
														opacity: '1'
												}, 700, function () {
														intrans = false;
												});
				return false;
				break;
				case 9:
            if (intrans) return false;
            else intrans = true;
            $('.item8').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item8 img").css({
                    'padding-left': arrX[8],
                    'padding-top': arrY[8]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
            return false;
            break;
				case 10:
            if (intrans) return false;
            else intrans = true;
            $('.item9').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item9 img").css({
                    'padding-left': arrX[9],
                    'padding-top': arrY[9]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 11:
            if (intrans) return false;
            else intrans = true;
            $('.item10').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item10 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
				case 12:
            if (intrans) return false;
            else intrans = true;
            $('.item11').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item11 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
				case 13:
            if (intrans) return false;
            else intrans = true;
            $('.item12').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item12 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
						
				case 14:
            if (intrans) return false;
            else intrans = true;
            $('.item13').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item13 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
        }
        return false;
    })
    $('.thumbNext').bind('click', function (e) {
        switch (currentPanel) {
        case 1:
            if (intrans) return false;
            else intrans = true;

            slide0.goToNextSlide();

            switch (slide0.getCurrentSlide()) {
            case 0:
                $('.item0').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item0 img").css({
                        'padding-top': 200,
                        'padding-left': 320
                    });
                    $(".item0 img").attr({
                        src: "images/projects/mcd/burger.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;
                break;
            case 1:
                $('.item0').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item0 img").css({
                        'padding-top': 260,
                        'padding-left': 300
                    });
                    $(".item0 img").attr({
                        src: "images/projects/mcd/nugs.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;;
                break;
            case 2:
                $('.item0').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item0 img").css({
                        'padding-top': 245,
                        'padding-left': 240
                    });
                    $(".item0 img").attr({
                        src: "images/projects/mcd/spoon.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;
                break;
            }
            break;
        case 2:
            if (intrans) return false;
            else intrans = true;

            slide1.goToNextSlide();

            switch (slide1.getCurrentSlide()) {
            case 0:
                $('.item1').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item1 img").css({
                        'padding-top': 180,
                        'padding-left': 100
                    });
                    $(".item1 img").attr({
                        src: "images/projects/toyota/rav4/rav4.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
                return false;
                break;
            case 1:
                $('.item1').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item1 img").css({
                        'padding-top': 200,
                        'padding-left': 180
                    });
                    $(".item1 img").attr({
                        src: "images/projects/toyota/prius/prius_car.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });
               // $('.rightinfo1').html('<ul><li>Toyota</li><li>Burrell Communications</li><li>Flash Development (Art Direction, AS 3.0, OOP)</li></ul>');
                return false;
                break;
            case 2:
                $('.item1').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item1 img").css({
                        'padding-top': 180,
                        'padding-left': 247
                    });
                    $(".item1 img").attr({
                        src: "images/projects/toyota/corolla/corolla.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;
                break;
            }
            break;
        case 3:
            if (intrans) return false;
            else intrans = true;

            slide2.goToNextSlide();

            switch (slide2.getCurrentSlide()) {
            case 0:
                $('.item2').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item2 img").css({
                        'padding-left': 90,
                        'padding-top': 250
                    });
                    $(".item2 img").attr({
                        src: "images/projects/aa/board.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });

                return false;
                break;
            case 1:
                $('.item2').css({
                    'opacity': 0,
                    'filter': 'alpha(opacity=0)'
                }).delay(100).queue(function (next) {
                    $(".item2 img").css({
                        'padding-left': 50,
                        'padding-top': 275
                    });
                    $(".item2 img").attr({
                        src: "images/projects/aa/black_pumps.png"
                    });
                    next();
                }).delay(300).animate({
                    opacity: '1'
                }, 700, function () {
                    intrans = false;
                });



                return false;
                break;
            }

            break;
        case 4:
            if (intrans) return false;
            else intrans = true;
            $('.item3').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item3 img").css({
                    'padding-left': arrX[3],
                    'padding-top': arrY[3]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
        case 5:
            if (intrans) return false;
            else intrans = true;
            $('.item4').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item4 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 6:
            if (intrans) return false;
            else intrans = true;
            $('.item5').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item5 img").css({
                    'padding-left': arrX[5],
                    'padding-top': arrY[5]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 7:
            if (intrans) return false;
            else intrans = true;
            $('.item6').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item6 img").css({
                    'padding-left': arrX[6],
                    'padding-top': arrY[6]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 8:
           	if (intrans) return false;
            else intrans = true;
						
												$('.item7').css({
														'opacity': 0,
														'filter': 'alpha(opacity=0)'
												}).delay(100).queue(function (next) {
														$(".item7 img").css({
																'padding-left': arrX[7],
																'padding-top': arrY[7]
														});
														$(".item7 img").attr({
																src: "images/projects/ibot/abe.png"
														});
														next();
												}).delay(300).animate({
														opacity: '1'
												}, 700, function () {
														intrans = false;
												});
				return false;
				break;
				case 9:
            if (intrans) return false;
            else intrans = true;
            $('.item8').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item8 img").css({
                    'padding-left': arrX[8],
                    'padding-top': arrY[8]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 10:
            if (intrans) return false;
            else intrans = true;
            $('.item9').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item9 img").css({
                    'padding-left': arrX[9],
                    'padding-top': arrY[9]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
				case 11:
            if (intrans) return false;
            else intrans = true;
            $('.item10').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item10 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
				case 12:
            if (intrans) return false;
            else intrans = true;
            $('.item11').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item11 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
				case 13:
            if (intrans) return false;
            else intrans = true;
            $('.item12').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item12 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });
						
				case 14:
            if (intrans) return false;
            else intrans = true;
            $('.item13').css({
                'opacity': 0,
                'filter': 'alpha(opacity=0)'
            }).delay(100).queue(function (next) {
                $(".item13 img").css({
                    'padding-left': arrX[4],
                    'padding-top': arrY[4]
                });
                next();
            }).delay(300).animate({
                opacity: '1'
            }, 700, function () {
                intrans = false;
            });

            return false;
            break;
        }
        return false;
    });
    $(".close").bind('click', function (e) {
        aninmClose();

    });
		
		$('.navSlider img').hover(function () {
        $(this).stop(true, true).animate({opacity: .5}, 400);
				//$(this).find("a").addClass("coda-nav ul li a.current")
    }, function () {
        $(this).stop(true, true).animate({opacity: 1}, 400);
    });
		
		
		$(".contacto").find("span").hide().end().hover(function () {
        //alert("over")
        $(this).find("span").stop(true, true).fadeIn("slow"), function () {}
    }, function () {
        $(this).find("span").stop(true, true).fadeOut("slow"), function () {}
    });

    $(".moreInfo").hover(function () {
        $(".info").stop(true, true).animate({
            opacity: 1
        }, 400);
    }, function () {
        $(".info").stop(true, true).animate({
            opacity: 0
        }, 400);
    });

    $('.coda-nav-left img').css({
        'left': -50
    })
    $('.coda-nav-right img').css({
        'left': 0
    })

    $(".coda-nav-left").hover(function () {
        $(this).find('img').stop(true, true).animate({
            left: '0px',
            duration: 50,
            easing: "easeInExpo",
            complete: function () {}
        });
    }, function () {
        $(this).find('img').stop(true, true).animate({
            left: '-50px',
            duration: 50,
            easing: "easeInExpo",
            complete: function () {}
        });
    });
    $(".coda-nav-right").hover(function () {
        $(this).find('img').stop(true, true).animate({
            left: '-50px',
            duration: 50,
            easing: "easeInExpo",
            complete: function () {}
        });
    }, function () {
        $(this).find('img').stop(true, true).animate({
            left: '0px',
            duration: 50,
            easing: "easeInExpo",
            complete: function () {}
        });
    });

    $.each(btns, function (i, val) {
        var $tr = btns[i]
        $tr.hover(function () {
            $(this).find('a').stop(true, true).animate({
                color: "#000",
                duration: 600,
                easing: "easeOutExpo"
            });
            $(this).stop(true, true).animate({
                backgroundColor: "#fff",
                duration: 600,
                easing: "easeOutExpo"
            });
            // hover fade
        }, function () {
            $(this).find('a').stop(true, true).animate({
                color: "#fff",
                duration: 600,
                easing: "easeOutExpo"
            });
            $(this).stop(true, true).animate({
                backgroundColor: "#000",
                duration: 600,
                easing: "easeOutExpo"
            });
        });

    });


    $(".launchPro a").bind('click', function (e) {
        switch (currentPanel) {
        case 1:
            switch (slide0.getCurrentSlide()) {
            case 0:
                qpc();
                return false;
                break;
            case 1:
                nugs();
                return false;;
                break;
            case 2:
                oatmeal();
                return false;
                break;
            }
            break;
        case 2:
            switch (slide1.getCurrentSlide()) {
            case 0:
                 rav4();
                return false;
                break;
            case 1:
              	prius();
                return false;;
                break;
            case 2:
								corolla();
                return false;
                break;
            }
            break;
        case 3:
            switch (slide2.getCurrentSlide()) {
            case 0:
                relax();
                return false;
                break;
            case 1:
                tie();
               	return false;;
                break;
            }
            break;
        case 4:
            linkout();
            return false;
            break;
        case 5:
            linkout();
            return false;
            break;
				case 6:
          	scentsa();
            return false;
            break;
				case 7:
            linkout();
            return false;
            break;
				case 8:
            ibot();
            return false;
            break;
				case 9:
            santa();
            return false;
            break;
				case 10:
           	xyz();
            return false;
            break;
				case 11:
            //barclay();
            return false;
            break;
				case 12:
            //barclay();
            return false;
            break;
				case 13:
           // barclay();
            return false;
            break;
				case 14:
           // barclay();
            return false;
            break;
        }
        return false;
    });



    Shadowbox.init({
        player: ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv'],
        overlayOpacity: 0.9,
        handleOversize: "drag",
        overlayColor: "#000",
        skipSetup: false,
        animate: true,
        animateFade: true,
        animSequence: "sync",
        modal: false,
        showOverlay: true,
        flashBgColor: "#000000",
        autoplayMovies: true,
        showMovieControls: true,
        slideshowDelay: 0,
        resizeDuration: "0.35",
        fadeDuration: "0.35",
        displayNav: true,
        displayCounter: true,
        counterType: "default",
        handleOversize: "resize",
        handleUnsupported: "link",
        autoDimensions: false

    });
		loader();

});
