$(document).ready(function() { 
			
	$('#trailer').mouseenter(function() {
		if($('#trailer').hasClass("active")) {
			null;
		}
		else {
			$('#trailer').addClass("active");
			$('#trailer_nav').show();
		}
	});
	
	$('#trailer_nav').mouseleave(function() {
		$('#trailer_nav').hide();
		$('#trailer').removeClass("active");
	});
	
	$('.nav_links').not('#trailer').mouseenter(function() {
		$('#trailer_nav').hide();
		$('#trailer').removeClass("active");
	})
	
	$('#main, #splash').mouseenter(function() {
		$('#trailer_nav').hide();
		$('#trailer').removeClass("active");
	})
	
	$('#pace_btn').click(function() {
		if($('#pace_btn').hasClass("active")) {
			null;
		}
		else {
			$('#bigtex_splash,#aluma_splash,#carson_splash,#wellscargo_splash').hide();
			$('#bigtex_btn,#aluma_btn,#carson_btn,#wellscargo_btn').removeClass("active");
			$('#pace_btn').addClass("active");
			$('#pace_splash').fadeIn("medium");
		}		
	});
	
	$('#bigtex_btn').click(function() {
		if($('#bigtex_btn').hasClass("active")) {
			null;
		}
		else {
			$('#pace_splash,#aluma_splash,#carson_splash,#wellscargo_splash').hide();
			$('#pace_btn,#aluma_btn,#carson_btn,#wellscargo_btn').removeClass("active");
			$('#bigtex_btn').addClass("active");
			$('#bigtex_splash').fadeIn("medium");
		}	
	});
	
	$('#aluma_btn').click(function() {
		if($('#aluma_btn').hasClass("active")) {
			null;
		}
		else {
			$('#pace_splash,#bigtex_splash,#carson_splash,#wellscargo_splash').hide();
			$('#pace_btn,#bigtex_btn,#carson_btn,#wellscargo_btn').removeClass("active");
			$('#aluma_btn').addClass("active");
			$('#aluma_splash').fadeIn("medium");
		}
	});
	
	$('#carson_btn').click(function() {
		if($('#carson_btn').hasClass("active")) {
			null;
		}
		else {
			$('#pace_splash,#bigtex_splash,#aluma_splash,#wellscargo_splash').hide();
			$('#pace_btn,#bigtex_btn,#aluma_btn,#wellscargo_btn').removeClass("active");
			$('#carson_btn').addClass("active");
			$('#carson_splash').fadeIn("medium");
		}
	});
	
	$('#wellscargo_btn').click(function() {
		if($('#wellscargo_btn').hasClass("active")) {
			null;
		}
		else {
			$('#pace_splash,#bigtex_splash,#aluma_splash,#carson_splash').hide();
			$('#pace_btn,#bigtex_btn,#aluma_btn,#carson_btn').removeClass("active");
			$('#wellscargo_btn').addClass("active");
			$('#wellscargo_splash').fadeIn("medium");
		}
	});
	
	$('.grid_box').hover(function() {
			$(this).find('.view_models').fadeIn("fast");
			$(this).find('.grid_picture').css('border','1px solid #666');
			$(this).find('.grid_description p').css('color','#333');
		}, function() {
			$(this).find('.view_models').fadeOut("fast");
			$(this).find('.grid_picture').css('border','1px solid #ccc');
			$(this).find('.grid_description p').css('color','#666');
	})
	
	$('.grid_box_2').hover(function() {
			$(this).find('.grid_picture').css('border','1px solid #666');
			$(this).find('.grid_description p').css('color','#333');
		}, function() {
			$(this).find('.grid_picture').css('border','1px solid #ccc');
			$(this).find('.grid_description p').css('color','#666');
	})
	
	$(function() { 
    	$("ul.tabs").tabs("div.panes > div").history(); 
	});
	
	$("a[rel='showcase']").colorbox({transition:"fade", opacity:0.90});
	
	$("a[rel='preview']").colorbox({transition:"fade", opacity:0.75, rel:'nofollow', maxHeight:"750px"});
	
	$(".grid_box_2 .grid_picture").attr('title','View larger image');
	
	$(".preview_page").colorbox({transition:'none', width:"632px", height:"85%", maxWidth:"650px", maxHeight:"800px", iframe:true, opacity:0.75});
	
	$(".preview_page_2").colorbox({transition:'none', width:"780px", height:"85%", maxWidth:"780px", maxHeight:"800px", iframe:true, opacity:0.75});
	
	$(".preview_page_3").colorbox({transition:'none', width:"815px", height:"85%", maxWidth:"815px", maxHeight:"85%", iframe:true, opacity:0.75});
	
	$(".preview_page_4").colorbox({transition:'none', width:"980px", height:"85%", maxWidth:"980px", maxHeight:"85%", iframe:true, opacity:0.75});
});

