	
	var browseMovies = 0;

	function sendEvent(swf,typ,prm) { 
		thisMovie(swf).sendEvent(typ,prm); 
	};
	function getUpdate(typ,pr1,pr2,swf) {
		if(typ == "state" && swf == "jstest") {
			gid('stateshow').innerHTML = pr1;
		}
	};
	function loadFile(swf,obj) {
		thisMovie(swf).loadFile(obj); 
	};
	function getLength(swf) { 
		var len = thisMovie(swf).getLength(); 
		alert('the length of the playlist is: '+len);
	};
	function addItem(swf,obj,idx) {
		thisMovie(swf).addItem(obj,idx);
	};
	function removeItem(swf,idx) {
		thisMovie(swf).removeItem(idx);
	};
	function itemData(swf,idx) { 
		var obj = thisMovie(swf).itemData(idx);
		var txt = "";
		for(var i in obj) { 
			txt += i+": "+obj[i]+"\n";
		}
		alert(txt);
	};
	function thisMovie(movieName) {
		if(navigator.appName.indexOf("Microsoft") != -1)
			return window[movieName];
		else
			return document[movieName];
	};
	function browseMovie(forward)
	{
		
		var movies = 
		[
				{ allowfullscreen:true, file:"/static/videos/lellebelle.mp4", image:'/static/images/lellebelle_start.jpg',  comment:""},
				{ allowfullscreen:true, file:"/static/videos/kinderen.flv", image:'/static/images/kind_start.jpg',  comment:""},
				{ allowfullscreen:true, file:"/static/videos/sekjoeritie.mp4", image:'/static/images/sek_start.jpg',  comment:""},
				{ allowfullscreen:true, file:"/static/videos/win.mp4", image:'/static/images/win_start.jpg',  comment:""},
				{ allowfullscreen:true, file:"/static/videos/kofte.mp4", image:'/static/images/promo_kofte.jpg',  comment:""}
		
		];
		
		//{ allowfullscreen:true, file:"/static/videos/sekjoeritie.mp4", image:'/static/images/sek_start.jpg',  comment:"Coach <a href=\"http://www2.telefilm.nl/page/filmartikel/224\">Meer over deze film</a>"}
		
		if(forward == "random")
		{
			browseMovies = Math.round(Math.random()*(movies.length-1));
			
		}
		else
		{
			if(forward && browseMovies < (movies.length-1))
				browseMovies++;
			else if(!forward  && browseMovies > 0)
				browseMovies--;
			else if(!forward)
				browseMovies = movies.length-1;
			else
				browseMovies = 0;
		}
		

		
		
		document.getElementById("movieComment").innerHTML=movies[browseMovies].comment;
		loadFile('previewMovie', movies[browseMovies]);
		
		
	};
	
