// BRS eCurve2 [Inner color to transparent curves] (5.18.10)
// Copyright Blue Ridge Solutions, Inc.  www.blueridges.com
function eCurve2() {
	$('*:last', $('.curve')).css( {
		marginBottom : 0
	});
	var first = $('.crv_top').length ? 0 : 1;
	if (!first) {
		$('.crv_top,.crv_btm').remove();
	}

	if ($.support.opacity || ($.browser.msie && $.browser.version >= 7)) { 
		$('.curve')
				.each(function() {
					var css = $(this).attr('class');
					var width = $(this).outerWidth() - 16;

					// Grab color class based on provided array.
						var colors = [ ' blk', ' dk_gry', ' red', ' gry',
								' wht', ' blu', ' lt_grn' ];
						var color = "";
						for ( var count = 0; count < colors.length; count++) {
							if (css.match(colors[count]))
								color = colors[count];
						}
						var bg = color.replace(' ', '');
						// Setup and output HTML
						var curves = '<div class="crv_top'
								+ color
								+ '" style="width:'
								+ width
								+ 'px;"><img class="crv crv_lft" style="background-image:url(/content/'+document.domain+'/images/curve_'
								+ bg
								+ '.png);" src="/images/spacer.gif" alt="Curved Corner" /><img class="crv crv_rgt" style="background-image:url(/content/'+document.domain+'/images/curve_'
								+ bg
								+ '.png);" src="/images/spacer.gif" alt="Curved Corner" /></div>';

						if (first) { // If curves haven't been added, add
										// them.
							$(this).prepend(curves).append(
									'<div class="clr">&nbsp;</div>' + curves
											.replace('top', 'btm'));
						} else { // Replace curves
							$(this).prepend(curves).append(
									curves.replace('top', 'btm'));
						}
					});
	}
}

