
/* scripts.js */
$(document).ready(function() {
    $(window).scroll(function() {
        if (self.pageYOffset) {
            var offset = self.pageYOffset;

        } else if (document.documentElement && document.documentElement.scrollTop) {
            var offset = document.documentElement.scrollTop;

        } else if (document.body) {
            /* all other Explorers */
            var offset = document.body.scrollTop;

        }
        $('#sec1 .a_logo_big').css({
            "top": Math.floor(20 + (offset / 20)) + "%"

        });
        $('#sec2').css({
            "background-position": "20% " + Math.floor(460 - (offset / 1.5)) + "px"

        });
        $('#sec2 .phone_screen').css({
            "background-position": "50% " + Math.floor(140 - (offset / 4)) + "px"

        });
        $('#sec3').css({
            "background-position": "50% " + Math.floor(300 - (offset / 4)) + "px"

        });
        $('#sec4').css({
            "background-position": "50% " + Math.floor(744 - (offset / 4)) + "px"

        });
        $('#sec5').css({
            "background-position": "50% " + Math.floor(1100 - (offset / 4)) + "px"

        });
        $('#sec6').css({
            "background-position": "50% " + Math.floor(1325 - (offset / 4)) + "px"

        });
        $('#sec7').css({
            "background-position": "50% " + Math.floor(1500 - (offset / 4)) + "px"

        });
        /* Graph */
        $('#sec3 .graph').css({
            /*"background-position": "820px " + (1200 - (offset / 2)) + "px" */
            "left": Math.floor(1800 - (offset / 2)) + "px"

        });
        /* Photos */
        $('#sec4 .photo-three').css({
            "top": Math.floor(3800 - (offset / 1)) + "px"

        });
        $('#sec4 .photo-two').css({
            "top": (2000 - (offset / 2)) + "px"

        });
        /* Sketches */
        $('#sketches').css({
            "top": Math.floor( - 135 + (offset / 40)) + "%"

        });
        /* Me Bubble */
        $('#sec8 .content').css({
            "top": Math.floor( - 200 + (offset / 40)) + "%"

        });

    });
    $(".google_on_alipes").colorbox({
        width: "80%",
        height: "90%",
        iframe: true

    });
    $("a[rel='sc']").colorbox({
        top: "3em",
        fixed: true,
        maxWidth: "90%",
        maxHeight: "90%"

    });
    $('#sec1 .a_logo_big').css({
        "position": "fixed",
        "top": "20%"

    });

});
$("#a_sec1").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#header").offset().top

    },
    2000);

});
$("#a_sec2").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec2").offset().top

    },
    2000);

});
$("#a_sec3").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec3").offset().top

    },
    2000);

});
$("#a_sec4").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec4").offset().top

    },
    2000);

});
$("#a_sec5").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec5").offset().top

    },
    2000);

});
$("#a_sec6").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec6").offset().top

    },
    2000);

});
$("#a_sec7").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec7").offset().top

    },
    2000);

});
$("#a_sec8").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#sec8").offset().top

    },
    2000);

});
$(window).load(function() {
    $('.loading').animate({
        "left": "100%"

    });

});

/*
$('#philip_w_johnston').hide();
$('#rosemary_baldacci').hide();
$('#rebecca_pollard').hide();
$('#michael_a_bergan').hide();
$('#jane_lane').hide();
$('#doug_rubin').hide();
$('#kyle_sullivan').hide();
$('#charles_steelfisher').hide();
$('#pace_willisson').hide();
$('#darlene_heikkinen').hide();
$('#josh_gee').hide();


$('#philip_w_johnston_click').click(function() {
	if ($('#philip_w_johnston').is(':visible')) {
	    $('#philip_w_johnston').fadeOut('slow');
            } else {
	     $('#philip_w_johnston').fadeIn('slow');
        };
});
$('#rosemary_baldacci_click').click(function() {
	if ($('#rosemary_baldacci').is(':visible')) {
	    $('#rosemary_baldacci').fadeOut('slow');
            } else {
	     $('#rosemary_baldacci').fadeIn('slow');
        };
});
$('#rebecca_pollard_click').click(function() {
	if ($('#rebecca_pollard').is(':visible')) {
	    $('#rebecca_pollard').fadeOut('slow');
            } else {
	     $('#rebecca_pollard').fadeIn('slow');
        };
});
$('#michael_a_bergan_click').click(function() {
	if ($('#michael_a_bergan').is(':visible')) {
	    $('#michael_a_bergan').fadeOut('slow');
            } else {
	     $('#michael_a_bergan').fadeIn('slow');
        };
});
$('#jane_lane_click').click(function() {
 	if ($('#jane_lane').is(':visible')) {
	    $('#jane_lane').fadeOut('slow');
            } else {
	     $('#jane_lane').fadeIn('slow');
        };
});
$('#doug_rubin_click').click(function() {
	if ($('#doug_rubin').is(':visible')) {
	    $('#doug_rubin').fadeOut('slow');
            } else {
	     $('#doug_rubin').fadeIn('slow');
        };
});
$('#kyle_sullivan_click').click(function() {
	if ($('#kyle_sullivan').is(':visible')) {
	    $('#kyle_sullivan').fadeOut('slow');
            } else {
	     $('#kyle_sullivan').fadeIn('slow');
        };
});
$('#charles_steelfisher_click').click(function() {
 	if ($('#charles_steelfisher').is(':visible')) {
	    $('#charles_steelfisher').fadeOut('slow');
            } else {
	     $('#charles_steelfisher').fadeIn('slow');
        };
});
$('#pace_willisson_click').click(function() {
 	if ($('#pace_willisson').is(':visible')) {
	    $('#pace_willisson').fadeOut('slow');
            } else {
	     $('#pace_willisson').fadeIn('slow');
        };
});
$('#darlene_heikkinen_click').click(function() {
	if ($('#darlene_heikkinen').is(':visible')) {
	    $('#darlene_heikkinen').fadeOut('slow');
            } else {
	     $('#darlene_heikkinen').fadeIn('slow');
        };
});
$('#josh_gee_click').click(function() {
	if ($('#josh_gee').is(':visible')) {
	    $('#josh_gee').fadeOut('slow');
            } else {
	     $('#josh_gee').fadeIn('slow');
        };
});
*/

$("#q1_click").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#q1").offset().top - 35

    },
    2000);

});
$("#q3_click").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#q3").offset().top - 40

    },
    2000);

});
$("#q2_click").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#q2").offset().top - 40

    },
    2000);

});
$("#our_team_click").click(function(e) {
    e.preventDefault();
    $('html, body').animate({
        scrollTop: $("#our_team").offset().top - 40

    },
    2000);

});
