/******************************************************************* * * Squint - javascript text resizer library * * Useage: include this file in the header, then use * renderSquintControls to render buttons, or tie a button to * squint(1) to increase size and squint(-1) to decrease size. * Bind initSquint to document.onload in order to allow cookies * to remember which size is chosen * * Iain Wallace, bit10 ltd 2004/11/11 * *******************************************************************/ var strCookieName = "squintStartSize"; var arrTags = new Array( 'div','td','tr','button','a','span'); var arrSizes = new Array( '12px','13px','14px','15px','16px','17px','18px','19px' ); var strTrace = ""; var intDefaultSize = 2; var intStartSize = intDefaultSize; var strDomain = ""; // Tie to the document onload event - sets the start size if it's in a cookie function initSquint(){ strTrace += "Init\n"; strDomain = document.domain; strTrace += "set domain to " + strDomain + "\n"; i = getCookieVal( strCookieName ); if( i ){ strTrace += "Cookie found with value " + i + "\n"; intStartSize = i; squint(0); } } // Draw the controls onto the page //function renderSquintControls(){ // document.write( "" ); // document.write( "" ); // document.write( "
+Larger   -Smaller
" ); //} // Function to resize text function squint( intInc ){ strTrace = ""; if (!document.getElementById) return if( squint.arguments.length > 1 ){ strTarget = squint.arguments[1]; }else{ strTarget = "body"; } var doc = document; var el = null; var intSize = intStartSize; var i,j,arr; intSize = eval( intSize + " + intInc" ); if ( intSize < 0 ) intSize = 0; if ( intSize > 6 ) intSize = 6; intStartSize = intSize; // Save intStartSize to cookie setCookieVal( strCookieName, intSize ); if ( !( el = doc.getElementById( strTarget ) ) ) el = doc.getElementsByTagName( strTarget )[ 0 ]; el.style.fontSize = arrSizes[intSize]; for ( i=0; i