﻿$(function () {
	// Determines which section of the site the user is in and add a selected class to the relevant main navigation menu item
    if (window.location.href.indexOf("/home") != -1) {
        $("#navHome").addClass('selected');
    }
    if (window.location.href.indexOf("/explore-chesil-vista") != -1) {
        $("#navExplore").addClass('selected');
    }
    if (window.location.href.indexOf("/book-a-holiday") != -1) {
        $("#navBook").addClass('selected');
    }
    if (window.location.href.indexOf("/buy-a-holiday-home") != -1) {
        $("#navBuy").addClass('selected');
    }
    if (window.location.href.indexOf("/entertainments") != -1) {
        $("#navEntertainments").addClass('selected');
    }
    if (window.location.href.indexOf("/the-local-area") != -1) {
        $("#navArea").addClass('selected');
    }
    if (window.location.href.indexOf("/news-views") != -1) {
        $("#navNews").addClass('selected');
    }
    if (window.location.href.indexOf("/contact-us") != -1) {
        $("#navContact").addClass('selected');
    }
});

// Make disabled links non clickable
$("a.disabled").click(function (){return false;});
