
	/* ! ---- DOCUMENT LOAD ---- */
	/* ---------------------------------------------------- */
		
		// declare vars
		var infoOn = true;
		var moveArray = new Array();
		
		$(document).ready(function(){
			
			// find height of elements
			findHeight();
			
			// find width
			findWidth();
			
			// set sliderHolder width & set moveArray
			setSliderWidth();
			
				$("#infotab").click(function(){
					if (infoOn == true) {
						$("#info").animate( { marginLeft:-495+"px" }, 'slow' );
						$(this).css('backgroundImage', 'url(_img/infotab_in.gif)');
						infoOn = false;
					} else {
						$("#info").animate( { marginLeft:0+"px" }, 'slow' );
						$(this).css('backgroundImage', 'url(_img/infotab_out.gif)');
						infoOn = true;
					}
				});
			
			// create slides movement
			$("#main_nav a").click(function(event){   
				
				if (infoOn == true) {
					$("#info").animate( { marginLeft:-495+"px" }, 'slow' );
					infoOn = false;
				}
				
				if($(this).is(":contains(poster)")){
					$("#slide_holder").animate( { left:moveArray[0]}, 'slow' );
				}
				
				if($(this).is(":contains(gallery)")){
					$("#slide_holder").animate( { left:moveArray[1]}, 'slow' );
				}
				
				/*
if($(this).is(":contains(listen)")){
					$("#slide_holder").animate( { left:moveArray[2]}, 'slow' );
				}
*/
				
				if($(this).is(":contains(video)")){
					$("#slide_holder").animate( { left:moveArray[2]}, 'slow' );
				}
				
				if($(this).is(":contains(benefitting)")){
					$("#slide_holder").animate( { left:moveArray[3]}, 'slow' );
				}
				
				if($(this).is(":contains(links)")){
					$("#slide_holder").animate( { left:moveArray[4]}, 'slow' );
				}
				
				event.preventDefault();
				
			});
			
			
			// fancy box
			$("#gallery a").fancybox({ 'overlayOpacity':.7 });
			$("a.vid").fancybox({ 'hideOnContentClick': false, 'frameWidth':425, 'frameHeight':344, 'overlayOpacity':.7 });
			$("a.gmap").fancybox({ 'hideOnContentClick': false, 'frameWidth':700, 'frameHeight':415, 'overlayOpacity':.7 });
			
			// popup window
			$('a.popup').click(function(){
				window.open(this.href);
				return false;
      });
		
		});
		
		
		
	/* ! ---- FIND DOC HEIGHT & WIDTH ---- */
	/* ---------------------------------------------------- */
		
		function findHeight() {
		
			// decide height for #info
			var windowHeight = $(window).height();
			var wrapperHeight = $("#wrapper").height();
			
			if (wrapperHeight < windowHeight) {
				$("#wrapper").css("height", windowHeight+"px");
				$("#info").css({'display' : 'block', 'height' : '100%'});
				$("#main_content").css({'display' : 'block', 'height' : '100%'});
			} else {
				$("#wrapper").css("height", "auto");
				$("#info").css({'display' : 'inline', 'height' : 'auto'});
				$("#main_content").css({'display' : 'inline', 'height' : '768px'});
			}
		
		}
		
			
		
		function findWidth(){
			var windowWidth = $(window).width();
			var infoWidth = $("#info").width();
			
			if (infoOn == true) {
				$("#main_content").css('width', windowWidth-infoWidth-60+'px');
			} else {
				$("#main_content").css('width', windowWidth+'px');
			}
			
		}
		
		
		// on resize
		/*
$(window).resize(function(){
	  	findHeight();
	  	findWidth();
		});
*/
			
			
			
			
	/* ! ---- SET SLIDE_HOLDER WIDTH AND MOVE ARRAY ---- */
	/* ---------------------------------------------------- */			
			
			function setSliderWidth() {
				
				// find widths
				posterW 	= $("#poster").width() + 30; 
				galleryW	= $("#gallery").width() + 30;
				/* listenW		= $("#listen").width() + 30; */
				videoW		= $("#video").width() + 30;
				benefitW	= $("#benefit").width() + 30;
				linksW		= $("#links").width() + 30;
				totalW		=	posterW + videoW + benefitW + linksW + galleryW;
				
				// set width
				/* $("#slide_holder").css('width', totalW+"px"); */
			
				// moveArray for navigation 
				moveArray[0] = "0px";
				moveArray[1] = -(posterW) + "px";
				moveArray[2] = -(posterW + galleryW) + "px";
				moveArray[3] = -(posterW + galleryW + videoW) + "px";
				moveArray[4] = -(posterW + galleryW + videoW + benefitW) + "px";
				
			}
			
			
			
			
			
			
			
			
			
		