$(document).ready(function()
{
	$("a[href^='mailto:']").click(function()
	{
		$('body').append('<div id="email-container"><div id="email-popup"> <p><strong>CLIENTS: please click "Yes" below to continue</strong></p> <p>If you are not a client of Parr Brown Gee &amp; Loveless, please note that an attorney-client relationship is only established after we have had direct communication with you, have cleared possible conflicts of interest and have agreed on the terms of engagement in writing.</p> <p>By clicking the Yes button below, you agree (1) the information obtained from the Parr Brown Gee & Loveless website does not constitute legal advice and is not intended to create an attorney-client relationship and (2) an email message does not create an attorney-client relationship and Parr Brown is not obligated to treat non-client email messages as confidential.</p> <p>Please do not send sensitive or confidential information or attach documents to this email as we cannot guarantee confidentiality.</p> <p><strong>Do you wish to proceed?</strong> Click "Yes" to acknowledge you understand and agree to the terms above. Click "No" to cancel the email.</p> <p class="text-center" style="margin-top: 20px;"> <a id="yes-button">Yes</a> &nbsp; <a href="#" id="no-button">No</a></p> </div></div>');
		
		$('#yes-button').attr('href', $(this).attr('href'));
		
		$('#no-button').click(function()
		{
			$('#email-container').remove();
			return false;
		});
		
		$('#yes-button').click(function()
		{
			$('#email-container').remove();
		});
		
		// sets the div height/width that lets you close the nav by clicking anywhere on the page
		$('#email-container').css({
			height:	$(window).height(),
			width:	$(window).width(),
			top: $(window).scrollTop(),
			left: $(window).scrollLeft()
		});
		
		return false;
	});
	
	
	
	// moves the opacity layer when the window is scrolled
	$(window).scroll(function() {
		$('#email-container').css({
			top: $(window).scrollTop(),
			left: $(window).scrollLeft()
		});
	});
	
	// changes size of opacity layer when window is resized
	$(window).resize(function() {
		$('#email-container').css({
			height:	$(window).height(),
			width:	$(window).width()
		});
	});
});