jQuery(function(){
	var content_height = 939;	// Final	
	var page = 1;				// the beginning page number to show in the footer
	var article = 1;
	var maa_stg = null;
	var maa_tmp = null;
	var head_txt = null;
	var title = '&quot;We put the fun in Cowboy Action Shooting&quot;';
	var carryTle = null;

	function buildNewsletter(){  
console.log('buildNewsletter:'+title);
		if(jQuery('#middle').contents().length > 0){
			maa_stg = 'news_pg'+page;
			maa_tmp = 'news_pg'+ (page-1);

			$page = jQuery("#article_template").clone().addClass(maa_stg).addClass("page").removeClass("article_template").attr("id", maa_stg).css("display", "block");							

			$page.find(".footer span").append(page);    
			 jQuery("#content").append($page);
//console.log('Stage:'+carryT);
//console.log('Stage:'+maa_stg);
			jQuery('#content').find('[class^=news_pg]').find('[class^=colN]').find('.post-headline').css('margin-top','15pt').addClass("dontend");
			jQuery('#content').find('[class^=news_pg]').find('[class^=colN]').find('.post-byline').addClass("dontend");
			jQuery('#content').find('[class^=news_pg]').find('[class^=colN]').find('img').addClass("dontend");
			jQuery('#content').find('[class^=news_pg]').css("border-bottom-width", "medium");
			jQuery('#content').find('[class^=news_pg]').css("border-bottom-style", "solid");
			jQuery('#content').find('[class^=news_pg]').css("border-bottom-color", "#000000");
			page++; 
   
			jQuery('#middle').columnize({  
                 columns: 2,  
                 target: ".page:last .pg",  
                 overflow: {  
                     height: content_height,  
                     id: "#middle", 
					 lastNeverTallest: true, 
					 ignoreImageLoading: false,
                     doneFunc: function(){  
						if (jQuery('#content').find('.'+maa_stg).find('.first.column').find('[class^=colN]:last').attr('class') ==
jQuery('#content').find('.'+maa_stg).find('.last.column').find('[class^=colN]:first').attr('class')) {

							$tle = jQuery('#content').find('.'+maa_stg).find('.first.column').find('[class^=colN]:last').find('.post-headline').clone().addClass('cont');							
							jQuery('#content').find('.'+maa_stg).find('.last.column').find('[class^=colN]:first').prepend($tle);
							carryTle = jQuery('#content').find('.'+maa_stg).find('.last.column').find('.cont').text() + ' (continued)';
							jQuery('#content').find('.'+maa_stg).find('.last.column').find('.cont').text(carryTle);
						}
						buildNewsletter();  
                     }  
                 }  
			});  
         }  
	}  

	
	jQuery('.column').css('padding-left','7px');	
	jQuery('.column').css('padding-right','7px');	
	jQuery('#content').find('hr').remove();		 
});	

jQuery('.column').css('padding-left','7px');	
jQuery('.column').css('padding-right','7px');	
jQuery('.first').css('padding-left','7px');
jQuery('.first').css('padding-right','7px');
jQuery('#content').css('display','block');			  