<!-- Prepares the image slideshow -->
			
function startSlideshow()
{
	document.getElementById('media-control').style.visibility = "hidden";
	document.getElementById('media-control').innerHTML = '<a href="javascript:mediaTween();">Stor Størrelse</a>';
	document.getElementById('media').style.marginLeft 	= '558px';
	document.getElementById('media').style.marginTop 	= '11px';
	document.getElementById('media').style.height	 	= '143px';
	document.getElementById('media').style.width	 	= '254px';
	
	var mygallery=new fadeSlideShow({
		wrapperid: "media", //ID of blank DIV on page to house Slideshow
		dimensions: [254, 143], //width/height of gallery in pixels. Should reflect dimensions of largest image
		imagearray: [
			["./images/foto/ex1.jpg"],
			["./images/foto/ex30.jpg"],
			["./images/foto/kabler.jpg"],
			["./images/foto/16mm.jpg"],
			["./images/foto/studie2.jpg"],
			["./images/foto/diske.jpg"],
			["./images/foto/moede.jpg"],
			["./images/foto/fcp.jpg"],
			["./images/foto/redigering.jpg"],
			["./images/foto/krydsfelt.jpg"],
			["./images/foto/digibeta.jpg"],
			["./images/foto/maskinrum.jpg"],
			["./images/foto/exer.jpg"],
			["./images/foto/snob.jpg"],
			["./images/foto/snob2.jpg"],
			["./images/foto/historie.jpg"],
			["./images/foto/clapper.jpg"] //No trailing comma after very last image element!
		],
		displaymode: {type:'auto', pause:3500, cycles:0, randomize:true},
		persist: false, //remember last viewed slide and recall within same session?
		fadeduration: 500, //transition duration (milliseconds)
		descreveal: "none"
		
	})
}

<!-- Prepares the video player -->
function playVid(video)
{
	width = '100%';
	height = '100%';
	var so = new SWFObject('./player/player.swf','mpl',width,height,'9');
	so.addParam('allowfullscreen','true');
	so.addParam('allowscriptaccess','always');
	so.addParam('wmode','opaque');
	so.addVariable('file', video);
	so.addVariable('backcolor','ffffff');
	so.addVariable('volume','50');
	so.addVariable('controlbar','over');
	so.addVariable('autostart','true');
	so.write('media');
	
	document.getElementById('media-control').style.visibility = "visible";
	playerReady(so);	
}

<!-- Executes action after play ends -->
function playerReady(obj)
{
	player = gid(obj.id);
	addListeners();
};


function addListeners()
{
	playlist = player.getPlaylist();

	if(playlist.length > 0)
	{
	  player.addModelListener('STATE', 'stateMonitor');
	}
	else
	{
	   setTimeout("addListeners();", 100);
	}
};


function stateMonitor(obj)
{
	if(obj.newstate == 'COMPLETED')
	{
	  startSlideshow();
	}
};


function gid(name)
{
	return document.getElementById(name);
};


<!-- If javascript is turned on, remove the scrollbar in the video div and hide the fullscreen link -->
function prep_js() {
	
	startSlideshow();
}


<!-- Prepares the media tween -->
function mediaTween(vid)
{
	
	var init = new Object;
	var full = new Object;
	
	init.top 	= 11;
	init.left 	= 558;
	init.height	= 143;
	init.width	= 254;
	
	full.top 	= 100;
	full.left 	= 160;
	full.height	= 288;
	full.width	= 512;
	
	object 		= document.getElementById('media').style;
	easing		= Tween.regularEaseInOut;
	duration	= 1;
	suffixe		= 'px';

	//If the object exists, the div is full
	if (object.marginLeft != "") 
	{
		var isFull = (object.marginLeft == init.left+"px") ? false : true;
	}
	else
	{
		var isFull = false;
	}
	
	if (isFull)
	{
		//From full to base
		last = init;
		first = full;
		document.getElementById('media-control').innerHTML = '<a href="javascript:mediaTween();">Stor Størrelse</a>';
		document.getElementById('media').style.outline = "none";
		
	}
	else
	{
		//From base to full
		first = init;
		last = full;
		document.getElementById('media-control').innerHTML = '<a href="javascript:mediaTween();">Tilbage</a>';
		document.getElementById('media').style.outline = "2px solid #000";
	}
					
	
	//To full size - top
	property 	= 'marginTop';
	start		= first.top;
	end			= last.top;
	var out = new Tween(object,property,easing,start,end,duration,suffixe);
	
	out.start();	
	
	//To full size - left
	property 	= 'marginLeft';
	start		= first.left;
	end			= last.left;
	var out = new Tween(object,property,easing,start,end,duration,suffixe);
	
	out.start();
	
	//To full size - height
	property 	= 'height';
	start		= first.height;
	end			= last.height;
	var out = new Tween(object,property,easing,start,end,duration,suffixe);
	
	out.start();
	
	//To full size - width
	property 	= 'width';
	start		= first.width;
	end			= last.width;
	var out = new Tween(object,property,easing,start,end,duration,suffixe);
	
	out.start();
}

window.onload = prep_js; 

