var frameShowing = 0;
var frameToRestart = 0;
var timer = null;
var frameToShow = 0;
var frameToLoad = 0;
var layer = null;
var LoadList = new Array();
var firstTime = 1;
var left = 0;
var top = 0;
var Anim = null;
var AnimParm = new Array();
var Also = new Array();
var AlsoDo = new Array();
var fadeIn = 0;
var FadeParm = new Array();
var fadeOut = 0;
var FadeoutParm = new Array();
var keepFrame = 0;
var framesToHide = new Array();
framesToHide[0] = null;
var ActionFlag = null;
var commandString = null;
var frameWait = 0;
var SwapParm = new Array();
var Resume = 0;
var SM = new Array();
for (z  = 0; z < 10; z++)
	{
	AlsoDo[z] = new Array(); SM[z] = new Array();
	}

if (browser =='ns4')
         	{
         	window.captureEvents(Event.MOUSEDOWN); 
	window.onmousedown = SetClick;
	}
 else
         	{ 
	document.oncontextmenu = new Function("return false");
	if (browser == 'ie4')
		{
         		document.onmousedown = DisallowClick;
         		}
	}

function init()
	{ 
      if (browser == 'ns4') 
		{
            layerStyleRef="layer.";
            layerRef="document.layers";
		styleSwitch="";
		startDelim="['";
		endDelim="']";
            	}
	else
		{
		if (browser == 'ie4' )
			{
                 	layerStyleRef="layer.style.";
                  layerRef="document.all";
                 	styleSwitch=".style";
			startDelim=".";
			endDelim="";
            	}
		else
			{
			if (browser == 'DOM')
				{ 
                   	layerStyleRef="layer.style.";
                   	layerRef="document.getElementById";
                   	styleSwitch=".style";
				startDelim="('";
				endDelim="')";
            		}
			}
		}
	buildImageList();
	findFrameToLoad();
	if (initTime == 0)
		{ 
		hideLayer("initlayer");
		commandString = ImgShown[frameToShow][0];
		if (commandString == '0' | commandString == 0 | commandString == 
null)
			{ 
			showNextLayer(1);
			} 
		else
			{ 
			eval(commandString);
			}
		}
	else
		{
		initT = initTime * 1000;
		initTime = 0;
		timer=setTimeout("init()",initT);
		}
	}
     
function buildImageList()
	{ 
	for (i = 0; i < ImgShown.length; i++)
		{
		LoadList[i] = new Array();
		LoadList[i][0] = null; LoadList[i][1] = null;
		for (k = 1; k < ImgShown[i].length; k++)
			{
			LoadList[i][k] = 0;
			}
		}
	for (i = 0; i < ImgShown.length; i++)
		{
		for (k = 1; k < ImgShown[i].length; k++)
			{
			checkDuplicate(i,k);
			}
		}
	}

function checkDuplicate()
	{ 
	x = checkDuplicate.arguments[0];
	y = checkDuplicate.arguments[1];
	image = ImgShown[x][y];
	for (ii = x + 1; ii < ImgShown.length; ii++)
		{ 
		for (kk = 1; kk < ImgShown[ii].length; kk++)
			{
			if (ImgShown[ii][kk] == image)
				{
				LoadList[ii][kk] = 1; 
				}
			}
		}
	}

function findFrameToLoad()
	{ 
	if (frameToLoad < ImgShown.length)
		{
		if (ImgShown[frameToLoad].length == 1)
			{
			frameToLoad = frameToLoad + 1;
			findFrameToLoad();
			}
		else
			{
			for (i = 1; i< ImgShown[frameToLoad].length; i++)
				{
				if (browser == 'ns4')
					{
					img = eval(layerRef+startDelim+'layer'+frameToLoad+endDelim+'.document.images.layer'+
frameToLoad+'img'+i); 
					}
				else
					{ 
					img = eval(layerRef+startDelim+'layer'+frameToLoad+'img'+i+endDelim);
					}
				setImage('L',frameToLoad,i);
				}
			frameToLoad = frameToLoad + 1;
			preLoad = preLoad - 1; 
			findFrameToLoad();
			}
		}
	}
	

