var hbsGlobal = {
    "var01": '',
    "var02": false,
    "init": function () {
        hbsGlobal.setCategory();
    },
    "setCategory": function () {
		key = $('#menuon').attr('class');
		switch (key)
		{
		case 'navkey2':
			category = 'aboutus';
			break;
		case 'navkey3':
			category = 'seniorschool';
			break;
		case 'navkey4':
			category = 'sixthform';
			break;
		case 'navkey5':
			category = 'admissions';
			break;
		case 'navkey6':
			category = 'newsandevents';
			break;
		case 'navkey7':
			category = 'contactus';
			break;
		default:
			category = '';
		}
		$('body').attr('class',category);
    }
}

$(document).ready(function () {
    hbsGlobal.init();
	// set var for current nav section colour
	var bgCol = $('a#menuon').css('backgroundColor');
	// underline the current nav section
	$('#menuon').next().css('backgroundColor', bgCol);
	
	// mouseOver effect to underline nav if not the 'menuon' section
	$(".menu a").mouseover(function() {
		if($(this).attr('id')!='menuon'){
			var HovBgCol = $(this).css('backgroundColor');
			$(this).next().css('backgroundColor', HovBgCol);
		}
	}).mouseout(function(){
		if($(this).attr('id')!='menuon'){
			$(this).next().css('backgroundColor', 'transparent');
		}
	});

});
