$(window).load(function() {
	//init accordion
	//initMenu();
	
	//initialize the menu
	$(function($){ $("ul.sf-menu").supersubs({minWidth:13, maxWidth:30, extraWidth:0}).superfish({hoverClass:'sfHover', pathClass:'sf-active', pathLevels:0, delay:500, animation:{height:'show'}, speed:'def', autoArrows:1, dropShadows:0}) });

	// init colorbox
	$("a[rel='colorbox']").colorbox();
	$(".video").colorbox({iframe:true, width:650, height:550}); 

	// add a last class to the 3rd item from each row
	$(".photo-gal li:nth-child(3n)").addClass("last");
	$(".preview .content p:last-child, #specifications ul li:nth-child(2n)").addClass("last");
	
	$(".photo-gal li a.zoom, #showcase .item .image a.zoom, .small-gallery ul li a.zoom").append("<span class=\"mask\"></span>");
	$(".photo-gal li a.zoom, #showcase .item .image a.zoom, .small-gallery ul li a.zoom").hover(
	  function () {
		if($.browser.msie){
			$(this).find('span.mask').animate({opacity:0.8}, 300, 'easeOutExpo');
		} else {
			$(this).find('span.mask').animate({opacity:1}, 300, 'easeOutExpo');	
		}
	  },
	  function () {
		$(this).find('span.mask').animate({opacity:0}, 200, 'easeOutExpo');
	  }
	);
	
	// preview module
	var sources = $('.preview .models ul li a');
	$('.preview .models ul li:first-child').addClass('active');
	sources.click(function(e) {
		e.preventDefault();
		$('.preview .models ul li').removeClass("active"); //Remove any "active" class
		$(this).parent().addClass('active');
		$('#preview-image').attr('src',$(this).attr("ref"));
	});
	
	// FAQ Code
	$('#faqs h6').each(function() {
		var tis = $(this), state = false, answer = tis.next('div').hide().css('height','auto').slideUp();
		tis.click(function() {
		  state = !state;
		  answer.slideToggle(state);
		  tis.toggleClass('active',state);
		});
	}); // end each faqs
	
	
})