function setUpFrame()
	{ 
	keepFrame = 0;
	framesToHide [0] = null;
	ActionFlag = null; left = 0; top = 0;
	fadeIn = 0; fadeOut = 0;
	frameWait = 0; SwapParm[0] = 0;
	Anim = null; Also = 0;

	for (a = 0; a < setUpFrame.arguments.length; a++)
		{
		if (setUpFrame.arguments[a] == "keep")
			{
			keepFrame = 1;
			}
		if (setUpFrame.arguments[a] == "wait")
			{
			frameWait = setUpFrame.arguments[a + 1];
			if (firstTime == 1)
				{
				if (frameWait !== 0)
					{
					frameWait = frameWait + initDelay;
					}
				}
			frameWait = frameWait * 1000;
			if (Resume == 1)
				{
				frameWait = 0;
				Resume = 0;
				}
			}
		if (setUpFrame.arguments[a] == "hide")
			{
			h = 0;
			e = 0;
			for (k = a + 1; k < setUpFrame.arguments.length; k++)
				{
				if (e == 0)
					{
					if (setUpFrame.arguments[k] !== "end")
						{
						if (setUpFrame.arguments[k] < 0)
							{
							framesToHide[h] = frameToShow + setUpFrame.arguments[k];
							}
						else
							{
							framesToHide[h] = setUpFrame.arguments[k];
							}
						framesToHide[h + 1] = null;
						h = h + 1;
						}
					else
						{
						e = 1;
						}
					}
				else
					{
					e = 1;
					}
				}
			}
		if (setUpFrame.arguments[a] == "left")
			{
			left = setUpFrame.arguments[a + 1];
			}
		if (setUpFrame.arguments[a] == "top")
			{
			top = setUpFrame.arguments[a + 1];
			}
		if (setUpFrame.arguments[a] == "click")
			{
			ActionFlag = 'C';
			}
		if (setUpFrame.arguments[a] == "fadein")
			{
			fadeIn = 1; FadeParm = setUpFrame.arguments[a + 1]; 
			}
		if (setUpFrame.arguments[a] == "fadeout")
			{
			fadeOut = 1; FadeoutParm = setUpFrame.arguments[a + 1];
			}
		if (setUpFrame.arguments[a] == "move")
			{
			AnimParm = setUpFrame.arguments[a + 1];
			Anim = 'M';
			}
		if (setUpFrame.arguments[a] == "resize")
			{
			AnimParm = setUpFrame.arguments[a + 1];
			Anim = 'R';
			}
		if (setUpFrame.arguments[a] == "moveandresize")
			{
			AnimParm = setUpFrame.arguments[a + 1];
			Anim = 'MR';
			}
		if (setUpFrame.arguments[a] == "swapimages")
			{
			for (i = 1; i< ImgShown[frameToShow].length; i++)
				{ 
				SwapParm [i + 1] = ImgShown[frameToShow][i];
				SwapParm [0] = SwapParm[0] + 1;
				}
			SwapParm [1] = setUpFrame.arguments[a + 1];
			}
		if (setUpFrame.arguments[a] == "showlayers")
			{
			Also += 1;
			for (x = 0; x < setUpFrame.arguments[a + 1]; x++)
				{
				AlsoDo [1][x] = setUpFrame.arguments [a + 2 + x];
				} 
			}
		if (setUpFrame.arguments[a] == "movelayers")
			{
			Also += 2; 
			for (x = 0; x < setUpFrame.arguments[a + 1]; x++)
				{
				AlsoDo [0][x] = setUpFrame.arguments [a + 2 + x];
				} 
			}
		}
	showNextLayer(1);
	}

