function EmbedQuicktime(source, width, height, bgcolor, autoplay, next){
	var QTNextSrc = "";
	var QTVersion = 0;
	var useSafari = 0;
	
	if (window.BrowserDetect.browser == "Safari" && window.BrowserDetect.version >= 534) {
		useSafari = 1;
	}

	if(window.PluginDetect && PluginDetect.getVersion("QuickTime") != null){
		QTVersion = parseInt(PluginDetect.getVersion("QuickTime").replace(/,/g,""));
	}
	var useQTNextHack = (navigator.appVersion.indexOf("MSIE 7") && QTVersion >= 7200 && QTVersion < 7300)? true : false;
	
	if(useQTNextHack && next != ""){
		QTNextSrc = "";
	}else if(next != ""){
		QTNextSrc = "<"+next+"> T<_self>";
	}

	if(QTVersion > 0 
          ||( navigator.userAgent.indexOf('iPhone') > -1) 
          ||( navigator.userAgent.indexOf('iPad') > -1) ){
		var playerCode = "";
		
		if ((navigator.userAgent.indexOf('iPhone') < 0) || (navigator.userAgent.indexOf('iPad') < 0)  ) {
		
			if (useSafari == 1) {
				playerCode += '<object type="video/quicktime" id="qt_player" class="player" width="'+width+'" height="'+height+'">';			
			} else {
				playerCode += '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" id="qt_player" class="player" width="'+width+'" height="'+height+'" codebase="http://www.apple.com/qtactivex/qtplugin.cab">';			
			}

			playerCode += '<param name="src" value="'+source+'" />';
			playerCode += '<param name="autoplay" value="'+autoplay+'" />';
			playerCode += '<param name="controller" value="true" />';
			playerCode += '<param name="scale" value="aspect"/>';
			playerCode += '<param name="kioskmode" value="true" />';
			playerCode += '<param name="bgcolor" value="'+bgcolor+'" />';
			playerCode += '<param name="qtnext1" value="'+QTNextSrc+'" />';
		}
		
		playerCode += '<embed name="qt_player" src="'+source+'" width="'+width+'" height="'+height+'" autoplay="'+autoplay+'" controller="true" scale="aspect" resizable="true" kioskmode="true" pluginspage="http://www.apple.com/quicktime/download/" bgcolor="'+bgcolor+'" enablejavascript="true" qtnext1="'+QTNextSrc+'"></object>';

		var player = document.getElementById('quicktime-player');
		if(!player){
			alert("Unable to embed QuickTime player");
			return;
		}

		player.style.height = height+"px";
		player.innerHTML = playerCode;

		/* This is a monster hack for quicktime7.2 with ie7 to prevent qtnext from opening a new instance of the default browser */
		if(useQTNextHack && next != ""){
			window.onload = function(){
				var QTCheckSrc = function(){
					try{
						var QTPlayer = document.qt_player;
						if(typeof(QTPlayer) != "undefined" && typeof(QTPlayer.GetTime) != "undefined" && typeof(QTPlayer.GetEndTime) != "undefined"){
							if(QTPlayer.GetTime() == QTPlayer.GetEndTime()){
								window.clearInterval(QTWait);
								document.location = next;
							}
						}else{
							window.clearInterval(QTWait);
						}
					}catch(e){
						// Die gracefully
					}
				}

				var QTWait = window.setInterval(QTCheckSrc, 500);
			}
		}
	}
	else if(window.Content){
		Content.alert('You do not seem to have QuickTime installed. <a target="_blank" href="http://www.apple.com/quicktime/download">Please follow this link to download it</a>', 0, 'warning');
	}
	else{
		alert('You do not seem to have QuickTime installed. Please visit http://www.apple.com/quicktime/download to install it');
	}
}

