var $j=jQuery.noConflict();
$j(document).ready( function() {
	
	// Featured Product Rounded Corners
	if( $j('#commInvolve').length > 0 ){
		$j("#commInvolve .involveArticle img").each(function() { 
			$j(this).wrap('<div class="commImg" />');
			var imgSrc = $j(this).attr("src");
			$j(this).parent()
			.css("background-image", "url(" + imgSrc + ")")
			.css("background-repeat","no-repeat")
			.css("height", "160px")
			.css("width", "200px");
			$j(this).remove();
		});
	}
	
	//Community news
	if( $j('#homeCommunityText').length > 0 ){
		if( $j('#homeCommunityText p').size() > 1 ){
			$j('#homeCommunityText p').hide();
			$j('#homeCommunityText p:eq(0)').show().addClass('visible');
			
			$j('#homeCommunityText').after('<span id="nextP">Next</span>');
			
			/*$j('#prevP').live( 'click', function(){
				var holdThis = $j('#homeCommunityText p.visible');
				if( $j(holdThis).prev().length > 0 ){
					$j(holdThis).hide().removeClass('visible');
					$j(holdThis).prev().fadeIn().addClass('visible');
				}
				else{
					$j(holdThis).hide().removeClass('visible');
					$j('#homeCommunityText p:last').fadeIn().addClass('visible');
				}
			});*/
			$j('#nextP').live('click', function(){
				var holdThis = $j('#homeCommunityText p.visible');
				if( $j(holdThis).next().length > 0 ){
					$j(holdThis).hide().removeClass('visible');
					$j(holdThis).next().fadeIn().addClass('visible');
				}
				else{
					$j(holdThis).hide().removeClass('visible');
					$j('#homeCommunityText p:first').fadeIn().addClass('visible');
				}
			});
		}
	}
	
		$j('.overdraftFormAlert form').submit( function(){
						if( $j('input[name=opt-in]:checked').length > 0 )
							return true;
						alert('Please choose to Opt In or Opt Out');
						return false;
					});
	});