function showNextLayer()
	{ 
	if (showNextLayer.arguments[0] == 0)
		{
		keepFrame = 0; left = 0; top = 0;
		framesToHide[0] = null; Also = 0;
		ActionFlag = null; Anim = null; 
		fadeIn = 0; fadeOut = 0; SwapParm[0] = 0;
		}	
     	loadDups();	
 	findFrameToLoad();
	if (keepFrame == 0)
		{
		if (framesToHide[0] == null)
			{
			if (fadeOut == 1)
				{
				StartFadeText(1,eval('"layer' + frameShowing+'"'),FadeoutParm);
				}
			hideLayer(eval('"layer' + frameShowing+'"'));
			}
		else
			{
			for (h = 0; h < 20; h++)
				{
				if (framesToHide[h] !== null)
					{
					hideLayer(eval('"layer' + framesToHide[h] + '"'));
					}
				else
					{
					h = 20;
					}
				}
			}
		}
	frameShowing = frameToShow;
	showLayer(eval('"layer' + frameToShow+'"'));
	frameToShow = frameShowing+1;
	if (frameToShow > ImgShown.length - 1)
		{
		frameToShow = loopBackTo;
		firstTime = 0;
		if (atTheEnd == 'stop')
			{
			ActionFlag = 'C';
			}
		else
			{
			if (atTheEnd != 'loop')
				{
				eval(atTheEnd);
				}
			}
		}
	if (Also == 1)
		{ 
		startShowLayers(AlsoDo[1],0);
		}
	if (Also == 2)
		{
		startSimultaneousMove(AlsoDo[0]);
		}
	if (Also ==3)
		{
		startShowLayers(AlsoDo[1],AlsoDo[0]);
		}
	if (left > 0)
		{
		layer = eval('"layer' + frameShowing+'"'); 
		eval(layerRef+startDelim+layer+endDelim+styleSwitch+'.left='+left);
		}
	if (top > 0)
		{
		layer = eval('"layer' + frameShowing+'"'); 
		eval(layerRef+startDelim+layer+endDelim+styleSwitch+'.top='+top);
		}
	if (fadeIn == 1)
		{ 
		StartFadeText(1,eval('"layer' + frameShowing+'"'),FadeParm);
		} 
	else
		{
		if (Anim == 'M')
			{
			startMove(AnimParm);
			}
		else
			{
			if (Anim == 'MR')
				{
				startMoveAndResize(AnimParm);
				}
			else
				{
				if (Anim == 'R')
					{
					startSize(AnimParm);
					}
				else
					{
					if (SwapParm[0] > 0)
						{
						startSwap(SwapParm);
						}
					else
						{
						scheduleNextLayer();
						}
					}
				}
			}
		}
	}

function StartFadeText()
	{
	x = StartFadeText.arguments [0];
	layerToFade = StartFadeText.arguments[1];
	cR = StartFadeText.arguments[2][0];
	cG = StartFadeText.arguments[2][1];
	cB = StartFadeText.arguments[2][2];
	lastR = StartFadeText.arguments[2][3];
	lastG = StartFadeText.arguments[2][4];
	lastB = StartFadeText.arguments[2][5];
	fT = StartFadeText.arguments[2][6];
	i = Math.round((fT * 1000) / 50);
	R = Math.round((lastR - cR) / i);
	G = Math.round((lastG - cG) / i);
	B = Math.round((lastB - cB) / i);
	fadeText(x,layerToFade,i,cR,R,cG,G,cB,B,fT);
	}

function fadeText()
	{ 
	if (browser == 'DOM')
		{ 
		layerToFade = fadeText.arguments[1];
		i = fadeText.arguments[2];
		cR = fadeText.arguments[3];
		R = fadeText.arguments[4];
		cG = fadeText.arguments[5];
		G = fadeText.arguments[6];
		cB = fadeText.arguments[7];
		B = fadeText.arguments[8]; 
		fT = fadeText.arguments[9]; 
		if (i > 0) 
			{ 
			cR = cR + R;
			cG = cG + G;
			cB = cB + B;
			eval(layerRef+startDelim+layerToFade+endDelim+styleSwitch+'.color="rgb("+cR+","+cG+","+cB+")"');
			i = i - 1;
            	ftimer=setTimeout("fadeText(1,layerToFade,i,cR,R,cG,G,cB,B,fT)",fT); 
            	}
		else
			{
			if (fadeText.arguments[0] == 1)
				{
				scheduleNextLayer();
				}
			else
				{
				showNextLayer();
				}
			}
       	}
	else
		{
		if (fadeText.arguments[0] == 1)
			{
			scheduleNextLayer();
			}
		else
			{
			showNextLayer();
			}
		}
	}

function startMove()
	{ 
	lM = eval('"layer' + frameShowing+'"'); 
	sMX = startMove.arguments [0][0];
	sMY = startMove.arguments [0][1];
	eMX = startMove.arguments [0][2];
	eMY = startMove.arguments [0][3];
	MnbM = startMove.arguments [0][5];
	mMT = Math.round((startMove.arguments [0][4] * 1000) / MnbM);
	cMM = 0; cMX = sMX; cMY = sMY; startW = 0; startH = 0;
	eval(layerRef+startDelim+lM+endDelim+styleSwitch+'.left='+cMX);
	eval(layerRef+startDelim+lM+endDelim+styleSwitch+'.top='+cMY);
	atimer=setTimeout("doMove(lM,cMX,cMY,eMX,eMY,cMM,MnbM,mMT)",mMT);
	}

