$(document).ready(function()
{
	$(".tab_content").hide();
	$("ul.tabs li:first").addClass("active").show();
	$(".tab_content:first").show();

	$("ul.tabs li").click(function()
       {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active");
		$(".tab_content").hide();

		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn();
		return false;
	});
	
	timer = setTimeout(img_header, 4500); 

});


var cont = 1;

function img_header(){

	$("#imgh-" + cont).fadeTo(800,0, function () {
		$(this).css("display", "none");

		if (cont == 8){cont=1;}
		else{cont++;}
		
		$("#imgh-" + cont)
			.css("display", "inline")
			.fadeTo(500,1, function () {
			
				clearTimeout(timer);
				timer = setTimeout(img_header, 4500); 
			
			});
	});
}
