var fontSizeArray =  new Array('10','11','12','14','16','20','24','30','40');

function fontSize(inc) {
	for( i=0; i<document.styleSheets.length; i++ ) {
		styleRules = document.styleSheets[i].cssRules ? document.styleSheets[i].cssRules : document.styleSheets[i].rules;
		for( j=0; j<styleRules.length; j++ ) {
			changeFont(styleRules[j],inc);
		}
	}
}

function changeFont( styleRule, newSize ) {
	if( !styleRule ) return false;
	if( !styleRule.style ) return false;
	if( !styleRule.style.fontSize ) return false;
	
	currentFont = styleRule.style.fontSize;
	pos = currentFont.indexOf('px');
	if( pos==-1 ) return false;

	currentFont = currentFont.substring(0,pos);

	for( l=0; l<fontSizeArray.length; l++ ) {
		if( currentFont == fontSizeArray[l] ) {
			
			newIndex = l+newSize;
			if( newIndex<0 ) newIndex=0;
			if( newIndex>=fontSizeArray.length ) newIndex = fontSizeArray.length-1;
			
			if( newIndex==l ) return false;
			
			styleRule.style.fontSize = fontSizeArray[newIndex] + 'px';
			
			return true;
		}
	}
	
	return false;
}