$(document).ready(function(){

// Gambling Commission - Custom js

// 1: Apply a class of 'first' to first list item and 'last' to last list item

$("#headerNav ul li:first-child").addClass("first");
$("#primaryNav ul li:first-child").addClass("first");

$("#headerNav ul li:last-child").addClass("last");
$("#primaryNav ul li:last-child").addClass("last");
$("#footer ul li:last-child").addClass("last");

$("#primaryNav ul li:first-child").addClass("home");

//-------------------------------------------------------


// 2: Primary Nav Highlighter

// First get the active page list item text from the breadcrumb

var breadcrumbElementText = ($("div#breadcrumb ul li:nth-child(2)").text());
// First get the active page list item text from the breadcrumb
var breadcrumbElementTextTrimmed = jQuery.trim(breadcrumbElementText);

// Get the primary navigation item
$("div#primaryNav ul li a").each(function(){

		var temp = $(this).text();
		var str = jQuery.trim(temp);
		
		var str = str.replace('\n',' ');
		
		if (str == breadcrumbElementTextTrimmed) {		
			$(this).addClass('active');
		}

});



// End of javascript - do not remove the code below this point
});
$(function() {

//show menu
$('#headerNav').css('display','block');

});