	$(document).ready(function() {
	    
		var currentLocation = location.href;
		
		if (!currentLocation.match("cost-comparison")) {
		
			var $scrollPage = $('#main-content');
			
			$scrollPage.jScrollPane({
				dragMaxHeight: 19,
				dragMinHeight: 19,
				scrollbarWidth: 10,
				scollbarOnLeft: true,
				animateTo: true
			});
			
		}

		 
		 $('#h1').prev().click(function () { $scrollPage[0].scrollTo('#a1'); return false; });
		 $('#h2').prev().click(function () { $scrollPage[0].scrollTo('#a2'); return false; });
		 $('#h3').prev().click(function () { $scrollPage[0].scrollTo('#a3'); return false; });
		 $('#h4').prev().click(function () { $scrollPage[0].scrollTo('#a4'); return false; });
		 $('#h5').prev().click(function () { $scrollPage[0].scrollTo('#a5'); return false; });
		 $('#h6').prev().click(function () { $scrollPage[0].scrollTo('#a6'); return false; });
		 $('#h7').prev().click(function () { $scrollPage[0].scrollTo('#a7'); return false; });
		 $('#h8').prev().click(function () { $scrollPage[0].scrollTo('#a8'); return false; });
		 $('#h9').prev().click(function () { $scrollPage[0].scrollTo('#a9'); return false; });
		 $('#h10').prev().click(function () { $scrollPage[0].scrollTo('#a10'); return false; });
		
		// pre-load images
		var image1_hover = $('<img />').attr('src', 'themes/hpp/images/fmenu_cabinetpro_hover.gif');
		var image1 = $('<img />').attr('src', 'themes/hpp/images/fmenu_cabinetpro.gif');

		var image2_hover = $('<img />').attr('src', 'themes/hpp/images/fmenu_partners_hover.gif');
		var image2 = $('<img />').attr('src', 'themes/hpp/images/fmenu_partners.gif');

		var image3_hover = $('<img />').attr('src', 'themes/hpp/images/fmenu_industry_hover.gif');
		var image3 = $('<img />').attr('src', 'themes/hpp/images/fmenu_industry.gif');

		var image4_hover = $('<img />').attr('src', 'themes/hpp/images/fmenu_design_hover.gif');
		var image4 = $('<img />').attr('src', 'themes/hpp/images/fmenu_design.gif');
		
		var image5_hover = $('<img />').attr('src', 'themes/hpp/images/fmenu_loyalty_hover.gif');
		var image5 = $('<img />').attr('src', 'themes/hpp/images/fmenu_loyalty.gif');
		
		var image6_hover = $('<img />').attr('src', 'themes/hpp/images/fmenu_casestudies_hover.gif');
		var image6 = $('<img />').attr('src', 'themes/hpp/images/fmenu_casestudies.gif');

		$("#footer-nav-1").hover( 
      		function () { 
        		$(this).attr("src", "themes/hpp/images/fmenu_cabinetpro_hover.gif");
      		}, 
      		function () {
        		$(this).attr("src", "themes/hpp/images/fmenu_cabinetpro.gif");
      		}
    	);
		
		$("#footer-nav-2").hover( 
      		function () { 
        		$(this).attr("src", "themes/hpp/images/fmenu_partners_hover.gif");
      		}, 
      		function () {
        		$(this).attr("src", "themes/hpp/images/fmenu_partners.gif");
      		}
    	);
		
		$("#footer-nav-3").hover( 
      		function () { 
        		$(this).attr("src", "themes/hpp/images/fmenu_industry_hover.gif");
      		}, 
      		function () {
        		$(this).attr("src", "themes/hpp/images/fmenu_industry.gif");
      		}
    	);
		
		$("#footer-nav-4").hover( 
      		function () { 
        		$(this).attr("src", "themes/hpp/images/fmenu_design_hover.gif");
      		}, 
      		function () {
        		$(this).attr("src", "themes/hpp/images/fmenu_design.gif");
      		}
    	);
		
		$("#footer-nav-5").hover( 
      		function () { 
        		$(this).attr("src", "themes/hpp/images/fmenu_loyalty_hover.gif");
      		}, 
      		function () {
        		$(this).attr("src", "themes/hpp/images/fmenu_loyalty.gif");
      		}
    	);

		$("#footer-nav-6").hover( 
      		function () { 
        		$(this).attr("src", "themes/hpp/images/fmenu_casestudies_hover.gif");
      		}, 
      		function () {
        		$(this).attr("src", "themes/hpp/images/fmenu_casestudies.gif");
      		}
    	);
			
		var teamContent =  Array(14); 
		
		teamContent[0] = "Hi I'm Bjorn. I am in charge of the floor guys. I make sure your job is done on time. Any queries about when you job is ready, then call me.";
		teamContent[1] = "Hi I'm Josh. I've been processing your benchtop jobs for years, need any advice give me a call.";
		teamContent[2] = "Hi I'm Greg. I'm the financial controller for HPP. I'm the one who's responsible for counting the gold coins at the end of the week. It all stops without me.";
		teamContent[3] = "Hi I'm Luke. I'm the floor manager. I'm the one who makes sure the guys on the floor finish your job on time. Any questions in regards to your deliveries call me.";
		teamContent[4] = "Hi I'm Clay. I'm the manager of Postform tops. I'm here to ensure everything runs well for our customers.";
		teamContent[5] = "Hi I'm Kevin. I am HPP. If you don't know me then I'll probably know you. I started HPP and I'm still here to make sure all of our customers are always looked after. Or I'll be playing golf.";
		teamContent[6] = "Hi I'm Paul. I'm the manager for Panels. I'm here to make sure you are always looked after by our team. Any queries please feel free to call.";
		teamContent[7] = "Hi I'm Dave. My job is to have a chat with you whenever you want.. oh, and also to process jobs and do your quotes.";
		teamContent[8] = "Hi I'm Des. I'm our Representative. My job is to help you with whatever and whenever. I'm also a Cabinetpro whiz, so please call me anytime.";
		teamContent[9] = "Hi my names Di. I'm in charge of your accounts. I'm the one you're supposed to be nice to. I'm always here to help you and to keep the boys in the office in line.";
		teamContent[10] = "Hi I'm Chad. I'm the office manager. My job is to make sure Ben and Dave process your jobs on time. I am also an expert on Cabinetpro, so any questions just fire away.";
		teamContent[11] = "Hi I'm Ben. My job is to process all your jobs you send through. I would normally call you when you send an order to confirm everything is correct.";
		teamContent[12] = "Hi I'm Terry. I am the guy who's responsible for the quality of our products. I also take care of hardware, so any hardware orders? Call and ask for me.";
		teamContent[13] = "Hi I'm Troy. I help Josh with the processing and Bjorn with the production. There no end to my talents.";
		
		$('.team-hover').hover(function() {
			var elementId = $(".team-hover").index(this);
			$('#team-text').html(teamContent[elementId]);
		});
	});
