function linkActions(){
	$('#navi-right a').click(function(e){
		e.preventDefault(); //Prevent click default actions, which means the browser will do nothing if you click the link.
		
		//Prevent to do anymore if the clicked link is already active
		if( $(this).hasClass('active') )
			return false;
		
		//remove links with class active and set clicked link as active
		$('#navi-right a[class~=active]').removeClass('active');
		$(this).addClass('active');
		
		//Remove content from content element
		$('#content').find('#textsection-1').html('').closest('#textslider1').css({'top':0});
		
		
		//get href attribute from clicked link
		var href = $(this).attr('href');
		
		$.get(
			href,
			{},
			function(data){				
				//Put retrieved data to content element
				var div = $('<div />').append(data);
				var title = div.find('h2');
				div.find('h2').remove();
				
				$('#content').find('#textsection-1').html(div.html());
				$('#contenta').find('span').html(title.html());
				
				
			}
		);
	});
}

//event DOM is ready, and call linkActions function
$(function(){ linkActions(); });
