/* Schwar's uber JavaScript QuickTime controls... */
var quicktimeObject;
var quicktimeObject2;

function setQTObject(anObj)
{
	quicktimeObject = anObj;
	setInterval ( "checkPlayback()", 250 );
}

function setQTObject2(anObj2)
{
	quicktimeObject2 = anObj2;
	setInterval ( "checkPlayback()", 250 );
}

function checkPlayback()
{
	atStatus = quicktimeObject.GetPluginStatus();
	if (atStatus == 'Playable' || atStatus == 'Complete'){
		var qtRate = quicktimeObject.GetRate();
		if ( qtRate == 1){
			swapIt('playButton', 'pause');
		}
		else {		
			swapIt('playButton', 'play');
		}
	}
}

function playQT(anObj)
{
	/* play movie button */
	var loadedQT = anObj.GetURL();
	var userQT = anObj.GetHREF();
	if (loadedQT.indexOf(userQT) == -1 ){
		/* the users QT isn't loaded in to the player so lets load in in over the poster frame */
		anObj.SetURL(anObj.GetHREF());
		swapIt('playButton', 'pause');
		anObj.Play();
	}
	else{
		/* play / pause button */
		if (anObj.GetRate() == 1){
			swapIt('playButton', 'play');
			anObj.Stop();
		}
		else {
			swapIt('playButton', 'pause');
			anObj.Play();
		}
	}
}

function playQT2(anObj2)
{
	/* play movie button */
	var loadedQT2 = anObj2.GetURL();
	var userQT2 = anObj2.GetHREF();
	if (loadedQT2.indexOf(userQT2) == -1 ){
		/* the users QT isn't loaded in to the player so lets load in in over the poster frame */
		anObj2.SetURL(anObj2.GetHREF());
		swapIt('playButton2', 'pause2');
		anObj2.Play();
	}
	else{
		/* play / pause button */
		if (anObj2.GetRate() == 1){
			swapIt('playButton2', 'play2');
			anObj2.Stop();
		}
		else {
			swapIt('playButton2', 'pause2');
			anObj2.Play();
		}
	}
}

function stopQT(anObj)
{
	/* stop movie button */
	anObj.Stop();
}
function restartQT(anObj)
{
	/* restart movie button */
	anObj.Rewind();
}
function nextFrameQT(anObj)
{
	/* forward a frame */
	anObj.Step(1);
}
function previousFrameQT(anObj)
{
	/* back a frame */
	anObj.Step(-1);
}
function swapIt(id, newclass) {
	if (document.getElementById) {
		document.getElementById(id).className = newclass;
	}
}