/**
 * Simple JQuery Plugin to embed and control quicktime movies
 * Alpha: 00001
 * Author: Keith Deverell 2008
 * Need to add in browser checks for the embed
 * As well as other features
 * This is also my first JQuery plugin so not sure if the structure is correct
 */

var QTControl = {
    embed: function(id,url,w,h,vol) 
	{
		//	Currently javascript com. only working in Safari, not in Mozilla - haven't checked IE	
		//	  =  taken out of object, Safari doesn't need it, will check in IE
		
		var str =  '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
			str += 'id="'+id+'"';
			str += 'width="160" height="120"';
			str += 'codebase="http://www.apple.com/qtactivex/qtplugin.cab">';
			str += '<param name="src" VALUE="'+url+'"/>';
			str += '<param name="autoplay" VALUE="true"/>';
			str += '<param name="controller" value="false"/>';
			str += '<param name="volume" value="'+vol+'"/>';
			str += '<param name="showlogo" value="false"/>';
			str += '<param name="bgcolor" value="ffffff"/>';
			str += '<embed src="'+url+'" width="'+w+'" height="'+h+'"';
			str += 'name="'+id+'" autoplay="true" controller="false"';
			str += 'enablejavascript="true" volume="'+vol+'" showlogo="false" bgcolor="ffffff"';
			str += 'pluginspage="http://www.apple.com/quicktime/download/" />';
			str += '</object>';

		return str;
    },
	volume: function(qt,vol)
	{
		document[qt].SetVolume(vol);
	},
	play: function(qt)
	{
		document[qt].Play();
	},
	stop: function(qt)
	{
		document[qt].Stop();
	},
	speed: function(qt,rate)
	{
		document[qt].SetRate(rate);
	}
}


