<script language="JavaScript1.2">
/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts.
This may be used freely as long as this msg is intact!
********************************************************************************/

/*If you want the text to appear differently on another place on the page
or anything set that in the style tag of the zoom layer. 

Here are the variables you have to set:                                                                 
First the text:*/
	text=new Array('JavaScript','Resources','JavaScript Resources','www.jsr.communitech.net')
	
//the color of the text:
	color="#000000"
	
//set the size you want the zoom to start at:
	var startSize=60
	
//set the size you want the zoom to end at:
	var endSize=5

//Set the speed you want it to zoom in (in milliseconds)
	var Zspeed=300

//Set font
	var font='Arial Black'
	
//do you want it to hide when its done? (true or false)
	var hide=true

/*You can remove this if you don't wan't it to start right away.
You can have it start if someone clicks a link (make a link like this:
<a href="#" onclick="fadeInit()">Click to Zoomtext</a>)*/
	onload=zoomInit;
	
/*You shouldn't really have to set anything below this point
****************************************************************************
****************************************************************************
*****************************************************************************/
var size=startSize
var gonum=0
/*Browsercheck and settings vars
****************************************************************************/
var ie, n;
if (document.all) {
		n=0
		ie=1
		zoomText='document.all.divZoom.innerText=text[num]'
		zoomSize='document.all.divZoom.style.fontSize=size'
		closeIt=""
		fadeColor="document.all.divZoom.style.color=color[num]"
	}
if (document.layers) {
		n=1;ie=0
		zoomText=""
		zoomSize="document.divZoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+size+'px; color:'+color+'\">'+text[num]+'</p>')"
		closeIt="document.divZoom.document.close()"
		fadeColor="document.divZoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+endSize+'px; color:'+color+'\">'+text[numText-1]+'</p>')"
	}

/*The functions for zooming text.
****************************************************************************/
function zoom(num,fn){
	if (size>endSize){
		eval(zoomText)
		eval(zoomSize)
		eval(closeIt)
   		size-=10;
		setTimeout("zoom("+num+",'"+fn+"')",Zspeed)
	}else{
		eval(fn)
	}
}

/*This is the function that hides the layer after the zoom/color change
****************************************************************************/
function hideIt(){
	if(hide){
		if(ie)document.all.divZoom.style.visibility="hidden"
		if(n)document.layers.divZoom.visibility="hidden"
	}
}
/*This is the functions that calls the right function...or something :}
****************************************************************************/
function zoomInit(){
	if(ie){
		//Added to make it center in ie5
		document.all.divZoom.style.width=document.body.offsetWidth-50
		document.all.divZoom.style.color=color
		document.all.divZoom.style.fontFamily=font
	}
	if(ie || n) go(0)	
}
function go(num){
	gonum+=1
	size=startSize
	if(num<text.length){
		zoom(num,'go('+gonum+')')
	}else{
		hideIt()
	}
}

function playAgain(){
	size=startSize
	gonum=0
	if(ie) document.all.divZoom.style.visibility='visible'
	else if(n) document.layers.divZoom.visibility='visible'
	zoomInit()
}
//***************************************************************************
</script>
</head>
<body>
<div align="center"><h1>Reverse Zooming Text</h1></div>
<!--This is the zoom div/layer, to change the appearance of this just change the stuff you want in the style tag. But remember you can only change width, top, height, left and that sorta stuff, if not you have to set them in the ns write thing as well.-->
<div id="divZoom" align="center" style="position:absolute; top:100"></div>
<div id="footer+text" style="position: absolute; left: 10; top: 200"><layer name="footer+text" left=10 top=200>
<p>As you can see, the script causes the text to seem to disappear into the distance. The script can easily be amended to leave the last line visible and static, if desired, though. Like the previous script, this would be ideal on an entry page to a site.</p><hr><p>Script by: <a href="http://www.bratta.com/">bratta</a>.</p>