var $j = jQuery.noConflict();

$j(function(){
	
	init();
	
	function init(){
		check_paragraph();
		widgetImageResize('#side_widget img');
		channelColH('#left', '#right');
		
	}
	

function check_paragraph(){  //removes extra p elements added by wordpress
	
	$j("#content").find('p').each( function(){
		var p_html = $j(this).html();
				
		if (p_html == '&nbsp;' ){
			$j(this).remove();
		}
	})
	

}

function widgetImageResize(content){
	
	$j(content).each(function(){
		
			var w  = $j(this).width();
			
			if( w > 278){
			$j(this).css({width: '100%'})	;
			}
	})

	
}

function channelColH(l, r){
	
	$j(r).each(function(){
		$j(l).each(function(){
			
			var h_l  = $j(l).height();
			var h_r  = $j(r).height();			
						
			if ( h_r > h_l){
				if( h_r < 350){
					$j('#container').css({height: '350px'}); 
				}else{
					$j('#container').css({height: h_r}); 
				}
				
			}
			
			if ( h_l > h_r){
				if( h_l < 350){
					$j('#container').css({height: '350px'}); 
				}else{
					$j('#container').css({height: h_l}); 
				}
				
			}
		
					

		})
	})
	
}

	
});
	
	
	

