<!--
var intMax = 23; // maximum number of transitions supported
var intTrans = intMax; // current transition
var speed = 2; // initial speed of transition
var fRunning = 0;
var speedDirection = 0;
var aColors = new Array ( 24 ); // array of colorpair objects
/* constructor for a color pair object. holds a foreground and a background color */
function ColorPair ( sColor, sBGColor ) {
this.m_color = sColor;
this.m_bgColor = sBGColor;
}
/* build a global table of foreground/background color pairs. Initially these were calculated, but, due to collisions, the use of a table guarantees that the fg/bg colors never match. If a new transition is added, the table must be expanded. */
function colors ( ) {
aColors [ 0 ] = new ColorPair ( '#000000', '#FFFFFF' );
aColors [ 1 ] = new ColorPair ( '#035b60', '#1174c0' );
aColors [ 2 ] = new ColorPair ( '#033450', '#10a9a0' );
aColors [ 3 ] = new ColorPair ( '#030d40', '#0fde80' );
aColors [ 4 ] = new ColorPair ( '#02e630', '#0f1360' );
aColors [ 5 ] = new ColorPair ( '#02bf20', '#0e4840' );
aColors [ 6 ] = new ColorPair ( '#029810', '#0d7d20' );
aColors [ 7 ] = new ColorPair ( '#027100', '#0cb200' );
aColors [ 8 ] = new ColorPair ( '#0249f0', '#0be6e0' );
aColors [ 9 ] = new ColorPair ( '#0222e0', '#ff0000' );
aColors [ 10 ] = new ColorPair ( '#01fbd0', '#0a50a0' );
aColors [ 11 ] = new ColorPair ( '#01d4c0', '#098580' );
aColors [ 12 ] = new ColorPair ( '#01adb0', '#08ba60' );
aColors [ 13 ] = new ColorPair ( '#0186a0', '#07ef40' );
aColors [ 14 ] = new ColorPair ( '#015f90', '#072420' );
aColors [ 15 ] = new ColorPair ( '#013880', '#065900' );
aColors [ 16 ] = new ColorPair ( '#011170', '#058de0' );
aColors [ 17 ] = new ColorPair ( '#00ea60', '#04c2c0' );
aColors [ 18 ] = new ColorPair ( '#00c350', '#03f7a0' );
aColors [ 19 ] = new ColorPair ( '#009c40', '#032c80' );
aColors [ 20 ] = new ColorPair ( '#007530', '#026160' );
aColors [ 21 ] = new ColorPair ( '#004e20', '#019640' );
aColors [ 22 ] = new ColorPair ( '#002710', '#00cb20' );
aColors [ 23 ] = new ColorPair ( '#038270', '#123fe0' );
}
function Repeat ( ) {
fRunning = 0;
Count ( );
}
function Count ( ) {
if ( fRunning == 0 ) {
fRunning = 1;
transBox.filters [ 0 ].transition = intTrans;
transBox.filters [ 0 ].apply ( );
transBox.innerText = intTrans;
transDesc.innerText = iTransDesc ( intTrans );
// bounds check just in case
if ( intTrans <= aColors.length ) {
transBox.style.backgroundColor = aColors [ intTrans ].m_bgColor;
transBox.style.color = aColors [ intTrans ].m_color;
}
transBox.filters [ 0 ].play ( speed );
if ( intTrans == 0 ) {
intTrans = intMax; // take it from the top
return;
}
intTrans --;
if ( speed > 2 ) {
speed -= 2;
}
}
}
function iTransDesc ( t ) {
if ( t == 0 ) return "Box In"
if ( t == 1 ) return "Box Out"
if ( t == 2 ) return "Circle In"
if ( t == 3 ) return "Circle Out"
if ( t == 4 ) return "Wipe Up"
if ( t == 5 ) return "Wipe Down"
if ( t == 6 ) return "Wipe Right"
if ( t == 7 ) return "Wipe Left"
if ( t == 8 ) return "Vertical Blinds"
if ( t == 9 ) return "Horizontal Blinds"
if ( t == 10 ) return "Checkerboard Across"
if ( t == 11 ) return "Checkerboard Down"
if ( t == 12 ) return "Random Dissolve"
if ( t == 13 ) return "Split Horizontal In"
if ( t == 14 ) return "Split Horizontal Out"
if ( t == 15 ) return "Split Vertical In"
if ( t == 16 ) return "Split Vertical Out"
if ( t == 17 ) return "Strips Left Down"
if ( t == 18 ) return "Strips Left Up"
if ( t == 19 ) return "Strips Right Down"
if ( t == 20 ) return "Strips Right Up"
if ( t == 21 ) return "Random Bars Horizontal"
if ( t == 22 ) return "Random Bars Vertical"
if ( t == 23 ) return "Random"
}
//-->