﻿var theI = 1;
var hideIt;
var showIt;
var showing = 'intro';

var hidden = 720;
var shown = 0;
theZ = 1;
var steps = 30;
var dx;

function slideShow(objectId)
{

if(hideIt==null)	{hideIt = document.getElementById('intro');}
showIt = document.getElementById(objectId);

if (showIt==hideIt)		{showIt = document.getElementById('intro');}
showIt.style.zIndex = theZ;
theZ++;
dx = hidden/steps;
animate();
}

function animate()
{
if(theI<(steps-1))
	{showIt.style.left = (hidden-(dx*theI)) + 'px';
	hideIt.style.left = (shown+(dx*theI)) + 'px';
	theI++
	setTimeout('animate();', 10);
	}
else
	{showIt.style.left = shown + 'px';
	hideIt.style.left = hidden + 'px';
	hideIt = showIt;
	theI = 1;}
}

/*
object = document.getElementById(objectId);
slide = document.getElementById('slider');
dX = object.offsetLeft;	// distance of div from slider edge
cX = slide.offsetLeft;	// distance of slider from window (always -)
fX = -dX;	//Final position of slider is equal to -distance of div from edge
dX = (fX - cX)/steps; // distance slider must move each iteration is the difference between its final position and its current pos
theI = 1;
animate();}

function animate()
{if(theI<steps)
	{slide.style.left = Math.round(cX + dX*theI) + 'px';theI++;setTimeout("animate()", 0);}
else	{slide.style.left = fX + 'px'; return false;}}
*/