$(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') + '?subject=Parrbrown.com Web Inquiry');
//		
//		$('#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()
		});
	});

        // begin marketing box horizontal accordian
        lastBlock = $(".a1");
        maxWidth = 315;
        minWidth = 212;
        $(lastBlock).addClass('open').find('.box-content').css({
            width: '200px'
        });
        $("#homePageBoxes ul li").hover(
        function(){
			var li = $(this);
			
            if (!li.hasClass("open")) {
                li.closest('ul').find('li').removeClass("open");
                li.addClass("open");
				
				// close old box
				$(lastBlock).find('.more').animate({width: 0}, { queue:false, duration:400 });
                $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
				
				// open current box
                li.animate({width: maxWidth+"px"}, { queue:false, duration:400});
                li.closest('ul').find('li:not(.open) .box-content').animate({width: "0px"}, { queue:false, duration:400});
                $(".box-content", this).animate({width: "200px"}, { queue:false, duration:400 });
				$(".more", this).animate({width: "100px"}, { queue:false, duration:400 });
                lastBlock = this;
            }
        });
        // end marketing box horizontal accordian

});

function switchPrint()
{
	var style = $("link[title='Print']");
	var screen_style = $("link[title='Main']");

	if (style.attr('disabled') == true)
	{
		style.attr('disabled', false);
		screen_style.attr('disabled', true);
		// open print dialog
		print();
	}
	else
	{
		style.attr('disabled', true);
		screen_style.attr('disabled', false);
	}
	
	return false;
}

haccordion.setup({
	accordionid: 'homePageHighlights', 
	paneldimensions: {peekw:'200px', fullw:'340px', h:'113px'},
	selectedli: [0, false], 
	collapsecurrent: false	
})
