﻿$(document).ready(function () {

	/* -- Main Menu -- */
	$('#mainMenuBoxOuter .mainMenuList li').has('.mainMenuList').hover(
        function () { $(this).children('.mainMenuList').show(); },
        function () { $(this).children('.mainMenuList').hide(); }
    );

	/* -- Mailing list form examples -- */
	$('#mailing-form .namebox input').val('Name');
	$('#mailing-form .emailbox input').val('Email address');

	$('#mailing-form .namebox input').blur(function () {
		if ($(this).val() == '')
			$(this).val('Name');
	});

	$('#mailing-form .namebox input').focus(function () {
		if ($(this).val() == 'Name')
			$(this).val('');
	});

	$('#mailing-form .namebox input').click(function () {
		if ($(this).val() == 'Name')
			$(this).val('');
	});

	$('#mailing-form .emailbox input').blur(function () {
		if ($(this).val() == '')
			$(this).val('Email address');
	});

	$('#mailing-form .emailbox input').focus(function () {
		if ($(this).val() == 'Email address')
			$(this).val('');
	});

	$('#mailing-form .emailbox input').click(function () {
		if ($(this).val() == 'Email address')
			$(this).val('');
	});

	/* -- Show/Hide 'other' field in application form -- */
	$('#ApplicationForm li.referrerBox select').change(
        function () {
        	if ($(this).val() == 'other')
        		$('#ApplicationForm li.otherBox').show();
        	else
        		$('#ApplicationForm li.otherBox').hide();
        }
    );

	/* -- Disable link for 'Apprenticeships' -- *
	$('#mainMenuHeaderBox ul li.apprenticeships>a').click(function() {
	return false; 
	});
	/**/

});

