/**
 *
 *     This file is part of Jahia Enterprise Edition v6 - Early Adopter Package
 *
 *     Copyright (C) 2002-2009 Jahia. All rights reserved.
 *
 * 	  Jahia delivers the first Open Source Web Content Integration Software
 * 	  by combining Enterprise Web Content Management
 * 	  with Document Management and Portal features.
 *
 *     The Jahia Enterprise Edition - Early Adopter package is delivered ON AN "AS IS" BASIS,
 *     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED.
 *
 *    	Jahia Enterprise Edition - Early Adopter Package CANNOT be used for
 *    	any production environment and is strictly and exclusively delivered to You by Jahia
 *    	for test and development purpose.
 *
 *     Jahia Enterprise Edition must be used in accordance with the terms contained
 *     in a separate license agreement between you and Jahia (JSEL).
 *
 *     If you are unsure which license is appropriate
 *     for your use, please contact the sales department at sales@jahia.com.
 */

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}