soundManager.url = 'software/soundmanager2.swf';
soundManager.debugMode = false;
soundManager.consoleOnly = false;

var loadedImgSound = 0;
var windowWidth = 0;
var windowHeight = 0;
var diagonal = 0;

var playing=0;
var theScene=1;

var Bop = ((navigator.appName.indexOf("Opera")>-1)?1:0);
if(!Bie)
	{
	var isCanvas = ((document.createElement("canvas").getContext)?true:false);
	}
else
	{
	var isCanvas = false;
	}
var deg2radians = Math.PI * 2 / 360;

var scaleX = 0;
var scaleY = 0;
var scaleDia = 0;

document.title = 'DaytonaTechno :: '+theSongTitle;

soundManager.onload = function()
{
soundManager.createSound({
	id: 'song',
	url: theSong,
	autoLoad: true,
	autoPlay: false,
	volume: 100,
	onload: function() {
		if(loadedImgSound==0)
			{
			document.getElementById("scene1object3part1").innerHTML = "loading images ["+fileSizeImages+"] ... please wait / be patient.";
			}
		loadedImgSound++;
		setTimeout("allLoaded()",1);
		return;
		}
/*
		},
	onfinish: function() {
		setTimeout("startEndtitles()",1);
		return;
		}
*/
	});
}

soundManager.onerror = function() {
alert("warning: there seems to be a problem playing the audiotrack [mp3 using Adobe Flash].");
if(loadedImgSound==0)
			{
			document.getElementById("scene1object3part1").innerHTML = "loading images ["+fileSizeImages+"] ... please wait / be patient.";
			}
loadedImgSound++;
setTimeout("allLoaded()",1);

return true;
}

function imagesLoaded()
{
// onload function alternative
if(loadedImgSound==0)
	{
	document.getElementById("scene1object3part1").innerHTML = "loading soundtrack ["+fileSizeSong+"] ... please wait / be patient.";
	}
loadedImgSound++;
calculateWindowSize();
setTimeout("allLoaded()",1);
return;
}

function allLoaded()
{
if(loadedImgSound==2)
	{
	document.getElementById("scene1object3part1").innerHTML = "<a href='javascript:playScript();' class='a'>&nbsp; loading completed&nbsp;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p r e s s&nbsp;&nbsp;&nbsp;P L A Y&nbsp;&nbsp;&nbsp;o r&nbsp;&nbsp;&nbsp;h i t&nbsp;&nbsp;&nbsp;e n t e r &nbsp;</a>";
	}
return;
}

function pressedKey(e)
{
if((loadedImgSound==2)&&(e.keyCode==13 || e.which==13 || e.keyCode==32 || e.which==32)&&(playing==0))
	{
	setTimeout("playScript()",1);
	playing=1;
	}
return;
}

onresize = function()
{
calculateWindowSize();
return;
}

