//Tags
var tgs = new Array( 'div','td','tr');
//Sizes for text
var szs = new Array( '80%','90%','100%','110%','120%','130%','140%' );
//Lineheight sizes
var lszs = new Array('110%','120%','130%','140%','150%','160%', '170%');
//Which start item is used. (100% / 130%)
var startSz = 2;
//trgt = target item - either an id, or a tagname (in which case the first one will be selected)
//inc = incrementation of the elements size and lineheight (+1 or -1 would be used under normal circumstances for increment/decrement respectively)
function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	sz += inc;
	//if the sz counter exceeds the limits it is set to the first/last item respectively
	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 ];
			cTags[ j ].style.lineHeight = lszs[ sz ];
		}
	}
}

function reset(trgt)
{
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	sz = 2;
	//if the sz counter exceeds the limits it is set to the first/last item respectively
	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 ];
			cTags[ j ].style.lineHeight = lszs[ sz ];
		}
	}
}
