$(document).ready(function() {

	Cufon.replace(['div#heading-title', 'h5'], {
	    hover: true,
		color: '#0090CF',
		fontFamily: 'Futura Bk BT',
		fontWeight: 'normal',
		fontSize: '20px'
	});

	Cufon.replace(['div#footer-title', 'h5'], {
	    hover: true,
		color: '#7FA8D0',
		fontFamily: 'Zapfino Extra LT',
		fontWeight: 'normal',
		fontSize: '56px',
		lineHeight: '56px'
	});

	// Footer Menu Generation
	$('#menu > .inside-menu > ul > li > a').each(function() {
		$('#footer-menu').append('<a href="' + $(this).attr('href') + '">' + $(this).text() + '</a>');
		if($(this).parent().attr('class') != 'last') $('#footer-menu').append(' | ');
	});
	
	// Rounding Corners in IE
	// DD_roundies.addRule('#wrapper', '0 0 5px 5px', true);
	
	DD_roundies.addRule('#home-bar', '5px', true);
	DD_roundies.addRule('.rounded', '5px', true);
	
	$("a[href^=http://]").attr("target", "_blank");
	$("a[href^=https://]").attr("target", "_blank");

	// a patch to the brochures pages, if the link said "view", show the view icon instead of pdf icon
	// and turn the first image into li background as well
	$([".brochures.list", ".maps.list", ".miscellaneous.list"]).each(function(i, scope) {
		$("a:contains('View')", scope).css("background-image", "url(/images/shared/icons/ico-view.gif)");
		$("> li > img:first-child", scope).each(function() {
			$(this).parent().css({backgroundImage: "url(" + $(this).attr("src") + ")"}).end().remove();
		});
	});
});