function doMove()
	{
	lM = doMove.arguments [0];
	cMX = doMove.arguments [1];
	cMY = doMove.arguments [2];
	eMX = doMove.arguments [3];
	eMY = doMove.arguments [4];
	cMM = doMove.arguments [5];	
	MnbM = doMove.arguments [6];
	mMT = doMove.arguments [7];

	if (cMM < MnbM)
		{
		MYby = Math.round((eMY - cMY) / (MnbM - cMM -1));
		MXby = Math.round((eMX - cMX) / (MnbM - cMM -1));
		eval(layerRef+startDelim+lM+endDelim+styleSwitch+'.left='+cMX);
		eval(layerRef+startDelim+lM+endDelim+styleSwitch+'.top='+cMY);
		cMM = cMM +1;
		cMY = cMY + MYby;
		cMX = cMX + MXby;
		atimer=setTimeout("doMove(lM,cMX,cMY,eMX,eMY,cMM,MnbM,mMT)",mMT);
		}
	else
		{ 
		scheduleNextLayer();
		}
	}

function startSize()
	{ 
	lS = eval('"layer' + frameShowing+'"'); 
	iTR = null;
	sSW = startSize.arguments[0][0];
	sSH = startSize.arguments [0][1];
	eSW = startSize.arguments [0][2];
	eSH = startSize.arguments [0][3];
	nbSS = startSize.arguments [0][5];
	sST = Math.round((startSize.arguments [0][4] * 1000) / nbSS);
	cSS = 0; cSW = sSW; cSH = sSH;
	if (AnimParm.length == 7)
		{
		iTR = startSize.arguments [0][6];
		}
eval(layerRef+startDelim+lS+endDelim+styleSwitch+'.width='+cSW);
	eval(layerRef+startDelim+lS+endDelim+styleSwitch+'.height='+cSH);
	if (iTR != null)
		{
		if (browser == 'ns4')
			{
			img = eval(layerRef+startDelim+lS+endDelim+'.document.images.lS'+frameShowing+'img'+iTR); 
			var write_string = "<img src="+img.src+" border='0' "+"width='"+ cSW+"' height='"+cSH+"'>";
			eval(layerRef+startDelim+lS+endDelim+'.document.writeln(write_string)');
 			eval(layerRef+startDelim+lS+endDelim+'.document.close()');   
			}
		else
			{ 
			img = eval(layerRef+startDelim+lS+'img'+iTR+endDelim);
			img.width = cSW;
			img.height = cSH;
			}
		}
	stimer=setTimeout("doSize(lS,cSX,cSY,eSX,eSY,cSS,nbSS,sST,iTR)",sST);
	}

function doSize()
	{ 
	lS = doSize.arguments [0]; 
	cSW = doSize.arguments [1];
	cSH = doSize.arguments [2];
	eSW = doSize.arguments [3];
	eSH = doSize.arguments [4];
	cSS = doSize.arguments [5];
	nbSS = doSize.arguments [6];
	sST = doSize.arguments [7];
	iTR = doSize.arguments [8];
	if (cSS < nbSS)
		{
		chWby = Math.round((eSW - cSW) / (nbSS - cSS -1));
		chHby = Math.round((eSH - cSH) / (nbSS - cSS -1));
		eval(layerRef+startDelim+lS+endDelim+styleSwitch+'.width='+cSW);
		eval(layerRef+startDelim+lS+endDelim+styleSwitch+'.height='+cSH);
		if (iTR != null)
			{
			if (browser == 'ns4')
				{
				var write_string = "<img src="+img.src+" border='0' "+"width='"+ cSW+"' height='"+cSH+"'>";
				eval(layerRef+startDelim+lS+endDelim+'.document.writeln(write_string)');
 				eval(layerRef+startDelim+lS+endDelim+'.document.close()');   
    				}
			else
				{ 
				img = eval(layerRef+startDelim+lS+'img'+iTR+endDelim);
				img.width = cSW;
				img.height = cSH;
			}
		}
		cSS = cSS +1;
		cSW = cSW + chWby;
		cSH = cSH + chHby;
		stimer=setTimeout("doSize(lS,cSX,cSY,eSX,eSY,cSS,nbSS,sST,iTR)",sST);
		}
	else
		{
		scheduleNextLayer();
		}
	}

