var timeoutId;
var currentTab = 2;
var galleryInterval = 3000;

$(document).ready(function(){ 
	if($('#feat_1').attr('id')){
		$('.featured_site_desc_wrapper:not(#feat_1)').each(function(){
			$(this).css({'display' : 'none'})
		});
		$('#featured_galleries h1 a').click(function(){
			$('.featured_site_desc_wrapper').each(function(){
				$(this).css({'display' : 'none'})
			});
			$('#featured_galleries h1 a.current').removeClass('current');
			$(this).addClass('current');
			 $($(this).attr('href')).fadeIn(500);
			 if(timeoutId) clearTimeout(timeoutId);
			return false;
		}); 
		timeoutId = setTimeout("loadNextTab('"+currentTab+"')",galleryInterval);
		$('#services_list .slide_projects').each(function(){
			$(this).css({'display' : 'none'})
		}); 
		$('.over_holder').hover(function(){	
			$(this).find('.slide_projects').fadeIn(300); 		
		},function(){
			$(this).find('.slide_projects').fadeOut(300); 		
		}); 
	}
	if($.browser.msie && jQuery.browser.version < 7){
		$('#subnav_side li').hover(function(){	 
			 $(this).addClass('over');
		},function(){ 	 
			 $(this).removeClass('over');
		});  
	}
	/*
	$('#services_list .card').hover(function(){	 
		 $($(this).attr('href')).fadeIn(300);
	},function(){ 	
		return true;
	}); 
	$('.slide_projects').hover(function(){
		return true;
	},function(){  
		 $(this).fadeOut(300);
		$('#services_list .slide_projects').each(function(){
			$(this).css({'display' : 'none'})
		}); 
	}); */ 
});
function loadNextTab(tabNum){
		$('.featured_site_desc_wrapper').each(function(){
			$(this).css({'display' : 'none'})
		});
		
		$('#featured_galleries h1 a.current').removeClass('current');
		$('a[href="#feat_' + tabNum +'"]').addClass('current');
		$('#feat_' + tabNum).fadeIn(700);
		currentTab += 1;
		if(currentTab > 5) currentTab = 1;	
		timeoutId = setTimeout("loadNextTab('"+currentTab+"')",galleryInterval);		
} 