$(document).ready(function () { // On DOM load...
	
	// If doubleColumn ID exists... 
		$(function(){
			$('div.doubleColumn').columnize({
				columns: 2,
				lastNeverTallest: true
			});

			//$('div#jar_info div.first').css('margin-right', '4%');
			//$('div#jar_info div.last').css('margin-top', '35px');
		});

	
	$(function(){
		// Tabs
		$('#tabs').tabs();
	});
		
	$(function() {
		$('#smoker_photos a').lightBox();
		$('#gallery a').lightBox();
	});
	
	// fancy box setup. on product-details.php only (at this time).
	$(function() {
		if (document.getElementById("shippingInfo")) {
			$("a#shippingInfo").fancybox({
				'hideOnContentClick': false,
				'overlayColor': '#000'
			});
			$("a#priceInfo").fancybox({
				'hideOnContentClick': false,
				'overlayColor': '#000'
			});
			$("a#requestQuoteForm").fancybox({
				'hideOnContentClick': false,
				'overlayColor': '#000'
			});
		}
	});
});

// used for FAQ section
var faq = {
	
	currentHighlight: null,
	
	// highlight selected FAQ
	highlight: function(id) {
		
		// set hightlight
		var question = document.getElementById(id);
		question.className = "highlight";
		
		// remove highlight
		if (this.currentHighlight !== null && this.currentHighlight !== id) {
			this.removeHighlight(this.currentHighlight);
		}
		
		this.currentHighlight = id;
	},
	
	removeHighlight: function(id) {
		var highlightElem = document.getElementById(id);
		highlightElem.className = "";
	}
};
