function subMenu() { // keeps parent item active when submenu open
	$("#menu li").hover(
   		function () {
    			$('a', this).addClass('hover');
		}, function () {
			$('a', this).removeClass('hover');
		}
	);
}



function hpHovers() { // adds small pieces to big buttons on hp
	$("#hp li.item-1").hover(
   		function () {
    			$("#hp span#hp-first").addClass('hover');
    			$("#hp span#hp-r").addClass('hp-1r');
		}, function () {
			$("#hp span#hp-first").removeClass('hover');
    			$("#hp span#hp-r").removeClass('hp-1r');
		}
	);
	$("#hp li.item-2").hover(
   		function () {
    			$("#hp span#hp-l").addClass('hp-2l');
    			$("#hp span#hp-r").addClass('hp-2r');
		}, function () {
			$("#hp span#hp-l").removeClass('hp-2l');
    			$("#hp span#hp-r").removeClass('hp-2r');
		}
	);
	$("#hp li.item-3").hover(
   		function () {
    			$("#hp span#hp-l").addClass('hp-3l');
    			$("#hp span#hp-r").addClass('hp-3r');
		}, function () {
			$("#hp span#hp-l").removeClass('hp-3l');
    			$("#hp span#hp-r").removeClass('hp-3r');
		}
	);
	$("#hp li.item-4").hover(
   		function () {
    			$("#hp span#hp-l").addClass('hp-4l');
    			$("#hp span#hp-last").addClass('hover');
		}, function () {
			$("#hp span#hp-l").removeClass('hp-4l');
    			$("#hp span#hp-last").removeClass('hover');
		}
	);
}



function clickableButtons() { // makes entire buttons clickable 
    $('#hp li').click(function() {
        var href = $('a',this).attr("href");
        if(href) {
            window.location = href;
        }
    });
}



$(document).ready(function() {
	subMenu();
	hpHovers();
	clickableButtons();
});
