var Movie;
var bottomMaessage;

function jsvideo(x,y,x_wmp,y_wmp,path) {
	Movie = {
	aMovies: new Array(

	{width:x, height:y, width_wmp:x_wmp, height_wmp:y_wmp, src:path} ),

	sNoQTLink: '<a href="http://www.apple.com/de/quicktime/download/"><img src="quicktime.jpg" width="640" height="360" alt="Sie ben&uuml;tigen QuickTime 7 um sich dieses Video anzusehen."><\/a>',
	play: function() {
		var oPlayMovie = Movie.aMovies[0];
		if(isQTInstalled()) {
			if(browser.isIE == true) {
				if (checkQt() == 7) {
					//alert('QT7 on IE');
					$('moviedivtag').innerHTML = '';
					document.writeln = QT_WriteOBJECT_XHTML(
						oPlayMovie.src+'.mov',
						oPlayMovie.width,
						oPlayMovie.height,
						'',
						'id',
						'qt',
						'autoplay',
						'true',
						'cache',
						'false',
						'controller',
						'true',
						'type',
						'video/quicktime',
						'scale',
						'aspect'
					);
					bottomMaessage = '';
				} else {
					//alert('QT6 on IE');
					$('moviedivtag').innerHTML = '';
					document.writeln = QT_WriteOBJECT_XHTML(
						oPlayMovie.src+'.mp4',
						oPlayMovie.width,
						oPlayMovie.height,
						'',
						'id',
						'qt',
						'autoplay',
						'true',
						'cache',
						'false',
						'controller',
						'true',
						'type',
						'video/quicktime',
						'scale',
						'aspect'
					);
					bottomMaessage = '<div align="center"><br/>Um dieses Video in bester Qualit&auml;t zu sehen,<br/>installieren Sie bitte <a href="http://www.apple.com/quicktime/download/win.html" target="_blank">QuickTime 7</a>.</div>';
				}
			} else {
				if (checkQt() == 7) {
					//alert('QT7 on FF');
					$('moviedivtag').innerHTML = QT_GenerateOBJECTText_XHTML(
						oPlayMovie.src+'.mov',
						oPlayMovie.width,
						oPlayMovie.height,
						'',
						'id',
						'qt',
						'autoplay',
						'true',
						'cache',
						'false',
						'controller',
						'true',
						'type',
						'video/quicktime',
						'scale',
						'aspect'
					);
					bottomMaessage = '';
				} else {
					//alert('QT6 on FF');
					$('moviedivtag').innerHTML = QT_GenerateOBJECTText_XHTML(
						oPlayMovie.src+'.mp4',
						oPlayMovie.width,
						oPlayMovie.height,
						'',
						'id',
						'qt',
						'autoplay',
						'true',
						'cache',
						'false',
						'controller',
						'true',
						'type',
						'video/quicktime',
						'scale',
						'aspect'
					);
					bottomMaessage = '<div align="center"><br/>Um dieses Video in bester Qualit&auml;t zu sehen,<br/>installieren Sie bitte <a href="http://www.apple.com/quicktime/download/win.html" target="_blank">QuickTime 7</a>.</div>';
				}
			}

		} else {
			$('moviedivtag').innerHTML = '';
			document.writeln = WMP_WriteOBJECT_XHTML(
				oPlayMovie.src+'.wmv',
				oPlayMovie.width_wmp,
				oPlayMovie.height_wmp,
				'',
				'id',
				'wmp',
				'autoplay',
				'true',
				'cache',
				'false',
				'controller',
				'true',
				'type',
				'video/x-ms-asf-plugin'
				);
			/*$('movie').innerHTML = Movie.sNoQTLink;*/
		}
	}
	}
	Movie.play();
	detectMediaPlayer();
	document.write(bottomMaessage);
}

function detectMediaPlayer() {
    var mp = document.getElementById("wmp");
    if (mp != null) {
        try {
            mp.play();
            medialPlayerStarted();
        } catch (e) {
            mediaPlayerNotStarted();
        }
    }
}

function medialPlayerStarted() {
	bottomMaessage = '<div align="center"><br/>Um dieses Video in bester Qualit&auml;t zu sehen,<br/>installieren Sie bitte <a href="http://www.apple.com/quicktime/download/win.html" target="_blank">QuickTime 7</a>.</div>';
}

function mediaPlayerNotStarted() {
	bottomMaessage = '<div align="center"><br/>Um dieses Viedo ansehen zu k&ouml;nnen muss ActiveX aktiviert sein.</div>';
    return true;
}

