var showing = -1;

function showServicesDetail(id) {
	if (showing == id) {
		hideServicesDetail(showing);
		return;
	}
	else if (showing != -1) {
		$('#servicesDetail_' + showing).fadeOut(250, function() { showing = -1; showServicesDetail(id); }); 
		return;
	}
	$('#servicesDetail_' + id).fadeIn(250, function() { $('.foldOut').animate({height: 'show'}); });
	$('#servicesNav a').css({backgroundPosition : 'top left'});
	$('#services_sub_' + id + ' a').css({backgroundPosition : 'bottom left'});
	showing = id;
}

function hideServicesDetail(id, showId) {
	showing = -1;
	$('.foldOut').animate({height: 'hide', paddingTop : '0', paddingBottom: '0', marginBottom: '0' });
}

$(document).ready(function() {
	$('#servicesDiv').show();
	$('.servicesDetail').hide();
	$('.foldOut').hide().css({paddingTop : '0', paddingBottom: '0'});
	showServicesDetail(1);
});