function startMoveAndResize()
	{
	lMR = eval('"layer' + frameShowing+'"'); 
	iTMR = null;
	cMRX = startMoveAndResize.arguments [0][0];
	cMRY = startMoveAndResize.arguments [0][1];
	eMRX = startMoveAndResize.arguments [0][2];
	eMRY = startMoveAndResize.arguments [0][3];
	nbMMR = startMoveAndResize.arguments [0][5];
	mMRT = Math.round((startMoveAndResize.arguments [0][4] * 1000) / nbMMR);
	cMRM = 0; 
	cMRW	= startMoveAndResize.arguments [0][6];
	cMRH = startMoveAndResize.arguments [0][7];
	eMRW = startMoveAndResize.arguments [0][8];
	eMRH = startMoveAndResize.arguments [0][9];
	if (AnimParm.length == 11)
		{
		iTMR = startMoveAndResize.arguments [0][10];
		}
eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.left='+cMRX);
	eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.top='+cMRY);
	eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.width='+cMRW);
	eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.height='+cMRH);
	if (iTMR != null)
		{
		if (browser == 'ns4')
			{
			img = eval(layerRef+startDelim+lMR+endDelim+'.document.images.layer'+frameShowing+'img'+iTMR); 
			var write_string = "<img src="+img.src+" border='0' "+"width='"+ cMRW+"' height='"+cMRH+"'>";
			eval(layerRef+startDelim+lMR+endDelim+'.document.writeln(write_string)');
 			eval(layerRef+startDelim+lMR+endDelim+'.document.close()');   
			}
		else
			{ 
			img = eval(layerRef+startDelim+lMR+'img'+iTMR+endDelim);
			img.width = cMRW;
			img.height = cMRH;
			}
		}
mtimer=setTimeout("doMoveAndResize(lMR,cMRX,cMRY,eMRX,eMRY,cMRM,nbMMR,mMRT,iTMR,cMRW,cMRH,eMRW,eMRH)",mMRT);
	}

function doMoveAndResize()
	{
	lMR = doMoveAndResize.arguments [0];
	cMRX = doMoveAndResize.arguments [1];
	cMRY = doMoveAndResize.arguments [2];
	eMRX = doMoveAndResize.arguments [3];
	eMRY = doMoveAndResize.arguments [4];
	cMRM = doMoveAndResize.arguments [5];
	nbMMR = doMoveAndResize.arguments [6];
	mMRT = doMoveAndResize.arguments [7];
	iTMR = doMoveAndResize.arguments [8];
	cMRW = doMoveAndResize.arguments [9];
	cMRH = doMoveAndResize.arguments [10];
	eMRW = doMoveAndResize.arguments [11];
	eMRH = doMoveAndResize.arguments [12];
if (cMRM < nbMMR)
		{
		moveYby = Math.round((eMRY - cMRY) / (nbMMR - cMRM -1));
		moveXby = Math.round((eMRX - cMRX) / (nbMMR - cMRM -1));
		eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.left='+cMRX);
		eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.top='+cMRY);
		changeWby = Math.round((eMRW - cMRW) / (nbMMR - cMRM -1));
		changeHby = Math.round((eMRH - cMRH) / (nbMMR - cMRM -1));
		eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.width='+cMRW);
		eval(layerRef+startDelim+lMR+endDelim+styleSwitch+'.height='+cMRH);
		if (iTMR != null)
			{
			if (browser == 'ns4')
				{
				var write_string = "<img src="+img.src+" border='0' "+"width='"+ cMRW+"' height='"+cMRH+"'>";
				eval(layerRef+startDelim+lMR+endDelim+'.document.writeln(write_string)');
 				eval(layerRef+startDelim+lMR+endDelim+'.document.close()');   
    				}
			else
				{ 
				img = eval(layerRef+startDelim+lMR+'img'+iTMR+endDelim);
				img.width = cMRW;
				img.height = cMRH;
			}
		}
		cMRM = cMRM +1;
		cMRY = cMRY + moveYby;
		cMRX = cMRX + moveXby;
		cMRW = cMRW + changeWby;
		cMRH = cMRH + changeHby;
		mtimer=setTimeout("doMoveAndResize(lMR,cMRX,cMRY,eMRX,eMRY,cMRM,nbMMR,mMRT,iTMR,cMRW,cMRH,eMRW,eMRH)",mMRT);
		}
	else
		{
		scheduleNextLayer();
		}
	}

