$(document).ready( function(){
	// Fade Transitions
	$('.fade').innerfade({
		animationtype: 'fade',
		speed: 300,
		timeout: 2000,
		type: 'random',
		containerheight: '200px'
	});
	
	// Fancybox
	$('.fbImg').fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300
	});
	$('.iframe').fancybox({
		'hideOnContentClick': false,
		'frameWidth': 800,
		'frameHeight': 600,
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'easingIn': 'easeOutBack',
		'easingOut': 'easeInBack',
		'overlayShow': true
	});
	
	// Icon Switch
	$(".group-link").click(function () {
		$(this).toggleClass("swatchActive");
	});
	
	// Swatche toggle
	$(".swatch-group").hide();	
	// SureCheck Swatches
	$("#swatchClick-1").click(function () {
		$("#group-1").slideToggle("slow");
	});
	// Fiberglass Swatches
	$("#swatchClick-2").click(function () {
		$("#group-2").slideToggle("slow");
	});
	// Plastic Swatches
	$("#swatchClick-3").click(function () {
		$("#group-3").slideToggle("slow");
	});
	// Vinyl Swatches
	$("#swatchClick-4").click(function () {
		$("#group-4").slideToggle("slow");
	});
	// Silvertex Swatches
	$("#swatchClick-5").click(function () {
		$("#group-5").slideToggle("slow");
	});
	// Vinyl Upgrades Swatches
	$("#swatchClick-6").click(function () {
		$("#group-6").slideToggle("slow");
	});

	// Pulldown Menu
	$('#top-navigation li').hover(
		function() { $('.sub', this).css('display', 'block');},
		function() { $('.sub', this).css('display', 'none');
	});
	$('#top-navigation li').hover(
		function() { $('.sub .sub', this).css('display', 'none');
	});
	
});

// tab switcher
function tabSwitch(new_tab, new_content) {
	document.getElementById('tab-content-1').style.display = 'none';
	document.getElementById('tab-content-2').style.display = 'none';
	document.getElementById('tab-content-3').style.display = 'none';
	document.getElementById('tab-content-4').style.display = 'none';
	document.getElementById(new_content).style.display = 'block';
	document.getElementById('tab-1').className = '';
	document.getElementById('tab-2').className = '';
	document.getElementById('tab-3').className = '';
	document.getElementById('tab-4').className = '';
	document.getElementById(new_tab).className = 'active';
}