function MOVIE(appId, actionRoot) {
	
	this.appId = appId;
	
	this.startMovie = function(){
		//alert(appId);
		$('#percyplayercontainer').show();
		var swf = this.getApp(this.appId);
		//alert(swf);
		swf.loadXml(this.actionRoot+'repository/percy-trailer.jsp'); 
	}
	
		
	this.getApp = function(appName) {
		
		/*
		$(".teaser_container").hide();
		$("#flashvideocontainer").show();
		$(".prozent, td.prozent a").hide();
		$(".videoprozent ,td.videoprozent a").show();
			
		*/
		
		if (navigator.appName.indexOf ("Microsoft") !=-1) {
		       window[appName];
		       return document[appName];
		   } 
		   else {
		       return document[appName];
		}
	}
	
	this.playMovie = function(){
		var waitForFlashInterval;
		var swf = this.getApp(this.appId);
		var caller = this;
		
		if(typeof(swf.loadXml) == "function") {
			this.startMovie();
		}
		else if(waitForFlashInterval == null)
		{
			waitForFlashInterval = setInterval(function(){
				if(typeof(swf.loadXml) != "function") return;
				caller.startMovie();
				clearInterval(waitForFlashInterval);
				waitForFlashInterval = null;
			}, 1000);
		}
	}
}