
IE4 = navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4;	
NS4 = navigator.appName.substring(0,8) == "Netscape" && parseInt(navigator.appVersion) >= 4;
	
// checkBrowser() -- Checks whether the browser is new enough for some DynamicMovement ...

function checkBrowser(){
	if(IE4 || NS4){
		return true;
	}
	return false;
}

// movableObj() -- Creates a new movable object

function movableObj(startX, startY, endX, endY, delay, speed, refId){
	this.sX = startX;
        this.sY = startY;
	this.eX = endX;
	this.eY = endY;
	this.de = delay;
        this.sp = speed;
	this.ref = refId;
	xL = endX - startX;
	yL = endY - startY;

	with (Math){
		if(abs(xL) > abs(yL)){
			this.xS = (xL > 0)?1:-1;
			this.yS = (yL > 0)?abs(yL / xL):-abs(yL / xL);
			this.howManySteps = abs(xL / speed);
		} else if(abs(yL) > abs(xL)){
			this.yS = (yL > 0)?1:-1;
			this.xS = (xL > 0)?abs(xL / yL):-abs(xL / yL);
			this.howManySteps = abs(yL / speed);
		} else {
			this.yS = (yL > 0)?1:-1;
			this.xS = (xL > 0)?1:-1;
			this.howManySteps = abs(xL / speed);
		}
	}
	this.startMovement = startMovement;
}

function movableObj1(startX, startY, endX, endY, delay, speed, refId){
	this.sX1 = startX;
        this.sY1 = startY;
	this.eX1 = endX;
	this.eY1 = endY;
	this.de1 = delay;
        this.sp1 = speed;
	this.ref1 = refId;
	xL1 = endX - startX;
	yL1 = endY - startY;

	with (Math){
		if(abs(xL1) > abs(yL1)){
			this.xS1 = (xL1 > 0)?1:-1;
			this.yS1 = (yL1 > 0)?abs(yL1 / xL1):-abs(yL1 / xL1);
			this.howManySteps1 = abs(xL1 / speed);
		} else if(abs(yL1) > abs(xL1)){
			this.yS1 = (yL1 > 0)?1:-1;
			this.xS1 = (xL1 > 0)?abs(xL1 / yL1):-abs(xL1 / yL1);
			this.howManySteps1 = abs(yL1 / speed);
		} else {
			this.yS1 = (yL1 > 0)?1:-1;
			this.xS1 = (xL1 > 0)?1:-1;
			this.howManySteps1 = abs(xL1 / speed);
		}
	}
	this.startMovement1 = startMovement1;
}

function movableObj2(startX, startY, endX, endY, delay, speed, refId){
	this.sX2 = startX;
        this.sY2 = startY;
	this.eX2 = endX;
	this.eY2 = endY;
	this.de2 = delay;
        this.sp2 = speed;
	this.ref2 = refId;
	xL2 = endX - startX;
	yL2 = endY - startY;

	with (Math){
		if(abs(xL2) > abs(yL2)){
			this.xS2 = (xL2 > 0)?1:-1;
			this.yS2 = (yL2 > 0)?abs(yL2 / xL2):-abs(yL2 / xL2);
			this.howManySteps2 = abs(xL2 / speed);
		} else if(abs(yL2) > abs(xL2)){
			this.yS2 = (yL2 > 0)?1:-1;
			this.xS2 = (xL2 > 0)?abs(xL2 / yL2):-abs(xL2 / yL2);
			this.howManySteps2 = abs(yL2 / speed);
		} else {
			this.yS2 = (yL2 > 0)?1:-1;
			this.xS2 = (xL2 > 0)?1:-1;
			this.howManySteps2 = abs(xL2 / speed);
		}
	}
	this.startMovement2 = startMovement2;
}

// startMovement() -- starts the movement

function startMovement(){
	if(checkBrowser()){
		if(IE4){
			ref = document.all(this.ref).style;
		} else {
			ref = document[this.ref];
		}
		doDynamicMovement(this.sX, this.sY, this.eX, this.eY, this.de, this.xS, this.yS, ref, this.sp, this.howManySteps, this.ref);
	}
}

function startMovement1(){
	if(checkBrowser()){
		if(IE4){
			ref1 = document.all(this.ref1).style;
		} else {
			ref1 = document[this.ref1];
		}
		doDynamicMovement1(this.sX1, this.sY1, this.eX1, this.eY1, this.de1, this.xS1, this.yS1, ref1, this.sp1, this.howManySteps1, this.ref1);
	}
}

function startMovement2(){
	if(checkBrowser()){
		if(IE4){
			ref2 = document.all(this.ref2).style;
		} else {
			ref2 = document[this.ref2];
		}
		doDynamicMovement2(this.sX2, this.sY2, this.eX2, this.eY2, this.de2, this.xS2, this.yS2, ref2, this.sp2, this.howManySteps2, this.ref2);
	}
}
// doDynamicMovement() -- does the Dynamic Movement

