<!-- cloak 

// JavaScript which defines the various functions used to "glide" any layer object.
//
// Custom scripting by Paul DeBrino of Infinity Research and Development, Inc.
// For other scripts, or to place an order for customized scripts such as
//   on-line form scripting, please contact the owner via the contact form at infinity-rd.com
// If you wish to use this script, kindly keep these comments and (C)opyright within the
//   source code.  Permission granted for http://javascript.internet.com to publish this script.

// This shows off Internet Explorer's "Z-INDEX" property, which enables you to define
//   which "layer" is in front of (or behind) which other layer.  Think of it like a set
//   of transparancies; this property allows shuffling which sheet is in the front or rear.
// Also, take note of my function named "Glide( )" to which you would pass a string defining
//   the DIV Layer to animate by gliding it across the page.
// Also, take note of "setInterval", which uses "threads" to repeatedly evaluate an expression
//   after a specified number of milliseconds has elapsed.

// -----------
// TECH NOTES:
// -----------
// Define the layer to be initially hidden, with a top setting at it's "home" (final) position.
//   For example:  <STYLE> DIV#layerone { top:340; visibility:hidden; }
//                         DIV#layertwo { left:10; visibility:hidden; } </STYLE>
//
// Then, call function "Glide" while passing the layer name as a string, its start position
// in pixels as an integer, the move-increment amount in pixels as an integer (which can be
// positive or negative), and the direction in which to glide (either "V" vertical or "H"
// horizontal).
//
//   For example:  Glide('layerone',-40,10,'V')   *-or-*   Glide('layertwo',800,-30,'H')
//   In the 1st example, object "layerone" starts at point -40 (outside of view area), and
//   glides down (+) vertically 10 pixels until reaching it's home-position of 340 (as
//   defined by the DIV statement's "top" value).
//   In the 2nd example, object "layertwo" starts at point 800, and glides left (-)
//   horizontally 30 pixels until reaching it's home position of 10 (as defined by the DIV
//   statement's "left" value).
//
// Note that, if multiple "Glide" functions are invoked back to back, they will typically
//   run *-before-* their associated interval operation "GlideNow" occurs (due to Threading).
//   So it is necessary for this function to initially store the requested layer's name,
//   move-direction and interval-ID (assigned when "window.setInterval" is invoked).
//   Also stored is the layer's home position ("offsetTop" or "offsetLeft") because, once
//   the object is moved, the home-position value changes with it.
//
// Also note, when multiple objects are being moved, the "GlideNow" interval event is running
//   for each object, and in no particular order.  For example, if 3 objects are being
//   simutaneously moved, the interval event might be called for object 1, then 2, then 3,
//   then 2 .. 1 .. 2 .. 3 .. 2 .. 3 .. until all home positions are reached.

	var id;
	var xx = 0;
	var txtname;
	var txtTorL;
	var txtOper;
	var layer_name = new Array;
	var home_pos = new Array;
	var move_dir = new Array;
	var inter_id = new Array;
	
	function Glide(LYRname,intStartPos,intMoveBy,txtDir) {
	  if (txtDir == 'V')								// determine glide direction.
		{ txtTorL = 'Top'; }
		else txtTorL = 'Left'
	  xx = xx + 1;									// track objects requested to glide.
	  layer_name[xx] = eval(LYRname+'.id');						// store the layer's name.
	  home_pos[xx] = eval(LYRname+'.offset'+txtTorL);				/* store the layer's home position
											   before it gets moved.  */
	  move_dir[xx] = txtTorL							// store glide direction.
	  eval(LYRname+'.style.pixel'+txtTorL+'='+intStartPos);				// place layer in start pos. 	    
	  eval(LYRname+'.style.visibility="visible"');					// make layer visible.
	  eval('id = window.setInterval("GlideNow('+LYRname+','+intMoveBy+')",50)'); 	// run interval script every ##ms.
	  inter_id[xx] = id;								// store the assigned interval id.
	}
	
	function GlideNow(LYRglide,intMoveBy) {
	  lyrIs = LYRglide.id;									// resolve layer name from function's object.
	  for (ii=1; ii <= layer_name.length; ii++)		// locate interval event layer in array.
		{
		txtName = layer_name[ii];
		if (lyrIs == txtName)							// located.
			{
			intHomePos = home_pos[ii];					// set the layer's home pos.
			txtTorL = move_dir[ii];						// set the layer's glide direction.
			break;
			}
		}
	  eval(lyrIs+'.style.pixel'+txtTorL+'+='+intMoveBy);				// move the layer.
	  if (intMoveBy > 0)								// set operator based on moveby(+/-).
		{ txtOper = '>=' }
		else { txtOper = '<=' }
	  if (eval(lyrIs+'.style.pixel'+txtTorL+txtOper+intHomePos)) 			// layer reached home pos, stop.
		{
		eval(lyrIs+'.style.pixel'+txtTorL+'='+intHomePos)			// in case past home pos.
		window.clearInterval(inter_id[ii]);					// shut off the associated interval.
		}
	}

// decloak -->