function calculateWindowSize()
{
var myWidth = 0, myHeight = 0;
if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{myWidth = document.body.clientWidth;myHeight = document.body.clientHeight;}
else if( typeof( window.innerWidth ) == 'number' )
	{myWidth = window.innerWidth;myHeight = window.innerHeight;}
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{myWidth = document.documentElement.clientWidth;myHeight = document.documentElement.clientHeight;}
else{myWidth=1024;myHeight=768;}
windowWidth = myWidth;
windowHeight = myHeight;
diagonal = Math.round(Math.sqrt(Math.pow(windowHeight,2)+Math.pow(windowWidth,2)));
scaleX=windowWidth/1280;
scaleY=windowHeight/800;
scaleDia = (Math.sqrt(Math.pow(windowHeight,2)+Math.pow(windowWidth,2))) / (Math.sqrt(Math.pow(800,2)+Math.pow(1280,2)));

switch(theScene)
{
case 1:
	document.getElementById("theLogo").style.width=Math.round(windowWidth/2)+"px";
	document.getElementById("theH1").style.fontSize=Math.round(windowWidth/36)+"px";
	document.getElementById("logoMySpace").style.width=Math.round(windowWidth/8)+"px";
	document.getElementById("logoYouTube").style.width=Math.round(windowWidth/8)+"px";
	document.getElementById("scene1object3").style.fontSize=Math.round(windowHeight/35)+"px";
	break;
case 2:
	with(document.getElementById("scene2bkg").style)
		{
		width=windowWidth+"px";
		height=windowHeight+"px";
		}
	scene2divX = Math.round((windowWidth/3.187));
	scene2divY = Math.round((windowHeight/2.82));
	scene2divW = Math.round((windowWidth/2.683));
	scene2divH = Math.round((windowHeight/3.1));
	for(var a=2;a<=5;a++)
		{
		with (document.getElementById("scene2shape"+a+"holder").style)
			{
			left = scene2divX + "px";
			top = scene2divY + "px";
			width = scene2divW + "px";
			height = scene2divH + "px";
			}
		with (document.getElementById("scene2shape"+a+"A").style)
			{
			width = scene2divW + "px";
			height = scene2divH + "px";
			}
		with (document.getElementById("scene2shape"+a+"B").style)
			{
			width = scene2divW + "px";
			height = scene2divH + "px";
			}
		}
	break;
case 3:
	with(document.getElementById("scene3shape3"))
	{
	style.height=Math.round(windowHeight/800*256)+"px";
	style.left=Math.round((windowWidth/2)-(width/2))+"px";
	}
	break;
case 4:
	with(document.getElementById("scene4shape1"))
		{
		width=height=Math.round(windowHeight*0.8);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene4W=document.getElementById("scene4bkgA").width;
	break;
case 5:
	with(document.getElementById("scene5shape1"))
		{
		style.height=Math.round(windowHeight/800*323);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene5W=document.getElementById("scene5bkg").width;
	break;
case 6:
	with(document.getElementById("scene6shape1"))
		{
		width=height=Math.round(windowHeight*0.8);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene6W=document.getElementById("scene6bkgA").width;
	break;
case 7:
	with(document.getElementById("scene7shape1"))
		{
		width=height=Math.round(windowHeight*0.95);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene7W=document.getElementById("scene7bkg").width;
	document.getElementById("scene7shape2").style.top=Math.round((windowHeight/2)-(258/2))+"px";
	document.getElementById("scene7shape3").style.top=Math.round((windowHeight/2)-(258/2))+"px";
	break;
case 8:
	with(document.getElementById("scene8shape1"))
		{
		width=Math.round(windowHeight/5*4);
		height=Math.round(width*0.7);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene8W=document.getElementById("scene8bkgA").width;
	break;
case 9:
	with(document.getElementById("scene9shape1"))
		{
		height=Math.round(windowHeight/4);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	with(document.getElementById("scene9shape2"))
		{
		height=Math.round(windowHeight/4);
		style.left=Math.round(((windowWidth/2)-(width/2))/6*5)+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	with(document.getElementById("scene9shape3"))
		{
		height=Math.round(windowHeight/4);
		style.left=Math.round(((windowWidth/2)-(width/2))/6*7)+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	with(document.getElementById("scene9shape4"))
		{
		height=Math.round(windowHeight/4);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round(((windowHeight/2)-(height/2))/6*5)+"px";
		}
	with(document.getElementById("scene9shape5"))
		{
		height=Math.round(windowHeight/4);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round(((windowHeight/2)-(height/2))/6*7)+"px";
		}
	scene9W=document.getElementById("scene9bkg").width;
	document.getElementById("scene9shape6").style.top=Math.round((windowHeight/2)-(258/2))+"px";
	document.getElementById("scene9shape7").style.top=Math.round((windowHeight/2)-(258/2))+"px";
	break;
case 10:
	scene10W=document.getElementById("scene10bkg").width;
	break;
case 11:
	scene10W=document.getElementById("scene10bkg").width;
	break;
case 12:
	scene10W=document.getElementById("scene10bkg").width;
	break;
case 13:
	with(document.getElementById("scene13shape1"))
		{
		style.height=Math.round(windowHeight/800*323);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene13W=document.getElementById("scene13bkg").width;
	break;
case 14:
	with(document.getElementById("scene14shape1"))
		{
		width=height=Math.round(windowHeight*0.8);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	scene14W=document.getElementById("scene14bkgB").width;
	break;
case 15:
	with(document.getElementById("scene15bkg").style)
		{
		width=windowWidth+"px";
		height=windowHeight+"px";
		}
	scene15divX = Math.round((windowWidth/3.187));
	scene15divY = Math.round((windowHeight/2.82));
	scene15divW = Math.round((windowWidth/2.683));
	scene15divH = Math.round((windowHeight/3.1));
	for(var a=1;a<=4;a++)
		{
		with (document.getElementById("scene15shape"+a+"holder").style)
			{
			left = scene15divX + "px";
			top = scene15divY + "px";
			width = scene15divW + "px";
			height = scene15divH + "px";
			}
		with (document.getElementById("scene15shape"+a+"A").style)
			{
			width = scene15divW + "px";
			height = scene15divH + "px";
			}
		with (document.getElementById("scene15shape"+a+"B").style)
			{
			width = scene15divW + "px";
			height = scene15divH + "px";
			}
		}
	break;
case 16:
	with (document.getElementById('endtitles').style)
	{
	fontSize=Math.round(windowWidth/36)+'px';
	}
	break;
}
return;
}

function giveYear()
{
var varOut = 0;
var thisYear = new Date();
if(thisYear.getFullYear()==2008)
	{
	varOut = '2008';
	}
else
	{
	varOut = '2008 - '+thisYear.getFullYear();
	}
return varOut;
}

function playScript()
{
// close intro (= scene 1)
document.getElementById("scene1").style.visibility="hidden";
// open scene 2 (= start video)
document.getElementById("scene2").style.visibility="visible";
setTimeout("playScene2()",1);
return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 2 : hall
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
function playScene2()
{
// ??? master control
theScene=2;
setTimeout("startScene2()",1);
soundManager.play('song');

var rapid=0;
if(rapid==1)
	{
	setTimeout("scene2sub2()",8000);
	setTimeout("playScene3()",9000);
	setTimeout("playScene4()",10000);
	setTimeout("playScene5()",11000);
	setTimeout("playScene6()",12000);
	setTimeout("playScene7()",13000);
	setTimeout("playScene8()",14000);
	setTimeout("playScene9()",15000);
	setTimeout("playScene10()",16000);
	setTimeout("playScene11()",17000);
	setTimeout("playScene12()",18000);
	setTimeout("playScene13()",19000);
	setTimeout("playScene14()",20000);
	setTimeout("playScene15()",21000);
	setTimeout("startEndtitles()",24000);
	}
else
	{
	setTimeout("scene2sub2()",14900);
	setTimeout("playScene3()",30300);
	setTimeout("playScene4()",60000);
	setTimeout("playScene5()",90400);
	setTimeout("playScene6()",120500);
	setTimeout("scene6speed=1;",152000);
	setTimeout("playScene7()",158000);
	setTimeout("scene7switch*=-1;",173000);
	setTimeout("scene7switch*=-1;",203000);
	setTimeout("playScene8()",218000);
	setTimeout("playScene9()",300500);
	setTimeout("scene9dist=1;",330000);
	setTimeout("playScene10()",345100);
	setTimeout("playScene11()",375200);
	setTimeout("playScene12()",390300);
	setTimeout("playScene13()",405400);
	setTimeout("playScene14()",435200);
	setTimeout("playScene15()",480150);
	setTimeout("startEndtitles()",510400);
	}
return;
}

function startScene2()
{
var speed=100;
var timer=0;
var a;
with(document.getElementById("scene2bkg").style)
	{
	width=windowWidth+"px";
	height=windowHeight+"px";
	}
var opatill = ((Bie)?99:50);
for(a=0;a<=opatill;((a<20)?a++:a+=5))
	{
	setTimeout("changeOpacity('scene2bkg',"+a+",3)",((timer++)*speed));
	}
setTimeout("scene2sub1()",(timer*speed));
return;
}

// later used var
var growSize=growSpeed=0;
var scene2sub1timer;

var scene2canvasImg;

function scene2sub1()
{
var speed=10;
var timer=0;
if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene2shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		}

	scene2ctx = document.getElementById('scene2shape1canvas').getContext('2d');
	scene2ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene2canvasImg = new Image();
	if(Bop){scene2canvasImg.src = 'data/shape1.png';}else{scene2canvasImg.src = document.getElementById("scene2shape1").src;}
	}
else
	{
	with(document.getElementById("scene2shape1").style)
		{
		position="absolute";
		width="1px";
		height="1px";
		left=Math.round(windowWidth/2)+"px";
		top=Math.round(windowHeight/2)+"px";
		visibility="visible";
		}
	}
growSize = diagonal / 250;
growSpeed = 1 + (0.05 * scaleX);
scene2sub1timer = setInterval("growRotateMe()",32);
return;
}

var theAngle=1;
function growRotateMe()
{
if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene2shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(-theAngle);
		theAngle += 2;
		drawImage(scene2canvasImg,-growSize,-growSize,growSize*2,growSize*2);
		restore();
		}
	}
else
	{
	// IE
	rad = theAngle++ * 30 * deg2radians * scaleX;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById('scene2shape1'))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";

		style.width=Math.round(growSize*scaleX)+"px";
		style.height=Math.round(growSize*scaleX)+"px";

		}
	}
growSize*= growSpeed;
return;
}

var scene2divW=0;
var scene2divH=0;
var scene2divX=0;
var scene2divY=0;
var scene2sub2timer;
function scene2sub2()
{
scene2divX = Math.round((windowWidth/3.187));
scene2divY = Math.round((windowHeight/2.82));
scene2divW = Math.round((windowWidth/2.683));
scene2divH = Math.round((windowHeight/3.1));

for(var a=2;a<=5;a++)
	{
	with (document.getElementById("scene2shape"+a+"holder").style)
		{
		left = scene2divX + "px";
		top = scene2divY + "px";
		width = scene2divW + "px";
		height = scene2divH + "px";
		visibility = "visible";
		}
	with (document.getElementById("scene2shape"+a+"A").style)
		{
		width = scene2divW + "px";
		height = scene2divH + "px";
		visibility = "visible";
		}
	with (document.getElementById("scene2shape"+a+"B").style)
		{
		width = scene2divW + "px";
		height = scene2divH + "px";
		visibility = "visible";
		}
	}
	
if(isCanvas){document.getElementById("scene2shape1canvas").style.visibility="hidden";}else{document.getElementById("scene2shape1").style.visibility="hidden";}
window.clearInterval(scene2sub1timer);
scene2sub2timer = setInterval("moveScene2sub2()",32);
return;
}

var scene2slideX=0;
var scene2slideX2=0;
function moveScene2sub2()
{
if(Bie)
	{
	var theDiv=document.getElementById("scene2shape2holder").style.pixelWidth;
	}
else
	{
	var theDiv=parseInt(document.getElementById("scene2shape2holder").style.width.substring(0,document.getElementById("scene2shape2holder").style.width.indexOf("px")));
	}
scene2slideX-=Math.round(theDiv/100);
scene2slideX2-=Math.round(theDiv/50);
if(-scene2slideX>=theDiv){scene2slideX=0;}
if(-scene2slideX2>=theDiv){scene2slideX2=0;}

document.getElementById("scene2shape2A").style.left = scene2slideX + "px";
document.getElementById("scene2shape2B").style.left = (scene2slideX + theDiv) + "px";
document.getElementById("scene2shape3A").style.left = -scene2slideX + "px";
document.getElementById("scene2shape3B").style.left = -(scene2slideX + theDiv) + "px";
document.getElementById("scene2shape4A").style.left = -scene2slideX2 + "px";
document.getElementById("scene2shape4B").style.left = -(scene2slideX2 + theDiv) + "px";
document.getElementById("scene2shape5A").style.left = scene2slideX2 + "px";
document.getElementById("scene2shape5B").style.left = (scene2slideX2 + theDiv) + "px";

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 3 : city
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene3timer;
var scene3mover=0;
function playScene3()
{
theScene++;
document.getElementById("scene3").style.visibility='visible';

document.getElementById("scene2").style.visibility='hidden';
changeOpacity('scene2bkg',0,0);
document.getElementById("scene2shape2A").style.visibility='hidden';
document.getElementById("scene2shape2B").style.visibility='hidden';
document.getElementById("scene2shape3A").style.visibility='hidden';
document.getElementById("scene2shape3B").style.visibility='hidden';
document.getElementById("scene2shape4A").style.visibility='hidden';
document.getElementById("scene2shape4B").style.visibility='hidden';
document.getElementById("scene2shape5A").style.visibility='hidden';
document.getElementById("scene2shape5B").style.visibility='hidden';
clearInterval(scene2sub2timer);
scene2slideX=0;
scene2slideX2=0;

with(document.getElementById("scene3shape3"))
	{
	style.position="absolute";
	style.zIndex="90";
	style.height=Math.round(windowHeight/800*256)+"px";
	style.left=Math.round((windowWidth/2)-(width/2))+"px";
	scene3mover=-Math.round(height+(10*scaleX));
	style.top=scene3mover+"px";
	style.visibility="visible";
	}

theAngle=1;
scene3timer = setInterval("startScene3()",32);
return;
}

var scene3slideX=0;
function startScene3()
{
scene3slideX-=10*scaleX;
document.getElementById("scene3shape1").style.backgroundPosition=-Math.round(scene3slideX)+"px top";
document.getElementById("scene3shape2").style.backgroundPosition=Math.round(scene3slideX)+"px top";
document.getElementById("scene3shape3").style.top=Math.round(scene3mover)+"px";
scene3mover+=1*scaleX;
return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 4 : moving city+mountains
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene4timer;
var scene4W=0;
var scene4canvasImg;

function playScene4()
{
theScene++;
document.getElementById("scene4").style.visibility='visible';

document.getElementById("scene3").style.visibility='hidden';
document.getElementById("scene3shape3").style.visibility='hidden';
clearInterval(scene3timer);
scene3slideX=0;

if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene4shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene4ctx = document.getElementById('scene4shape1canvas').getContext('2d');
	scene4ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene4canvasImg = new Image();
	if(Bop){scene4canvasImg.src = 'data/shape6.png';}else{scene4canvasImg.src = document.getElementById("scene4shape1").src;}
	}
else
	{
	with(document.getElementById("scene4shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		width=height=Math.round(windowHeight*0.8);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
scene4W=document.getElementById("scene4bkgA").width;

scene4timer = setInterval("startScene4()",32);
return;
}

var scene4slideX=1;
var scene4switch=1;
function startScene4()
{
var theStep=10*scaleX;
scene4slideX+=theStep*scene4switch;
if(scene4slideX >= scene4W - windowWidth)
	{
	scene4slideX = scene4W - windowWidth;
	scene4switch*=-1;
	}
if(scene4slideX<1)
	{
	scene4slideX=1;
	scene4switch*=-1;
	}
document.getElementById("scene4bkgA").style.left=-Math.round(scene4slideX)+"px";
document.getElementById("scene4bkgB").style.left=-Math.round(scene4slideX)+"px";

if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene4shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(theAngle);
		theAngle += 16 * deg2radians * scaleY;
		aWidth = Math.round(windowHeight*0.8);
		aPos = -Math.round(aWidth/2);
		drawImage(scene4canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	}
else
	{
	// IE
	rad = theAngle++ * 8 * deg2radians * scaleY;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene4shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 5 : paris
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene5timer;
var scene5W=0;
var scene5canvasImg;

function playScene5()
{
theScene++;
document.getElementById("scene5").style.visibility='visible';

document.getElementById("scene4").style.visibility='hidden';
document.getElementById("scene4bkgA").style.left="0px";
document.getElementById("scene4bkgB").style.left="0px";
if(isCanvas){document.getElementById("scene4shape1canvas").style.visibility="hidden";}else{document.getElementById("scene4shape1").style.visibility="hidden";}
clearInterval(scene4timer);
scene4slideX=1;
scene4switch=1;

if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene5shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene5ctx = document.getElementById('scene5shape1canvas').getContext('2d');
	scene5ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene5canvasImg = new Image();
	if(Bop){scene5canvasImg.src = 'data/shape7.png';}else{scene5canvasImg.src = document.getElementById("scene5shape1").src;}
	}
else
	{
	with(document.getElementById("scene5shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		style.height=Math.round(windowHeight/800*323);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
scene5W=document.getElementById("scene5bkg").width;

scene5timer = setInterval("startScene5()",32);
return;
}

var scene5slideX=1;
var scene5switch=1;
function startScene5()
{
scene5slideX+=10*scene5switch*scaleX;
if(scene5slideX >= scene5W - windowWidth)
	{
	scene5slideX = scene5W - windowWidth;
	scene5switch*=-1;
	}
if(scene5slideX<1)
	{
	scene5slideX=1;
	scene5switch*=-1;
	}

document.getElementById("scene5bkg").style.left=-Math.round(scene5slideX)+"px";

if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene5shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(theAngle);
		theAngle += 16 * deg2radians;
		aWidth = Math.round(windowHeight/800*323);
		aPos = -Math.round(aWidth/2);
		drawImage(scene5canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	}
else
	{
	// IE
	rad = theAngle++ * 8 * deg2radians;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene5shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 6 : L.A.
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene6timer;
var scene6W=0;
var scene6speed;
var scene6canvasImg;

function playScene6()
{
theScene++;
document.getElementById("scene6").style.visibility='visible';

document.getElementById("scene5").style.visibility='hidden';
clearInterval(scene5timer);
if(isCanvas){document.getElementById("scene5shape1canvas").style.visibility="hidden";}else{document.getElementById("scene5shape1").style.visibility="hidden";}
document.getElementById("scene5bkg").style.left="0px";
scene5slideX=1;
scene5switch=1;

if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene6shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene6ctx = document.getElementById('scene6shape1canvas').getContext('2d');
	scene6ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene6canvasImg = new Image();
	if(Bop){scene6canvasImg.src = 'data/shape8.png';}else{scene6canvasImg.src = document.getElementById("scene6shape1").src;}
	}
else
	{
	with(document.getElementById("scene6shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		width=height=Math.round(windowHeight*0.8);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
scene6speed=0;
scene6W=document.getElementById("scene6bkgA").width;

scene6timer = setInterval("startScene6()",32);
return;
}

var scene6slideX=1;
var scene6switch=1;
function startScene6()
{
scene6slideX+=15*scene6switch*scaleX;
if(scene6slideX >= scene6W - windowWidth)
	{
	scene6slideX = scene6W - windowWidth;
	scene6switch*=-1;
	}
if(scene6slideX<1)
	{
	scene6slideX=1;
	scene6switch*=-1;
	}

document.getElementById("scene6bkgA").style.left=-Math.round(scene6slideX)+"px";
document.getElementById("scene6bkgB").style.left=-Math.round(scene6slideX)+"px";

if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene6shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(theAngle);
		if(scene6speed!=0)
			{
			scene6speed += 1;
			}
		theAngle += scene6speed + 16 * deg2radians * scaleY;
		aWidth = Math.round(windowHeight*0.8)-scene6speed;
		aPos = -Math.round(aWidth/2);
		drawImage(scene6canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	}
else
	{
	// IE
	rad = (theAngle++ + scene6speed) * 8 * deg2radians * scaleY;
	if(scene6speed!=0)
		{
		scene6speed += 1;
		}
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene6shape1"))
		{
		if(scene6speed!=0)
			{
			height-=Math.round(height/100);
			width-=Math.round(width/100);
			}
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 7 : rotating Paris
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene7timer;
var scene7W=0;
var scene7switch=1;
var scene7canvasImg;

function playScene7()
{
theScene++;
document.getElementById("scene7").style.visibility='visible';

document.getElementById("scene6").style.visibility='hidden';
clearInterval(scene6timer);
if(isCanvas){document.getElementById("scene6shape1canvas").style.visibility="hidden";}else{document.getElementById("scene6shape1").style.visibility="hidden";}
document.getElementById("scene6bkgA").style.left="0px";
document.getElementById("scene6bkgB").style.left="0px";
scene6slideX=1;
scene6switch=1;

scene7switch=1;
if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene7shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene7ctx = document.getElementById('scene7shape1canvas').getContext('2d');
	scene7ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene7canvasImg = new Image();
	if(Bop){scene7canvasImg.src = 'data/shape9.png';}else{scene7canvasImg.src = document.getElementById("scene7shape1").src;}
	}
else
	{
	with(document.getElementById("scene7shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		width=height=Math.round(windowHeight*0.95);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
document.getElementById("scene7shape2").style.top=Math.round((windowHeight/2)-(258/2))+"px";
document.getElementById("scene7shape3").style.top=Math.round((windowHeight/2)-(258/2))+"px";
scene7W=document.getElementById("scene7bkg").width;

scene7timer = setInterval("startScene7()",32);
return;
}

var scene7slideX=1;
function startScene7()
{
if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene7shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(theAngle);
		theAngle += scene7switch * 16 * deg2radians * scaleY;
		aWidth = Math.round(windowHeight*0.95);
		aPos = -Math.round(aWidth/2);
		drawImage(scene7canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	}
else
	{
	// IE
	rad = theAngle * 2 * deg2radians * scaleY;
	theAngle+=((scene7switch==1)?1:-1);
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene7shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

scene7slideX-=10*scene7switch*scaleX;
document.getElementById("scene7shape2").style.backgroundPosition=-Math.round(scene7slideX)+"px top";
document.getElementById("scene7shape3").style.backgroundPosition=Math.round(scene7slideX)+"px top";
	
return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 8 : N.Y.
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene8timer;
var scene8W=0;
var scene8canvasImg;

function playScene8()
{
theScene++;
document.getElementById("scene8").style.visibility='visible';

document.getElementById("scene7").style.visibility='hidden';
clearInterval(scene7timer);
if(isCanvas){document.getElementById("scene7shape1canvas").style.visibility="hidden";}else{document.getElementById("scene7shape1").style.visibility="hidden";}
scene7slideX=1;

if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene8shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene8ctx = document.getElementById('scene8shape1canvas').getContext('2d');
	scene8ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene8canvasImg = new Image();
	if(Bop){scene8canvasImg.src = 'data/shape10.png';}else{scene8canvasImg.src = document.getElementById("scene8shape1").src;}
	}
else
	{
	with(document.getElementById("scene8shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		width=Math.round(windowHeight/5*4);
		height=Math.round(width*0.7);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
scene8W=document.getElementById("scene8bkgA").width;

scene8timer = setInterval("startScene8()",32);
return;
}

var scene8slideX=1;
var scene8switch=1;
function startScene8()
{
scene8slideX+=15*scene8switch*scaleX;
if(scene8slideX >= scene8W - windowWidth)
	{
	scene8slideX = scene8W - windowWidth;
	scene8switch*=-1;
	}
if(scene8slideX<1)
	{
	scene8slideX=1;
	scene8switch*=-1;
	}

document.getElementById("scene8bkgA").style.left=-Math.round(scene8slideX)+"px";
document.getElementById("scene8bkgB").style.left=-Math.round(scene8slideX)+"px";

if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene8shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(theAngle);
		theAngle += 16 * deg2radians * scaleY;
		
		aWidth = Math.round(windowHeight/5*4);
		aPosX = -Math.round(aWidth/2);
		aHeight = Math.round(aWidth*0.7);
		aPosY = -Math.round(aHeight/2);
		drawImage(scene8canvasImg,aPosX,aPosY,aWidth,aHeight);
		restore();
		}
	}
else
	{
	// IE
	rad = theAngle++ * 8 * deg2radians * scaleY;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene8shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 9 : rotating balls
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene9timer;
var scene9W=0;
var scene9dist;
var scene9canvasImg;

function playScene9()
{
theScene++;
document.getElementById("scene9").style.visibility='visible';

document.getElementById("scene8").style.visibility='hidden';
if(isCanvas){document.getElementById("scene8shape1canvas").style.visibility="hidden";}else{document.getElementById("scene8shape1").style.visibility="hidden";}
clearInterval(scene8timer);
document.getElementById("scene8bkgA").style.left="0px";
document.getElementById("scene8bkgB").style.left="0px";
scene8slideX=1;
scene8switch=1;

if(isCanvas)
	{
	// non IE
	scene9canvasImg = new Image();
	if(Bop){scene9canvasImg.src = 'data/shape11.png';}else{scene9canvasImg.src = document.getElementById("scene9shape1").src;}
	with(document.getElementById('scene9shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene9ctx1 = document.getElementById('scene9shape1canvas').getContext('2d');
	scene9ctx1.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));

	with(document.getElementById('scene9shape2canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="19";
		}
	scene9ctx2 = document.getElementById('scene9shape2canvas').getContext('2d');
	scene9ctx2.translate(Math.round(windowWidth/2 - windowWidth/6),Math.round(windowHeight/2));

	with(document.getElementById('scene9shape3canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="19";
		}
	scene9ctx3 = document.getElementById('scene9shape3canvas').getContext('2d');
	scene9ctx3.translate(Math.round(windowWidth/2 + windowWidth/6),Math.round(windowHeight/2));

	with(document.getElementById('scene9shape4canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="18";
		}
	scene9ctx4 = document.getElementById('scene9shape4canvas').getContext('2d');
	scene9ctx4.translate(Math.round(windowWidth/2),Math.round(windowHeight/2 - windowHeight/6));

	with(document.getElementById('scene9shape5canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="18";
		}
	scene9ctx5 = document.getElementById('scene9shape5canvas').getContext('2d');
	scene9ctx5.translate(Math.round(windowWidth/2),Math.round(windowHeight/2 + windowHeight/6));
	}
else
	{
	with(document.getElementById("scene9shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		height=Math.round(windowHeight/4);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	with(document.getElementById("scene9shape2"))
		{
		style.zIndex="19";
		style.visibility="visible";
		style.position="absolute";
		height=Math.round(windowHeight/4);
		style.left=Math.round(((windowWidth/2)-(width/2))/6*5)+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	with(document.getElementById("scene9shape3"))
		{
		style.zIndex="19";
		style.visibility="visible";
		style.position="absolute";
		height=Math.round(windowHeight/4);
		style.left=Math.round(((windowWidth/2)-(width/2))/6*7)+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	with(document.getElementById("scene9shape4"))
		{
		style.zIndex="18";
		style.visibility="visible";
		style.position="absolute";
		height=Math.round(windowHeight/4);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round(((windowHeight/2)-(height/2))/6*5)+"px";
		}
	with(document.getElementById("scene9shape5"))
		{
		style.zIndex="18";
		style.visibility="visible";
		style.position="absolute";
		height=Math.round(windowHeight/4);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round(((windowHeight/2)-(height/2))/6*7)+"px";
		}
	}
theAngle=1;
document.getElementById("scene9shape6").style.top=Math.round((windowHeight/2)-(258/2))+"px";
document.getElementById("scene9shape7").style.top=Math.round((windowHeight/2)-(258/2))+"px";
scene9W=document.getElementById("scene9bkg").width;
scene9dist=0;
scene9timer = setInterval("startScene9()",3);
return;
}

var scene9slideX=1;
function startScene9()
{
if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene9shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(theAngle);
		aWidth = Math.round(windowHeight/4);
		aPos = -Math.round(aWidth/2);
		drawImage(scene9canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	with(document.getElementById('scene9shape2canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		scene9ctx2 = document.getElementById('scene9shape2canvas').getContext('2d');
		scene9ctx2.translate(-scene9dist,0);
		rotate(theAngle);
		aWidth = Math.round(windowHeight/4);
		aPos = -Math.round(aWidth/2);
		drawImage(scene9canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	with(document.getElementById('scene9shape3canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		scene9ctx3 = document.getElementById('scene9shape3canvas').getContext('2d');
		scene9ctx3.translate(scene9dist,0);
		rotate(theAngle);
		aWidth = Math.round(windowHeight/4);
		aPos = -Math.round(aWidth/2);
		drawImage(scene9canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	with(document.getElementById('scene9shape4canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		scene9ctx4 = document.getElementById('scene9shape4canvas').getContext('2d');
		scene9ctx4.translate(0,-scene9dist);
		rotate(theAngle);
		aWidth = Math.round(windowHeight/4);
		aPos = -Math.round(aWidth/2);
		drawImage(scene9canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	with(document.getElementById('scene9shape5canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		scene9ctx5 = document.getElementById('scene9shape5canvas').getContext('2d');
		scene9ctx5.translate(0,scene9dist);
		rotate(theAngle);
		aWidth = Math.round(windowHeight/4);
		aPos = -Math.round(aWidth/2);
		drawImage(scene9canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	theAngle += 16 * deg2radians * scaleY;
	}
else
	{
	// IE
	rad = theAngle++ * 20 * deg2radians;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	var X9;
	var Y9;
	
	with(document.getElementById("scene9shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;
		X9 = Math.round((windowWidth/2) - ((offsetWidth/2)));
		Y9 = Math.round((windowHeight/2) - ((offsetHeight/2)));
		style.left = X9  + "px";
		style.top = Y9 + "px";
		}
	with(document.getElementById("scene9shape2"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;
		style.left = Math.round(X9/6*5 - (scene9dist * scaleX)) + "px";
		style.top = Y9 + "px";
		}
	with(document.getElementById("scene9shape3"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;
		style.left = Math.round(X9/6*7 + (scene9dist * scaleX)) + "px";
		style.top = Y9 + "px";
		}
	with(document.getElementById("scene9shape4"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;
		style.left = X9  + "px";
		style.top = Math.round(Y9/6*5 - (scene9dist * scaleX)) + "px";
		}
	with(document.getElementById("scene9shape5"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;
		style.left = X9  + "px";
		style.top = Math.round(Y9/6*7 + (scene9dist * scaleX)) + "px";
		}
	}
scene9dist+=((scene9dist==0)?0:1);
scene9slideX-=10*scaleX;
document.getElementById("scene9shape6").style.backgroundPosition=-Math.round(scene9slideX)+"px top";
document.getElementById("scene9shape7").style.backgroundPosition=Math.round(scene9slideX)+"px top";
	
return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 10 : Dali in Vegas
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene10timer;
var scene10W=0;
function playScene10()
{
theScene++;
document.getElementById("scene10").style.visibility='visible';
document.getElementById("scene10shape1").style.visibility='visible';

document.getElementById("scene9").style.visibility="hidden";
if(isCanvas){document.getElementById("scene9shape1canvas").style.visibility="hidden";}else{document.getElementById("scene9shape1").style.visibility="hidden";}
if(isCanvas){document.getElementById("scene9shape2canvas").style.visibility="hidden";}else{document.getElementById("scene9shape2").style.visibility="hidden";}
if(isCanvas){document.getElementById("scene9shape3canvas").style.visibility="hidden";}else{document.getElementById("scene9shape3").style.visibility="hidden";}
if(isCanvas){document.getElementById("scene9shape4canvas").style.visibility="hidden";}else{document.getElementById("scene9shape4").style.visibility="hidden";}
if(isCanvas){document.getElementById("scene9shape5canvas").style.visibility="hidden";}else{document.getElementById("scene9shape5").style.visibility="hidden";}
clearInterval(scene9timer);
document.getElementById("scene9bkg").style.right="0px";
scene9slideX=1;
scene9switch=1;

scene10W=document.getElementById("scene10bkg").width;

scene10timer = setInterval("startScene10()",32);
return;
}

var scene10slideX=1;
var scene10switch=1;
function startScene10()
{
scene10slideX+=10*scene10switch*scaleX;
if(scene10slideX >= scene10W - windowWidth)
	{
	scene10slideX = scene10W - windowWidth;
	scene10switch*=-1;
	}
if(scene10slideX<1)
	{
	scene10slideX=1;
	scene10switch*=-1;
	}

document.getElementById("scene10bkg").style.right=-Math.round(scene10slideX)+"px";

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 11 : Dali trippin
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene11timer;
var scene11W=0;
function playScene11()
{
theScene++;
document.getElementById("scene11").style.visibility='visible';
document.getElementById("scene11shape1").style.visibility='visible';

document.getElementById("scene10").style.visibility="hidden";
document.getElementById("scene10shape1").style.visibility="hidden";
clearInterval(scene10timer);
document.getElementById("scene10bkg").style.right="0px";
scene10slideX=1;
scene10switch=1;
scene11W=document.getElementById("scene11bkg").width;

scene11timer = setInterval("startScene11()",32);
return;
}

var scene11slideX=1;
var scene11switch=1;
function startScene11()
{
scene11slideX+=10*scene11switch*scaleX;
if(scene11slideX >= scene11W - windowWidth)
	{
	scene11slideX = scene11W - windowWidth;
	scene11switch*=-1;
	}
if(scene11slideX<1)
	{
	scene11slideX=1;
	scene11switch*=-1;
	}

document.getElementById("scene11bkg").style.right=-Math.round(scene11slideX)+"px";

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 12 : Dali trippin 2
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene12timer;
var scene12W=0;
function playScene12()
{
theScene++;
document.getElementById("scene12").style.visibility='visible';
document.getElementById("scene12shape1").style.visibility='visible';

document.getElementById("scene11").style.visibility="hidden";
document.getElementById("scene11shape1").style.visibility="hidden";
clearInterval(scene11timer);
document.getElementById("scene11bkg").style.right="0px";
scene11slideX=1;
scene11switch=1;
scene12W=document.getElementById("scene12bkg").width;

scene12timer = setInterval("startScene12()",32);
return;
}

var scene12slideX=1;
var scene12switch=1;
function startScene12()
{
scene12slideX+=10*scene12switch*scaleX;
if(scene12slideX >= scene12W - windowWidth)
	{
	scene12slideX = scene12W - windowWidth;
	scene12switch*=-1;
	}
if(scene12slideX<1)
	{
	scene12slideX=1;
	scene12switch*=-1;
	}

document.getElementById("scene12bkg").style.right=-Math.round(scene12slideX)+"px";

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 13 : Paris again, but backward
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene13timer;
var scene13W=0;
var scene13canvasImg;

function playScene13()
{
theScene++;
document.getElementById("scene13").style.visibility='visible';

document.getElementById("scene12").style.visibility="hidden";
document.getElementById("scene12shape1").style.visibility="hidden";
clearInterval(scene12timer);
document.getElementById("scene12bkg").style.right="0px";
scene12slideX=1;
scene12switch=1;

if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene13shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene13ctx = document.getElementById('scene13shape1canvas').getContext('2d');
	scene13ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene13canvasImg = new Image();
	if(Bop){scene13canvasImg.src = 'data/shape7.png';}else{scene13canvasImg.src = document.getElementById("scene13shape1").src;}
	}
else
	{
	with(document.getElementById("scene13shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		style.height=Math.round(windowHeight/800*323);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
scene13W=document.getElementById("scene13bkg").width;

scene13timer = setInterval("startScene13()",32);
return;
}

var scene13slideX=1;
var scene13switch=1;
function startScene13()
{
scene13slideX+=10*scene13switch*scaleX;
if(scene13slideX >= scene13W - windowWidth)
	{
	scene13slideX = scene13W - windowWidth;
	scene13switch*=-1;
	}
if(scene13slideX<1)
	{
	scene13slideX=1;
	scene13switch*=-1;
	}

document.getElementById("scene13bkg").style.right=-Math.round(scene13slideX)+"px";

if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene13shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(-theAngle);
		theAngle += 16 * deg2radians;
		aWidth = Math.round(windowHeight/800*323);
		aPos = -Math.round(aWidth/2);
		drawImage(scene13canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	}
else
	{
	// IE
	rad = -theAngle++ * 8 * deg2radians;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene13shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 14 : moving city+mountains again, but backward
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene14timer;
var scene14W=0;
var scene14canvasImg;

function playScene14()
{
theScene++;
document.getElementById("scene14").style.visibility='visible';

document.getElementById("scene13").style.visibility='hidden';
clearInterval(scene13timer);
if(isCanvas){document.getElementById("scene13shape1canvas").style.visibility="hidden";}else{document.getElementById("scene13shape1").style.visibility="hidden";}
document.getElementById("scene13bkg").style.right="0px";
scene13slideX=1;
scene13switch=1;

if(isCanvas)
	{
	// non IE
	with(document.getElementById('scene14shape1canvas'))
		{
		width=windowWidth;
		height=windowHeight;
		style.visibility="visible";
		style.zIndex="20";
		}
	scene14ctx = document.getElementById('scene14shape1canvas').getContext('2d');
	scene14ctx.translate(Math.round(windowWidth/2),Math.round(windowHeight/2));
	scene14canvasImg = new Image();
	if(Bop){scene14canvasImg.src = 'data/shape6.png';}else{scene14canvasImg.src = document.getElementById("scene14shape1").src;}
	}
else
	{
	with(document.getElementById("scene14shape1"))
		{
		style.zIndex="20";
		style.visibility="visible";
		style.position="absolute";
		width=height=Math.round(windowHeight*0.8);
		style.left=Math.round((windowWidth/2)-(width/2))+"px";
		style.top=Math.round((windowHeight/2)-(height/2))+"px";
		}
	}
theAngle=1;
scene14W=document.getElementById("scene14bkgB").width;
document.getElementById("scene14bkgA").style.width=scene14W+"px";

scene14timer = setInterval("startScene14()",32);
return;
}

var scene14slideX=1;
var scene14switch=1;
function startScene14()
{
var theStep=20;
scene14slideX+=theStep*scene14switch*scaleX;
if(scene14slideX >= scene14W - windowWidth)
	{
	scene14slideX = scene14W - windowWidth;
	scene14switch*=-1;
	}
if(scene14slideX<1)
	{
	scene14slideX=1;
	scene14switch*=-1;
	}

document.getElementById("scene14bkgA").style.right=-Math.round(scene14slideX)+"px";
document.getElementById("scene14bkgB").style.right=-Math.round(scene14slideX)+"px";

if(isCanvas)
	{
	// non IE
	// ??? objectName + canvas
	with(document.getElementById('scene14shape1canvas').getContext('2d'))
		{
		clearRect(-windowWidth/2,-windowHeight/2,windowWidth,windowHeight);
		save();
		rotate(-theAngle);
		theAngle += 16 * deg2radians * scaleY;
		aWidth = Math.round(windowHeight*0.8);
		aPos = -Math.round(aWidth/2);
		drawImage(scene14canvasImg,aPos,aPos,aWidth,aWidth);
		restore();
		}
	}
else
	{
	// IE
	rad = -theAngle++ * 8 * deg2radians * scaleY;
	costheta = Math.cos(rad);
	sintheta = Math.sin(rad);

	with(document.getElementById("scene14shape1"))
		{
		filters.item(0).M11 = costheta;
		filters.item(0).M12 = -sintheta;
		filters.item(0).M21 = sintheta;
		filters.item(0).M22 = costheta;

		style.left = Math.round((windowWidth/2) - ((offsetWidth/2))) + "px";
		style.top = Math.round((windowHeight/2) - ((offsetHeight/2))) + "px";
		}
	}

return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//scene 15 : hall again
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
var scene15divW=0;
var scene15divH=0;
var scene15divX=0;
var scene15divY=0;
var scene15timer;
function playScene15()
{
theScene++;
document.getElementById("scene15").style.visibility="visible";
changeOpacity('scene15',95,3);

document.getElementById("scene14").style.visibility='hidden';
document.getElementById("scene14bkgA").style.right="0px";
document.getElementById("scene14bkgB").style.right="0px";
if(isCanvas){document.getElementById("scene14shape1canvas").style.visibility="hidden";}else{document.getElementById("scene14shape1").style.visibility="hidden";}
clearInterval(scene14timer);
scene14slideX=1;
scene14switch=1;

scene15divX = Math.round((windowWidth/3.187));
scene15divY = Math.round((windowHeight/2.82));
scene15divW = Math.round((windowWidth/2.683));
scene15divH = Math.round((windowHeight/3.1));

for(var a=1;a<=4;a++)
	{
	with (document.getElementById("scene15shape"+a+"holder").style)
		{
		left = scene15divX + "px";
		top = scene15divY + "px";
		width = scene15divW + "px";
		height = scene15divH + "px";
		visibility = "visible";
		}
	with (document.getElementById("scene15shape"+a+"A").style)
		{
		width = scene15divW + "px";
		height = scene15divH + "px";
		visibility = "visible";
		}
	with (document.getElementById("scene15shape"+a+"B").style)
		{
		width = scene15divW + "px";
		height = scene15divH + "px";
		visibility = "visible";
		}
	}
	
scene15timer = setInterval("startScene15()",32);
return;
}

var scene15slideX=0;
var scene15slideX2=0;
function startScene15()
{
if(Bie)
	{
	var theDiv=document.getElementById("scene15shape1holder").style.pixelWidth;
	}
else
	{
	var theDiv=parseInt(document.getElementById("scene15shape1holder").style.width.substring(0,document.getElementById("scene15shape1holder").style.width.indexOf("px")));
	}
scene15slideX-=Math.round(theDiv/100);
scene15slideX2-=Math.round(theDiv/50);
if(-scene15slideX>=theDiv){scene15slideX=0;}
if(-scene15slideX2>=theDiv){scene15slideX2=0;}
document.getElementById("scene15shape1A").style.left = scene15slideX + "px";
document.getElementById("scene15shape1B").style.left = (scene15slideX + theDiv) + "px";
document.getElementById("scene15shape2A").style.left = -scene15slideX + "px";
document.getElementById("scene15shape2B").style.left = -(scene15slideX + theDiv) + "px";
document.getElementById("scene15shape3A").style.left = -scene15slideX2 + "px";
document.getElementById("scene15shape3B").style.left = -(scene15slideX2 + theDiv) + "px";
document.getElementById("scene15shape4A").style.left = scene15slideX2 + "px";
document.getElementById("scene15shape4B").style.left = (scene15slideX2 + theDiv) + "px";
return;
}


// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// end titles
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
function startEndtitles()
{
// ??? hardcoded
theScene++;
document.getElementById("scene15shape1A").style.visibility='hidden';
document.getElementById("scene15shape1B").style.visibility='hidden';
document.getElementById("scene15shape2A").style.visibility='hidden';
document.getElementById("scene15shape2B").style.visibility='hidden';
document.getElementById("scene15shape3A").style.visibility='hidden';
document.getElementById("scene15shape3B").style.visibility='hidden';
document.getElementById("scene15shape4A").style.visibility='hidden';
document.getElementById("scene15shape4B").style.visibility='hidden';
clearInterval(scene15timer);
scene15slideX=0;
scene15slideX2=0;

var speed = 8;
var timer = 50;
for(var a=100;a>=0;a--)
	{
	setTimeout("changeOpacity('scene15','"+a+"',3)",((timer++)*speed));
	}
setTimeout("showEndtitles()",(timer * speed));
return;
}

function showEndtitles()
{
// ??? hardcoded
document.getElementById("scene15").style.visibility='hidden';
if(Bie)
	{
	document.getElementById("scene15").filters.alpha.enabled=false;
	}

with (document.getElementById('endtitles').style)
	{
	textAlign='center';
	document.getElementById('endtitles').style.position='absolute';
	document.getElementById('endtitles').style.left='0%';
	document.getElementById('endtitles').style.top= (windowHeight + 1) + 'px';
	width='100%';
	visibility='visible';
	fontSize=Math.round(windowWidth/36)+'px';
	}
var speed = 7;
var timer = 0;
var endtitlesH = document.getElementById("endtitles").offsetHeight;
for(var a=windowHeight+1;a>-(endtitlesH + 80);a-=1*scaleY)
	{
	setTimeout("scrollEndtitles('"+Math.round(a)+"')",((timer++) * speed));
	}
setTimeout("closeEndtitles()",(timer*speed));
return;
}

function scrollEndtitles(numberIn)
{
document.getElementById("endtitles").style.top =  numberIn + "px";
return;
}

function closeEndtitles()
{
document.getElementById("endtitles").style.visibility="hidden";
playing=0;
theScene=1;
document.getElementById("scene1object3part1").innerHTML = "<a href='javascript:playScript();' class='a'>&nbsp; &gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p r e s s&nbsp;&nbsp;&nbsp;P L A Y&nbsp;&nbsp;&nbsp;o r&nbsp;&nbsp;&nbsp;h i t&nbsp;&nbsp;&nbsp;e n t e r &nbsp;&nbsp;&nbsp;t o&nbsp;&nbsp;&nbsp;r e s t a r t &nbsp;</a>";
calculateWindowSize()
document.getElementById("scene1").style.visibility="visible";
return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// general functions
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

function changeOpacity(theObject,theFrame,theStyle)
{
// theStyle (only IE)
//	0	Default. Uniform opacity gradient.
//	1	Linear opacity gradient.
//	2	Radial opacity gradient.
//	3	Rectangular opacity gradient.
var object = document.getElementById(theObject).style;
var SFrame = theFrame / 100;
object.opacity = SFrame;
object.MozOpacity = SFrame;
object.KhtmlOpacity = SFrame;
object.filter = "alpha(opacity=" + theFrame + ", style="+theStyle+")";
return;
}

// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// temporary functions
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
function alertMe(ofp)
{
var attributeName;var attributeValue;var str="";
for (attributeName in ofp){attributeValue= ofp[attributeName];if (str)str+= ", ";str+= attributeName + " = " + attributeValue;}
var newTextarea = document.createElement("<textarea id='holdtext' style='display:none;'></TEXTAREA>");document.body.appendChild(newTextarea);
if (str){document.getElementById("holdtext").innerHTML = str;Copied = document.getElementById("holdtext").createTextRange();Copied.execCommand("Copy");alert("copied attributes to clipboard");}else{alert("no attributes to copy");}
return;
}