function doDynamicMovement(curX, curY, eX, eY, delay, xS, yS, ref, speed, hS){
	if(Math.floor(hS - 1) != 0){
//alert ("Delay:    " + delay);
		hS--;
		curX += xS * speed;
		curY += yS * speed; 
		ref.left = Math.round(curX);
		ref.top = Math.round(curY);
		setTimeout("doDynamicMovement(" + curX + ", " + curY + ", " + eX + ", " + eY + ", " + delay + ", " + xS + ", " + yS + ", ref, " + speed + ", " + hS + ")", delay);
	} else {
		setPos(eX, eY, ref);	
	}
}

function doDynamicMovement1(curX1, curY1, eX1, eY1, delay1, xS1, yS1, ref1, speed1, hS1){
	if(Math.floor(hS1 - 1) != 0){
//alert ("Delay1:    " + delay1);
		hS1--;
		curX1 += xS1 * speed1;
		curY1 += yS1 * speed1; 
		ref1.left = Math.round(curX1);
		ref1.top = Math.round(curY1);
		setTimeout("doDynamicMovement1(" + curX1 + ", " + curY1 + ", " + eX1 + ", " + eY1 + ", " + delay1 + ", " + xS1 + ", " + yS1 + ", ref1, " + speed1 + ", " + hS1 + ")", delay1);
	} else {
		setPos(eX1, eY1, ref1);	
	}
}

function doDynamicMovement2(curX2, curY2, eX2, eY2, delay2, xS2, yS2, ref2, speed2, hS2){
	if(Math.floor(hS2 - 1) != 0){
//alert ("Delay2:    " + delay2);
		hS2--;
		curX2 += xS2 * speed2;
		curY2 += yS2 * speed2; 
		ref2.left = Math.round(curX2);
		ref2.top = Math.round(curY2);
		setTimeout("doDynamicMovement2(" + curX2 + ", " + curY2 + ", " + eX2 + ", " + eY2 + ", " + delay2 + ", " + xS2 + ", " + yS2 + ", ref2, " + speed2 + ", " + hS2 + ")", delay2);
	} else {
		setPos(eX2, eY2, ref2);	
	}
}

// setPos() -- sets the end position accurately when doDynamicMovement has done its job

function setPos(x, y, ref){
	ref.left = x;
	ref.top = y;
}

/********************************************************************************
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: (it will stop and fade/change the colors on the last one)*/
	text=new Array('plan','build','perfect','publish','promote')
        
//Now the colors:
//all you have to do is set the color you want to have in here: 
//(the first color will be the color that the text is when it zooms.)
	color=new Array('#202020','#424242','#8E8E8E','#C2C2C2','#E8E8E8','#ffffff')
        
//set the number of colors:
	var numColors=6
        
//set the size you want the zoom to end at:
	var endSize=70

//Set the speed you want it to zoom in (in milliseconds)
	var Zspeed=80

//Set the speed you want it too change colors in
	var Cspeed=200

//Set font
	var font='Verdana,Arial Black,Arial'
        
//do you want it to hide when its done? (true or false)
	var hide=true
        



/*You shouldn't really have to set anything below this point
****************************************************************************
*****************************************************************************/
var size=10
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=\"left\" style=\"font-family:'+font+'; font-size:'+size+'px; color:'+color[0]+'\">'+text[num]+'</p>')"
	closeIt="document.divZoom.document.close()"
	fadeColor="document.divZoom.document.write('<p align=\"left\" style=\"font-family:'+font+'; font-size:'+endSize+'px; color:'+color[num]+'\">'+text[text.length-1]+'</p>')"
}

/*The functions for zooming text.
****************************************************************************/
function zoom(num,fn){
	if (size<endSize){
		eval(zoomText)
		eval(zoomSize)
		eval(closeIt)
		size+=5;
		setTimeout("zoom("+num+",'"+fn+"')",Zspeed)
	}else{
		eval(fn);
	}
}
/*The functions for fading/changing colors on text
****************************************************************************/
function fadeIt(num){
	if (num<numColors){
		eval(fadeColor)
		eval(closeIt)
		num+=1;
		setTimeout("fadeIt("+num+")",Cspeed)
	}else{
		hideIt()
	}
}
/*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"
	}
	gonum = 0;
}
/*This is the functions that calls the right function...or something :}
****************************************************************************/
function fadeInit(){
	if(ie){
//alert ("font: " + font);
		//Added to make it center in ie5
		document.all.divZoom.style.width=document.body.offsetWidth-50
		document.all.divZoom.style.color=color[0]
		document.all.divZoom.style.fontFamily=font
		document.all.divZoom.style.visibility="visible"
	}
	if(ie || n) go(0)       
}
function go(num){
//alert ("zoom; " + num);
	gonum+=1
    size=10
    if(num<text.length){
    	zoom(num,'go('+gonum+')')
	}else{
		fadeIt(0)
	}
}

//***************************************************************************
