$(document).ready(function() {

	// next three lines are only needed when there is a link to a video page
	$('div.teaser-navigation').find('a.next-link').last()
		.attr('href', '/products/riatrax-security/documentation/')
		.attr('class', 'video-link');

	$('div#ce54').find('a.next-link').remove();
	$('div#ce54').find('span.separator').remove();

	$("a.next-link").each(function(){
		
		$(this).attr('href', '#'+$(this).attr('rel'));

	});	
	$("a.prev-link").each(function(){
		
		$(this).attr('href', '#'+$(this).attr('rel'));

	});	

	$("a.next-link").click(function(){
		hideAll();
		$('#ce'+$(this).attr('rel')).show();
		$('#teaser-right-content-img-'+$(this).attr('rel')).show();
		$("a.next-link[rel="+$(this).attr('rel')+"]").addClass('active');
	});
	$("a.prev-link").click(function(){
		hideAll();
		$('#teaser-right-content-img-'+$(this).attr('rel')).show();
		$('#ce'+$(this).attr('rel')).show();
		$("a.next-link[rel="+$(this).attr('rel')+"]").addClass('active');
	});

});

function hideAll(){
	
	$('div.teaser-content').hide();
	$('div.teaser-right-content-image').hide();
	$('a.next-link').removeClass('active');
	
}
