jQuery('li.uk-jobs a').click(function() {
  $('li.austin-tx-us').fadeOut();
  $('li.other-opportunities').fadeOut();
  $('li.no-opportunities').fadeOut();
  $('li.theale-uk, li.bristol-uk, li.milton-keynes-uk, li.bristol-and-theale-uk').fadeIn();
  $('li.uk-jobs').attr("class", function(i, val) {
	return val + ' current-menu-item'
  });
  $('li.us-jobs').removeClass('current-menu-item');
  $('li.other-jobs').removeClass('current-menu-item');
  return false
});



jQuery('li.us-jobs a').click(function() {
  $('li.theale-uk, li.bristol-uk, li.milton-keynes-uk, li.bristol-and-theale-uk').fadeOut();
  $('li.other-opportunities').fadeOut();
  $('li.no-opportunities').fadeOut();
  $('li.austin-tx-us').fadeIn();
  $('li.us-jobs').attr("class", function(i, val) {
	return val + ' current-menu-item'
  });
  $('li.uk-jobs').removeClass('current-menu-item');
  $('li.other-jobs').removeClass('current-menu-item');
  return false
});


jQuery('li.other-jobs a').click(function() {
  $('li.austin-tx-us').fadeOut();
  $('li.theale-uk, li.bristol-uk, li.milton-keynes-uk, li.bristol-and-theale-uk').fadeOut();
  
  if($('li.other-opportunities').length == 0) {
	if($('li.no-opportunities').length == 0) {
		$('ul.lcp_catlist ').append("<li class='no-opportunities'>We have no other opportunities available at the moment, but are always interested in talented individuals. We also run regular work experience to help give new industry talent a helping hand. If you feel you have the right stuff please send your CV to <a href='mailto:jobs@mzl.com'>jobs@mzl.com</a>.<br /><br />We look forward to hearing from you!</li>");
	}
	else {
		$('li.no-opportunities').fadeIn();
	}
  }
  else {
	$('li.other-opportunities').fadeIn();
  }
  
  $('li.other-jobs').attr("class", function(i, val) {
	return val + ' current-menu-item'
  });
  $('li.us-jobs').removeClass('current-menu-item');
  $('li.uk-jobs').removeClass('current-menu-item');
  return false
});


jQuery(document).ready(function() {
   if(jQuery('select#job_location').val() == "Other Opportunities") {
			jQuery('input#job_other_location').show();
		}
 });

jQuery('#job_location').change(function () {
    jQuery('#job_location option:selected').each(function () {
        //alert(jQuery('select#job_location').val());
		if(jQuery('select#job_location').val() == "Other Opportunities") {
			jQuery('input#job_other_location').show();
		}
		if(jQuery('select#job_location').val() != "Other Opportunities") {
			jQuery('input#job_other_location').hide();
		}
    });
})
.change();