function startSwap()
	{ 
	n = 1; 
	nbI = startSwap.arguments [0][0] + 2; 
	sT = startSwap.arguments [0][1] * 1000; 
	Im = new Array();
	for (i = 2; i < nbI; i++)
		{
		Im[i-2] = startSwap.arguments[0][i]; 
		}
	lS = eval('"layer' + frameShowing+'"'); 
	if (browser == 'ns4')
		{
		img = eval(layerRef+startDelim+lS+endDelim+'.document.images.layer'+frameShowing+'img1'); 
		}
	else
		{ 
		img = eval(layerRef+startDelim+lS+'img1'+endDelim);
		}
	img.src = Im[0];
	wtimer=setTimeout("doSwap(n,nbI,sT,Im)",sT);
	}

function doSwap()
	{ 
	lS = eval('"layer' + frameShowing+'"'); 
	n = doSwap.arguments [0];
	nbI = doSwap.arguments [1];
	sT = doSwap.arguments [2];
	for (i = 0; i < nbI - 1; i++)
		{
		Im[i] = doSwap.arguments[3][i];
		}

	if (browser == 'ns4')
		{
		img = eval(layerRef+startDelim+lS+endDelim+'.document.images.layer'+frameShowing+'img1'); 
		}
	else
		{ 
		img = eval(layerRef+startDelim+lS+'img1'+endDelim);
		}
	img.src = Im[n];
	n = n +1;
	if (n < nbI - 2)
		{
		wtimer=setTimeout("doSwap(n,nbI,sT,Im)",sT);
		}
	else
		{
		scheduleNextLayer();
		}
	}




function scheduleNextLayer()
	{ 
	commandString = ImgShown[frameToShow][0];
	if (Resume == 1)
		{
		frameWait = 0;
		}
	if (ActionFlag != 'C')
		{
		if (commandString == '0' | commandString == 0 | commandString == null)
			{ 
			timer=setTimeout("showNextLayer(0)",frameWait);
			} 
		else
			{ 
			timer=setTimeout("eval (commandString)",frameWait);
			}
		}
	}

function loadDups()
	{ 
	for (i = 1; i<ImgShown[frameToShow].length; i++)
		{
		if (browser == 'ns4')
			{
			img = 
eval(layerRef+startDelim+'layer'+frameToShow+endDelim+'.document.images.layer'+frameToShow+'img'+i); 
			}
		else
			{
			img = eval(layerRef+startDelim+'layer'+frameToShow+'img'+i+endDelim);
			}
		setImage('S',frameToShow,i);
		}
	}

function setImage()
	{ 
	if (setImage.arguments[0] == 'L')
		{ 
		if (LoadList [setImage.arguments[1]] [setImage.arguments[2]] == 0)
			{ 
			 img.src = ImgShown[setImage.arguments[1]][setImage.arguments[2]];
			}
		}
	else
		{ 
		if (LoadList [setImage.arguments[1]] [setImage.arguments[2]] == 1)
			{			
			img.src = ImgShown[setImage.arguments[1]][setImage.arguments[2]];
			}
		}
	}

function SetClick(e)
	{
	if (ActionFlag == 'C')
		{ 
		clearTimeout(timer);
		if (commandString == '0' | commandString == 0 | commandString == null)
			{
			showNextLayer(0);
			} 
		else
			{ 
			eval (commandString);
			}
		}
	}	

 function DisallowClick(e)
	{
	if  (browser == 'ns4'  && (e.which == 3 || e.which == 2))
		{
		sendMsg();
		return false;
		}
	else
		{
		 if (browser == 'DOM'  && (event.button == 2 || event.button == 3)) 
			{
			sendMsg();
			return false;
			}
		}
	}	

function imgEvent(evt)
	{ 
	if  (evt.which == 3 || evt.which == 2)
		{
		sendMsg();
		evt.stopPropagation();
		return false;
		}
	}

