// JavaScript Document

function smartColumns() {
		
		jQuery("ul.main_news").css({ 'width' : "100%"});
		
		var colWrap = jQuery("ul.main_news").width();
		var colNum = Math.floor(colWrap / 320);
		var colFixed = Math.floor(colWrap / colNum);
		jQuery("ul.main_news").css({ 'width' : colWrap});
		jQuery("ul.main_news li").css({ 'width' : colFixed});
		jQuery("ul.main_news li:nth-child("+colNum+"n)").after("<div class=\"to_remove\" style=\"clear:both\"> </div>");
		
	}	
	

jQuery(document).ready(function(){
	
	jQuery('a[href^="http://"]')	.attr({ target: "_blank" });
	jQuery(window).resize(function () {
		jQuery("div.to_remove").remove();
		smartColumns();
		
	}); 
	
		
});
