$(document).ready(function() {

	// Diet.tpl JS Code When page loads...
	$(".tab_content").hide(); //Hide all content
	$(".tab_cal").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	$(".tab_cal:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		$(".tab_cal").hide(); //Hide all content
		
		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		var activeCal = $(this).find("a").attr("rel"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		$(activeCal).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	$('a').bind('click', function() {
		$(this).blur();
	});

	$('#homepageproducts').scroller();
	
	
	//fix pngs
	$(document).pngFix();

	$(window).load(function() {
							
		//the pagefooter
		$('#pagefooter').each(function() {
			var offset = $(this).offset();
			if (offset.top!=0) {
				$('body').css('backgroundPosition', 'left '+(offset.top-60)+'px');
			}
		});
		
		 $(".tweet").tweet({
			username: "SunraysiaUK",
			join_text: "auto",
			avatar_size: 32,
			count: 1,
			auto_join_text_default: "we said,",
			auto_join_text_ed: "we",
			auto_join_text_ing: "we were",
			auto_join_text_reply: "we replied to",
			auto_join_text_url: "we were checking out",
			loading_text: "loading tweets..."
		});

	});
	
	
	//FAQ Code
	
	

});
