<!-- hide from JavaScript-challenged browsers
manu=navigator.appName;			
vers=navigator.appVersion;		

	if (manu.indexOf("Microsoft")>=0 && vers.indexOf("4")>=0)
		{;}
	else if (manu.indexOf("Microsoft")>=0 && vers.indexOf("5")>=0)
		{;}	
		
	else if (manu.indexOf("Netscape")>=0 && vers.indexOf("4")>=0)
		{;}
	else if (manu.indexOf("Netscape")>=0 && vers.indexOf("5")>=0)
		{;}	
	else
		{location.href="../index.html";}

function animatedObject(elementName,loop,speed,steps,endRoutines,route){
  this.elementName = elementName;
  this.loop = loop;
  this.speed = speed;
  this.steps = steps;
  this.frameIndex = 0;
  this.endRoutines = endRoutines;
  this.route = route.split(',');
  this.animate = animateObject;
  this.move = moveObject;
  this.show = showObject;
  this.hide = hideObject;

  animatedObjects[elementName] = this;
}

// stopTimeline()
// This function stops a timeline, just pass it the timeline's 
// number.

function stopTimeline(timelineNumber){
   animationTime[timelineNumber] = animationTimeline[timelineNumber].length;
}

// startTimeline()
// This function starts a timeline, just pass it the timeline's 
// number.

function startTimeline(timelineNumber) {
  animationTime[timelineNumber] = 0;
  timelineController(timelineNumber);
}

// timelineController()
// This function controls the timeline, it recurisively runs 
// itself every 100 milliseconds.

function timelineController(timelineNumber) {
    if (animationTime[timelineNumber] <= animationTimeline[timelineNumber].length - 1) {
      animationTime[timelineNumber]++;
        if (animationTimeline[timelineNumber][animationTime[timelineNumber]] != null){
          eval(animationTimeline[timelineNumber][animationTime[timelineNumber]]);
        }
        setTimeout('timelineController(' + timelineNumber + ')', 100);
    }
}

// showObject()
// This function makes an HTML element visible.

function showObject(){
  eval(layerObj + '["' + this.elementName + '"]' + styleObj + '.visibility = "visible"');
}

// hideObject()
// This function makes an HTML element hidden.

function hideObject(){
  eval(layerObj + '["' + this.elementName + '"]' + styleObj + '.visibility = "hidden"');
}
  
// moveObject()
// This function moves an HTML element to a given position.
// Pass it the and x and y coordinates.

function moveObject(left, top){
  eval(layerObj + '["' + this.elementName + '"]' + styleObj + '.top = top');
  eval(layerObj + '["' + this.elementName + '"]' + styleObj + '.left = left');
}

// doAnimation()
// This function actually interprets the animated object's 
// properties and then animates the animated object. Just
// pass it the number of the animated object.

function animateObject(){
    if (this.route.length > 4 && this.frameIndex < this.route.length)  {
      this.move(this.route[this.frameIndex], this.route[this.frameIndex + 1]);
      this.frameIndex += 2;
      setTimeout('animatedObjects["' + this.elementName + '"].animate()', this.speed);
    }
    else if (this.route.length == 4 && this.frameIndex <= this.steps) {
      this.move(parseInt(this.route[0]) + (this.frameIndex * ((parseInt(this.route[2]) - parseInt(this.route[0])) / this.steps)), parseInt(this.route[1]) + (this.frameIndex * ((parseInt(this.route[3]) - parseInt(this.route[1])) / this.steps)));
      this.frameIndex++;
      setTimeout('animatedObjects["' + this.elementName + '"].animate()', this.speed);         
    }
    else {
      eval(this.endRoutines + "");
      this.frameIndex = 0;
        if (this.loop == "yes"){
          this.animate();
        }
    }
}

function initAnimation() {
  layerObj 		= (isNS) ? 'document' : 'document.all';
  styleObj 		= (isNS) ? '' : '.style';
  animationTime 	= new Array();
  animationTimeline 	= new Array();
  animatedObjects 	= new Object();

  lodL		= new animatedObject('lod','null','null', 'null', "null",'null');
  snow1L 	= new animatedObject('snow1','yes',40, 400, "null",'0,-800, 0,0');  

  sleigh1L 	= new animatedObject('sleigh1','no', 40, 150, "treeL.animate(); snowmanL.animate();",'-200, 460, 1020, 195');
  plane1L  	= new animatedObject('plane1','no', 40, 90, "null", ' -200,385, 1020, 135');
  treeL   	= new animatedObject('tree','no', 20, 50, "null",'190, 680, 190, 455');
  snowmanL 	= new animatedObject('snowman','no', 20, 50, "null",'490, 680, 490, 455');
  merryL  	= new animatedObject('merry','no', 40, 50, "null",'115, -100, 115, 50');
  deer2L   	= new animatedObject('deer2','no', 30, 150, "sleigh2L.animate();",'1020, 435, -350, 135');
  peaceL   	= new animatedObject('peace','no', 40, 50, "null",'325, -100, 325, 375');
  sleigh2L 	= new animatedObject('sleigh2','no', 40, 60, "rtoyzL.animate(); fromL.animate(); no1L.hide();",'-200, 150, 300, -35');
  no1L 		= new animatedObject('no1','no', 40, 50, "null",'335, 260, 335, 260');
  plane2L  	= new animatedObject('plane2','yes', 40, 50, "null",'320, 255, 1020, 255');
  rtoyzL  	= new animatedObject('rtoyz','no', 40, 50, "plane2L.animate();",'240, 255, 240, 255');
  fromL  	= new animatedObject('from','no', 40, 50, "backL.animate(); nextL.animate();",'330, 185, 330, 185');
  backL    	= new animatedObject('back','no','40', '50', "null",'5, 455, 5, 455');
  nextL    	= new animatedObject('next','no','40', '50', "null",'730, 455, 730, 455');
  
  animationTimeline[0]		= new Array();
  animationTimeline[0][1]   	= 'lodL.hide();';
  animationTimeline[0][2] 	= 'snow1L.animate();';
  animationTimeline[0][3] 	= 'sleigh1L.animate();';
  animationTimeline[0][15] 	= 'plane1L.animate();';
  animationTimeline[0][80] 	= 'deer2L.animate();';
  animationTimeline[0][7] 	= 'merryL.animate();';
  animationTimeline[0][8] 	= 'peaceL.animate();';

  startTimeline(0);
  
}

var layerObj, styleObj, totalTime, currTime;
var animationTime, animationTimeline, animatedObjects;
var bon, boff;

var isNS = (document.layers);
var isDHTML = (document.layers || document.all);

function openWindow(url) {
  popupWin = window.open ('toyz.htm');
}

function openWindow1(url) {
  popupWin = window.open ('xmas-page2/redtoyz-xmas1.htm');
}


function exitWindow(url) {
  popupWin = window.open(url, 'exit', 'menubar,toolbar,location,directories,status,scrollbars,resizable,width=590,height=400');
}

// done hiding -->
