// $Id$

function changeFont(){
	//alert($("#news_contents").length);
	var widthChanged = '350px';			
	$("#news_contents").each(function(idx, obj){
		widthChanged = '550px';
	});	
	
	$('.node:not(.changeFont-processed)', document)
		.addClass('changeFont-processed')
		.each(function(){
			$(this).find('span').each(function(idx,el){
				el.removeAttribute("style");
			});
			$(this).find('p').each(function(idx,el){
				el.removeAttribute("style");
			});
			$(this).find('p').each(function(idx,el){
				el.style.fontFamily='Arial,Tahoma,Calibri,Sans-Serif';
				el.style.fontSize='13px';
				el.style.width='100%';
			});
			$(this).find('span').each(function(idx,el){
				el.style.fontFamily='Arial,Tahoma,Calibri,Sans-Serif';
				el.style.fontSize='13px';
			});
			$(this).find('li').each(function(idx,el){
				el.style.fontFamily='Arial,Tahoma,Calibri,Sans-Serif';
				el.style.fontSize='13px';
			});
			$(this).find('div').each(function(idx,el){
				el.style.fontFamily='Arial,Tahoma,Calibri,Sans-Serif';
				el.style.fontSize='13px';
			});		
			$(this).find('pre').each(function(idx,el){
				el.style.fontFamily='Arial,Tahoma,Calibri,Sans-Serif';
				el.style.fontSize='13px';
			});	
			
			var widthChangedInt = parseInt(widthChanged);
			$(this).find('img').each(function(idx,el){
				var widthStr = el.width;
				
				if (widthStr == '') {
					widthStr = el.style.width;
				}
				var widthInt = 0;
				if (widthStr != ''){
					widthInt = parseInt(widthStr);
				}

				if (widthInt > widthChangedInt){
					el.style.width=widthChanged;
					el.removeAttribute("width");
					el.removeAttribute("height");
				}
			});		
		});
}
