//Cufon Replaced Elements
Cufon.replace('.header-block-content h1', {textShadow: '2px 2px rgba(0,0,0,0.2)'});
Cufon.replace('h1.strap');
Cufon.replace('.column-right h2');
Cufon.replace('.column-centre h2');
Cufon.replace('.column-left h3');
Cufon.replace('.column-left-inner h3');
Cufon.replace('.column-right h3');

	//Function for equal heights
	function equalHeight(group) {
		tallest = 0;
		group.each(function() {
			thisHeight = $(this).height();
			if(thisHeight > tallest) {
				tallest = thisHeight;
			}
		});
		group.height(tallest);
	}

	//Style the captcha box
	var RecaptchaOptions = {
	theme: 'clean'
	};

$(document).ready(function(){
	//Equalise News Preview Height on homepage
	equalHeight($(".home-news-preview-content"));
	equalHeight($(".footerCols"));
	//Home Page Block Panel Switching
	var background = 'url(/images/nav-vertical-tab.png)';
	var sections = $('a.section');
	sections.click(function() {
		var classValue = $(this).attr("rel");
		var classValue = classValue.replace('#', '.');
		var classValueId = $(this).attr('rel');
		var classActive = $('a.active');
		var sectionContentDisplay = $('.display');
		classActive.css('background','none');
		classActive.removeClass('active');
		$(this).toggleClass('active');
		$(this).css('background',background);
		sectionContentDisplay.hide();
		sectionContentDisplay.removeClass('display').addClass('hide');
		$(classValueId).fadeIn('slow');
		$(classValueId).removeClass('hide').addClass('display');
	return false;
	});	
	sections.mouseover(function() {
		$(this).css('background',background);
		$(this).css('behavior','url(/iepngfix.htc)');
  	});
	sections.mouseout(function() {
			if(!$(this).hasClass('active'))	{
				$(this).css('background','none');
			}
		});
//News Article Archive
	$('a.newsArticle').click(function()	{
		$('a.newsArticle').show();
		$(this).hide();
		var newsValue = $(this).attr('rel');
		$('.display-news-article').hide();
		$('.display-news-article').removeClass('display-news-article').addClass('hidden-news-article');
		$(newsValue).fadeIn('slow');
		$(newsValue).toggleClass('display-news-article');
	return false;		
	});	
	//Font Controller
	var originalFontSize = $('body').css('font-size');
	$(".resetFont").click(function(){
	$('body').css('font-size', originalFontSize);
	});
	// Increase Font Size
	$(".large").click(function(){
		var currentFontSize = $('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 11);
		var newFontSize = currentFontSizeNum*1.2;
		$('body').css('font-size', newFontSize);
		return false;
	});
	// Decrease Font Size
	$(".small").click(function(){
		var currentFontSize = $('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 11);
		var newFontSize = currentFontSizeNum*0.8;
		$('body').css('font-size', newFontSize);
		return false;
	});
});
