/*
  3D Dynamic Text Twister.  Author Joe McCormack.  Copyright 2003.  All Rights Reserved.
  http://www.geocities.com/code_stratos/
*/
var degree_pos = new Array(), alabel = new String(), ftmsg = new String();
var ftcolorf, ftcolorb, fttext, ftbold, ftmin, ftminlay, ttpause, fux, fuy, ftyoffset, ftfixed;
var loopcount = 360, local_z = 180, local_left = 0, ftspotcolor, fontdim, ftpos, query = 0; 
var allunits, fthalt = 0, ftdegspace = 0, maxx, maxy, ftx, fty;
function ontwist(a, b, c, d, e, f, g, h, i, j, k, l) {
ftmsg = a, ftcolorf = b, ftcolorb = c, fttext = d, ftbold = e, ftmin = f, ftminlay = g, ttpause = h, fux = i, fuy = j, ftyoffset = k, ftfixed = l;
if (ftmsg.length < 2) { ftmsg += " "; }
allunits = ftmsg.length; browsize();
ftdegspace = Math.round(360 / allunits);
if (ftfixed == "false") { ftx = fux; fty = fuy; }
for (tt = 0; tt != allunits; tt++) {
query = tt; tscaler();
vortex.innerHTML += "<div id=\"whirl"+tt+"\" style=\"position:absolute;visibility:visible;top:"+fty+";left:"+ftx+";z-index:"+local_z+";font-size:"+fontdim+";font-family:"+fttext+";font-style:"+ftbold+";color:"+ftspotcolor+";\"></div>"
alabel = "whirl" + tt; window.document.getElementById(alabel).innerHTML = ftmsg.charAt(tt);
if (tt == 0) { degree_pos[tt] = loopcount; }
if (tt >= 1) { degree_pos[tt] = loopcount - (ftdegspace * tt); }
loopcount--;
}
fthalt = 0; twista();
}
function twista() {
loopcount = degree_pos[query]; loopcount++; if (loopcount > 359) { loopcount = 0; }
degree_pos[query] = loopcount; query++; if (query >= allunits) { query = 0; }
fontdim = 0; local_z = 0; local_left = 0; ftspotcolor = "";
if (fthalt == 0) { setTimeout('twistb()', ttpause); }
}
function twistb() {
if (fthalt == 0) {
tscaler(); alabel = "whirl" + query;
window.document.getElementById(alabel).style.fontSize = fontdim;
window.document.getElementById(alabel).style.zIndex = local_z;
window.document.getElementById(alabel).style.left = local_left;
window.document.getElementById(alabel).style.color = ftspotcolor;
twista();
}
if (fthalt != 0) {
vortex.style.visibility = "hidden"; vortex.innerHTML = ""; loopcount = 360; local_z = 180; fontdim = 0;
local_z = 0; local_left = 0; ftspotcolor = ""; for (tca = 0; tca != allunits; tca++) { degree_pos[tca] = 0; }
}
}
function tscaler() {
if (loopcount < 360 && loopcount > 269) { local_z = (ftminlay + 90) + (360 - loopcount); fontdim = ftmin + (45 + ((360 - loopcount) / 2)); local_left = ftx + (360 - loopcount); ftspotcolor = ftcolorf; }
if (loopcount < 270 && loopcount > 179) { local_z = (ftminlay + 270) - loopcount; fontdim = ftmin + ((loopcount / 2) - 45); local_left = ftx + (360 - loopcount); ftspotcolor = ftcolorf; }
if (loopcount < 180 && loopcount > 89) { local_z = (ftminlay + loopcount) - 180; fontdim = ftmin + ((loopcount / 2) - 45); local_left = ftx + loopcount; ftspotcolor = ftcolorb; }
if (loopcount < 90 && loopcount >= 0) { local_z = (ftminlay + 90) - loopcount; fontdim = ftmin + (45 - (loopcount / 2)); local_left = ftx + loopcount; ftspotcolor = ftcolorb; }
}
function offtwist() { fthalt = 1; }
function browsize() {
ftx = event.clientX; fty = (event.clientY - ftyoffset);
maxy = window.document.body.clientHeight;
maxx = window.document.body.clientWidth;
maxy = maxy / 2; maxx = maxx / 2;
}