
var c = 1; // start at 0
var t;
var timer_is_on = 0;

function slideTimer(){
	//set the time out variable
	t = setTimeout("slideTimer()", 6000);
	
	if(c == 6){
		c = 1;
	}
	
	temp = '#'+String(c);
	var x = jQuery(temp).html();
	jQuery('#display-news-wrapper').html(x);
	jQuery('.news-active').removeClass('news-active');
	
	jQuery('a[href$="'+temp+'"]').addClass('news-active');
	
	c = c + 1;  //position
	
	
}


function startTimer(){
	if(!timer_is_on){
		timer_is_on = 1;
		slideTimer();
	}
}

function resetCount(){
	clearTimeout(t);
	timer_is_on=0;
}

jQuery(document).ready(function(){
	//jQuery('.hidden-news').hide();
	
	
	
	/*$('div#accord a.section').click(function(){
		
		//change the image in here.
		img = $(this).attr('title');
		activateImage(img);
		c = parseInt($(this).attr('id')) - 1;
		resetCount(c);
		startTimer();

	});
	*/
	startTimer();
	
	jQuery('a.news-button').click(function(){
		var id = jQuery(this).attr('href');
		
		var x = jQuery(id).html();
		jQuery('.news-active').removeClass('news-active');
		jQuery('#display-news-wrapper').html(x);
		c = parseInt($(this).attr('id'));
		jQuery(this).addClass('news-active');
		resetCount(c);
		startTimer();
		return false;
	});
	
	jQuery('.imgThumb').click(function(){
		var url = jQuery(this).attr('href');
		jQuery('.installPicture').attr('src', url).removeAttr('width').removeAttr('height');
		return false;
	});
	
	var vHeight = jQuery('#info-person').height();
	var posTop = (555-vHeight)/2;
	jQuery('#info-person').css('top',posTop);
	
});
