// 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(); }
	
	var path = '/content/'+document.domain+'/images';
	
	if ($.support.opacity || ($.browser.msie && $.browser.version >= 7)) { /* Not for IE6 */
		$('.curve')
		.each(function(){
			var css = $(this).attr('class');
			var width = $(this).outerWidth() -16; // minus two curve widths
			
			// Add copy wrap for inner non-obstrusive padding
			if($(this).hasClass('copy')) { $(this).wrapInner('<div class="copy"></div>'); }
			
			// Grab color class based on provided array.
			var colors = [' blk',' cloud',' sky',' fb', ' wht'];
			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('+path+'/curve_'+bg+'.png);" src="'+path+'/spacer.gif" alt="Curved Corner" /><img class="crv crv_rgt" style="background-image:url('+path+'/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'));
			}
		});
	}
}


$(function(){ 
	/* Add Curves */
	eCurve2();

});

$(window).load(function(){ 
	/* Match Column Heights */
	$('.row').each(function(){ 
		var cols = $('.col',$(this)).length;
		var tallest = "0";
		$('.col',$(this)).each(function(){ 
			if($(this).height() > tallest) tallest = $(this).outerHeight();
		});
		$('.col',$(this)).css({height:tallest+"px"});
		//alert(cols);
	});

});
