function packageTrailer(poster, movieDimensions, container) {
	var movieUrl = this.toString();

	// set up the movie options
	var options = {
		width: movieDimensions.width || 640,
		height: movieDimensions.height || 496,
		autoplay: true,
		controller: true,
		cache: true
	};

	// if we have the right version of QT and aren't the iphone
	if (AC.Detector.isValidQTAvailable('7.0') && !AC.Detector.isiPhone()) {

		// the movie
		var movie = AC.Quicktime.packageMovie('movie', movieUrl, options);

		// set the image
		var posterImg = Builder.node('img', { src:poster, alt:'Click to Play', border:'0', style:'cursor:pointer;' });

		// when we click on the image, append the movie to the container
		posterImg.onclick = function() {
			$(container).innerHTML = '';
			$(container).appendChild(movie);
		}.bind(movie, container)

		$(container).appendChild(posterImg);
	}

	if (AC.Detector.isiPhone()) {
		// the poster is the posterFrame
		options.posterFrame = poster;

		// the movie
		var movie = AC.Quicktime.packageMovie('movie', movieUrl, options);

		// append the movie to the container
		$(container).appendChild(movie);
	}
}

// for one trigger
function packageTrailerTrigger(poster, movieDimensions, container, trigger) {
	var movieUrl = this.toString();

	// set up the movie options
	var options = {
		width: movieDimensions.width || 640,
		height: movieDimensions.height || 496,
		autoplay: true,
		controller: true,
		cache: true
	};

	// if we have the right version of QT and aren't the iphone
	if (AC.Detector.isValidQTAvailable('7.0') && !AC.Detector.isiPhone()) {

		// the movie
		var movie = AC.Quicktime.packageMovie('movie', movieUrl, options);

		// when we click on the trigger, append the movie to the container
		$(trigger).onclick = function(evt) {
			Event.stop(evt);
			$(container).innerHTML = '';
			$(container).appendChild(movie);
			$(container).setStyle({ zIndex:100});
			//
			$(trigger).hide();
		}.bindAsEventListener(movie, container)
	}

	if (AC.Detector.isiPhone()) {
		// the movie
		var movie = AC.Quicktime.packageMovie('movie', movieUrl, {
			width:$(trigger).getWidth(),
			height:$(trigger).getHeight(),
			autoplay:true,
			cache:true,
			posterFrame:poster
		});

		// append the movie to the trigger
		$(trigger).appendChild(movie);
	}
}

// for multiple triggers
function packageTrailerTriggers(container, dimensions) {
	var container = $(container);
	var movieUrl = null;
	var movie = null;
	var triggers = $$('a.trigger');
		
	triggers.each(function(trigger) {
		trigger.observe('click', function(e) {
			Event.stop(e);
			$$('.active')[0] ? $$('.active')[0].removeClassName('active') : null ;
			trigger.addClassName('active');
			
			movieUrl = trigger.href;
			container.innerHTML = '';
			movie = AC.Quicktime.packageMovie('movie', movieUrl, {
				width: dimensions.width || 640,
				height: dimensions.height || 496,
				controller: true,
				autostart: true,
				showlogo: false,
				cache: true,
				aggressiveCleanup: false,
				bgcolor: '#000000'
			});
			container.appendChild(movie);
			movie = null;
		}.bind(this))
	})

}
