var position=0;
var max=10;

function slideShow(nummax) {
	max = nummax;
	$('.homehero_1 .slides').hide();
	$('div.slide_0').fadeIn(1000,textBoxShow);

}

function gallery() {
	if ((position+1) < max) {
		$('div.slide_'+position).fadeOut('slow');
		position++;
		$('div.slide_'+position).fadeIn('2000',textBoxShow);
	} else {
		position = max-1;
		$('div.slide_'+position).fadeOut('slow');
		position = 0;
		$('div.slide_'+position).fadeIn('2000',textBoxShow);
	}
}


function textBoxShow() {
	$('h2.hgh2').animate({
	'bottom' : '0px'
	}, 800, 'easeOutQuad');
	setTimeout(hideText,5000);
}

function hideText() {
	$('h2.hgh2').animate({
	'bottom' : '-50px'
	}, 800, 'easeInQuad');
	setTimeout(gallery,800);
}
