// JavaScript Document
$(document).ready(function() {
						   
	var path = 'assets/pages/home/';
	
	//Load Hero Tabs
	$("#heroTabs").load( path + 'hero/tabs.html', function () {
		$("#heroTabs").fadeIn('fast', function () {
			$("#heroTab1").addClass('active');									   
		});
		
		//Click Tab 1
		$("#heroTab1").click( function() {
			$("#heroTab1").addClass('active');
			$("#heroDisplay").addClass('loading');
			$("#heroTab2").removeClass('active');
			$("#heroTab3").removeClass('active');
			$("#heroTab4").removeClass('active');
			
			$("#heroDisplay").load( path + 'hero/display.html #heroDisplay1', function () {
				$("#heroDisplay").removeClass('loading');
				$("#heroDisplay1").fadeIn('slow', function () {});												  
			});
		});
		
		$("#heroTab2 a").click( function() {
			$("#heroTab2").addClass('active');
			$("#heroDisplay").addClass('loading');
			$("#heroTab1").removeClass('active');
			$("#heroTab3").removeClass('active');
			$("#heroTab4").removeClass('active');
			
			$("#heroDisplay").load( path + 'hero/display.html #heroDisplay2', function () {
				$("#heroDisplay").removeClass('loading');
				$("#heroDisplay2").fadeIn('slow', function () {});												  
			});
		});
		$("#heroTab3 a").click( function() {
			$("#heroTab3").addClass('active');
			$("#heroDisplay").addClass('loading');
			$("#heroTab1").removeClass('active');
			$("#heroTab2").removeClass('active');
			$("#heroTab4").removeClass('active');
			
			$("#heroDisplay").load( path + 'hero/display.html #heroDisplay3', function () {
				$("#heroDisplay").removeClass('loading');
				$("#heroDisplay3").fadeIn('slow', function () {});												  
			});
		});
		$("#heroTab4 a").click( function() {
			$("#heroTab4").addClass('active');
			$("#heroDisplay").addClass('loading');
			$("#heroTab1").removeClass('active');
			$("#heroTab2").removeClass('active');
			$("#heroTab3").removeClass('active');
			
			$("#heroDisplay").load( path + 'hero/display.html #heroDisplay4', function () {
				$("#heroDisplay").removeClass('loading');
				$("#heroDisplay4").fadeIn('slow', function () {});												  
			});
		});
	});
	//Load Hero Main Display
	$("#heroDisplay").load( path + 'hero/display.html #heroDisplay1', function () {
		$("#heroDisplay").removeClass('loading');
		$("#heroDisplay1").delay(500).fadeIn('slow', function () {});												  
	});

	//Load Ticker
	$("#tickerSystem").load( path + 'newsfeed.html',function() {
		$('#tickerSystem').removeClass('loading');
		//Load Ticker Carousel
		$("#ticker").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			auto: 7000,
			speed: 1000,
			circular: true,
			visible: 1
		});
	});

	

	//Load in News Section Content
	$('#latestNews').load( path + 'news.html', function() {
		$('#latestNews').removeClass('loading');
	});
	
	//Load in Solutions Section
	$('#solutionsBox').load( path + 'solutions.html', function() {
		$('#solutionsBox').removeClass('loading');
	});
	
	$('#requestQuote').toggle(function() {
		$('#requestQuote').toggleClass('active');
		$('#rightQuote form').show(300,function() {});
	}, function() {
		$('#requestQuote').toggleClass('active');
		$('#rightQuote form').hide(300,function() {});
	});
	
});

