//what happens when link in services menu is clicked...

$(document).ready(function() {

	$('#services_menu a').click(function() {
		var url=$(this).attr('href');
		$('#popup_service') .load(url, function() {
		$('#popup_service') .fadeIn(300);
												});
		// prevent the default action, e.g., following a link
		return false;
		});
	
	$('#contact_main a').click(function() {
		var url=$(this).attr('href');
		$('#popup_contact') .load(url, function() {
		$('#popup_contact') .fadeIn(300);
												});
		// prevent the default action, e.g., following a link
		return false;
		});
	
	
	$('.offices').click(function() {
		var url=$(this).attr('href');
		$('#popup_menu') .load(url, function() {
		$('#popup_menu') .fadeIn(300);
		$('#popup_careers').fadeOut(100);
		$('#popup_people').fadeOut(100);
											 });
		// prevent the default action, e.g., following a link
		return false;
		});
	
	$('.people').click(function() {
		var url=$(this).attr('href');
		$('#popup_people') .load(url, function() {
		$('#popup_people') .fadeIn(300);
											   });
		// prevent the default action, e.g., following a link
		return false;
		});
	
	$('.careers').click(function() {
		var url=$(this).attr('href');
		$('#popup_careers') .load(url, function() {
		$('#popup_careers') .fadeIn(300);
		$('#popup_menu').fadeOut(100);
		$('#popup_people').fadeOut(100);
												});
		// prevent the default action, e.g., following a link
		return false;
		});
	
	$('#projects_menu a').click(function(evt) {
		var url=$(this).attr('href');
		$('#popup_menu2') .load(url, function() {
		$('#popup_menu2') .fadeIn(300);
											  });
		// prevent the default action, e.g., following a link
		evt.preventDefault();
		});
	
	

	
	$('#popup_menu2 a').click(function(evt) {
		var url=$(this).attr('href');
		$('#overlay') .fadeIn(300);
		$('#popup_projects') .fadeIn(300);
		$('#popup_projects') .load(url);
		// prevent the default action, e.g., following a link
		evt.preventDefault();
	});
	
	$('.close').click(function(evt) {
		$('#overlay') .fadeOut(300);
		$('#popup_projects') .fadeOut(300);
		// prevent the default action, e.g., following a link
		evt.preventDefault();
	});
	
	$('.popagain').click(function(evt) {
		var url=$(this).attr('href');
		$('#overlay') .fadeIn(300);
		$('#popup_projects') .fadeIn(300);
		$('#popup_projects') .load(url);
		// prevent the default action, e.g., following a link
		evt.preventDefault();
	});


$('.popagain2').click(function(evt) {
		var url=$(this).attr('href');
		$('#popup_email') .load(url, function() {
		$('#overlay') .fadeIn(300);
		$('#popup_email') .fadeIn(300);
		$('.close2') .fadeIn(300);
		});
		// prevent the default action, e.g., following a link
		evt.preventDefault();
	});
	
	$('.close2').click(function(evt) {
		$('#overlay') .fadeOut(300);
		$('#popup_email') .fadeOut(300);
		$('.close2') .fadeOut(300);
		// prevent the default action, e.g., following a link
		evt.preventDefault();
	});




});