function sendMsg()
	{
	return
	} 

function showLayer(layer)
	{ 
	eval(layerRef+startDelim+layer+endDelim+styleSwitch+'.visibility="visible"');
	}
        
function hideLayer()
	{ 
	if (hideLayer.arguments.length > 0)
		{
		for (i = 0; i < hideLayer.arguments.length; i++)
			{
			layerToHide = hideLayer.arguments[i]; 
eval(layerRef+startDelim+layerToHide+endDelim+styleSwitch+'.visibility="hidden"');
			}
		}
	}
 
function restartShow()
	{
	hideLayer(eval('"layer' + frameShowing+'"'));
	clearTimeout(timer);
	frameShowing=0;
	init();
 	}

function pauseShow()
	{
	clearTimeout(timer);
	}

function resumeShow()
	{
	clearTimeout(timer);
	if (frameShowing > 0)
		{
		frameShowing = frameShowing - 1;
		frameToShow = frameToShow - 1;
		}
	Resume = 1;
	scheduleNextLayer(0);
	}

function startShowLayers()
	{
	for  ( x = 0; x < startShowLayers.arguments[0].length > 0; x++)
		{ 
		showLayer(startShowLayers.arguments [0][x]);
		}
	if (startShowLayers.arguments [1] != 0)
		{
		startSimultaneousMove(startShowLayers.arguments [1]);
		}
	}	
 
function startSimultaneousMove()
	{ 
	for ( x = 0; x < startSimultaneousMove.arguments[0].length > 0; x++)
		{ 
		SM [x][0] = startSimultaneousMove.arguments [0][x][0];
		SM [x][1] = startSimultaneousMove.arguments [0][x][1];
		SM [x][2] = startSimultaneousMove.arguments [0][x][2];
		SM [x][3] = startSimultaneousMove.arguments [0][x][3];
		SM [x][4] = startSimultaneousMove.arguments [0][x][4];
		SM [x][6] = startSimultaneousMove.arguments [0][x][6];
		SM [x][7] = Math.round((startSimultaneousMove.arguments [0][x][5] * 1000) / SM[x][6]); 
		SM [x][5] = 0; 
		eval(layerRef+startDelim+SM[x][0]+endDelim+styleSwitch+'.left='+SM[x][1]);
		eval(layerRef+startDelim+SM[x][0]+endDelim+styleSwitch+'.top='+SM[x][2]); 
		showLayer(SM[x][0]);
		}
	mtimer = setTimeout("doSimultaneousMove(SM)",SM[x][7]);
	}

function doSimultaneousMove()
	{
	for ( x = 0; x < doSimultaneousMove.arguments[0].length > 0; x++)
		{ 
		SM [x][0] = doSimultaneousMove.arguments [0][x][0];
		SM [x][1] = doSimultaneousMove.arguments [0][x][1];
		SM [x][2] = doSimultaneousMove.arguments [0][x][2];
		SM [x][3] = doSimultaneousMove.arguments [0][x][3];
		SM [x][4] = doSimultaneousMove.arguments [0][x][4];
		SM [x][5] = doSimultaneousMove.arguments [0][x][5];
		SM [x][6] = doSimultaneousMove.arguments [0][x][6];
		SM [x][7] = doSimultaneousMove.arguments [0][x][7]; 
		if (SM [x][5] < SM[x][6])
			{
			moveYby = Math.round((SM[x][4] - SM[x][2]) / (SM[x][6] - SM[x][5] -1));
			moveXby = Math.round((SM[x][3] - SM[x][1]) / (SM[x][6] - SM[x][5] -1));
			eval(layerRef+startDelim+SM[x][0]+endDelim+styleSwitch+'.left='+SM[x][1]);
			eval(layerRef+startDelim+SM[x][0]+endDelim+styleSwitch+'.top='+SM[x][2]);
			SM [x][5] += 1;
			SM [x][2] = SM [x][2] + moveYby;
			SM [x][1] = SM [x][1] + moveXby;
			}
		}
	if (SM [0][5] < SM[0][6])
		{
		mtimer = setTimeout("doSimultaneousMove(SM)",SM[0][7]);
		}
	else
		{
		for ( x = 0; x < doSimultaneousMove.arguments[0].length > 0; x++)
			{ 
			SM[x] = null;
			}
		}
	}	



