	// execute on resize of the window

	function resizeLb() {

		if (!jQuery("#lb-container").hasClass('inactive')) {

			var winHeight = jQuery(window).height();

			var winWidth = jQuery(window).width();

			var bottomHeight = 0;

			var bottomDiff = 0;



			// reset padding

			var homecontent = 73;

			if (jQuery(".inner-customer").length) {

				homecontent = 73;

			}

			//jQuery("#home-content").css("padding-top", homecontent);



			if (jQuery("#lb-bottom").length) {

				bottomHeight = 0;

				if (jQuery("#lb-bottom").is(":visible")) {

					bottomHeight = jQuery("#lb-bottom").height();

				}

				// double the padding minus the height of #home-content

				bottomDiff = bottomHeight - ((jQuery("#lb-bottom").outerHeight() - bottomHeight) *2) - homecontent;

			}



			jQuery("#lb-container .resize-height").css('height', winHeight - bottomHeight);

			if (jQuery("#lb-supersized").hasClass('rolled-up')) {

				jQuery("#lb-supersized").css('margin-top', (winHeight) * -1);

			}



			jQuery("#lb-images .lb-slide").css('width', winWidth);

			jQuery("#home-content").show();

				// center the selectors with javascript, because their width is different
				$(".enterBox").each(function(){
					var selectorWidth = $(this).width();
					var parentWidth = $(this).parent().width();
					var center = Math.round(0.5 * (parentWidth - selectorWidth));
					$(this).css('left', center);
				});

		}

	};



		// randomize the pod links


		// always start at the top

		jQuery('body,html').scrollTo('0', 0);


		// mobile



			// jQuery("#footer").hide();


			// set the top of the header





			// link that takes the page back up to the landing

			jQuery("#back-to-landing").live('click', function() {

				scrollToLandingContent();

				return false;

			});



			// on scroll, scroll to the home content if on the landing

			jQuery(window).scroll(function() {

			   scrollToHomeContent();

				return false;

			});

	function podhover(item) {

		jQuery('.homepage-button').css("background-position", "0 0");

	    jQuery(item).css("background-position", "0 bottom");

	    jQuery("#homepage-column2").css("background-image", "url('" + jQuery(item).attr("rel") + "')");

		jQuery("#homepage-column2").attr("rel", jQuery(item).attr("href"));

	}





	var scrolledDown = false;

	function scrollToHomeContent() {
		// only do this if the landing is visible
		if (!jQuery("#lb-supersized").hasClass("rolled-up")) {
			//show the rest of the content
			// jQuery('.home-bottom-content').show();
      
			// scroll back to the top so that after scroll it's at the top of the page
			$('body,html').scrollTo('0', 500);

			// height to scroll up
			var heightToScrollUp = jQuery('#wrapper').offset().top;

			// disable the landing so it can't be clicked while scrolling
			jQuery('body').addClass('lb-disabled');

			// animate the header down
			jQuery("#header").animate({ 'top': 0 }, 500);

			// animate the landing up
			jQuery("#lb-supersized").addClass('rolled-up').animate({ 'margin-top': -heightToScrollUp }, 500, function() {
				scrolledDown = true;
				// jQuery("#footer").show();
			});

			//_gaq.push(['_trackPageview', url]);

		}
		return false;
	};

	function scrollToLandingContent() {
		//hide the rest of the content
		// jQuery('.home-bottom-content').hide();

		// scroll back to the top so that after scroll it's at the top of the page
		jQuery('body,html').scrollTo('0', 500);

		// remove the disabled class so the landing is clickable
		jQuery('body').removeClass('lb-disabled');

		var scrollHeight = 73;
		if (jQuery(".inner-customer").length) {
			scrollHeight = scrollHeight + jQuery(".inner-customer").height();
		}

		// animate the header up
		jQuery("#header").animate({ 'top': -scrollHeight }, 500);

		// animate the landing down
		jQuery("#lb-supersized").removeClass('rolled-up').animate({ 'margin-top': 0 }, 500, function() {
			scrolledDown = false;
			// jQuery("#footer").hide();
		});
		return false;
	};

  /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function() {

  $.supersized({

    slide_interval      :   4000,		// Length between transitions
    transition          :   1, 			// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
    transition_speed		:	400,		// Speed of transition

    slides: [{
      image : "/images/splash/ad_1.jpg"
    }, {
      image : "/images/splash/ad_2.jpg"
    }, {
      image : "/images/splash/ad_3.jpg"
    }]

  });

		resizeLb();

		jQuery(window).resize(function() {

			resizeLb();

		});

		$("#home-show-content").click(function() {

			scrollToHomeContent();

			return false;

		});


			// set the top of the header

			var top = 73;

			if (jQuery(".inner-customer").length) {

				top = top + jQuery(".inner-customer").height();

			}

			jQuery("#header").css("top", -top);


});
