function galleryMovieWrite(movie) {
	GalleryPro.QTTest();
	viewMov = movie;
	if (GalleryPro.okQT == false) {
		document.write('<div class="movie" id="gallery_qtm"><a href="/befr/quicktime/download/"><img src="http://images.apple.com/pro/images/quicktime7required.jpg" border="0" width="256" height="180" alt="QuickTime 7 Required"><\/a><\/div>');
	} else {
		document.write('<div id="gallerywithscrub"><div class="movie" id="gallery_qtm">');
		QT_WriteOBJECT(
					viewMov, "256", "180", "",
					"id", "gallery_pm",
					"autoplay", "false",
					"cache", "true",
					"emb#id", "gallery_pme",
					"emb#bgcolor", "#ffffff",
					"EnableJavaScript", "true",
					"controller", "false"
				);
		document.write('<\/div>');
		document.write('<div id="gallery_transport"><a href="#" id="gallery_btnPlay">&nbsp;<\/a><a href="#" id="gallery_btnPause">&nbsp;<\/a><div id="gallery_timeline"><div id="gallery_position"><div id="gallery_handle"><img src="http://images.apple.com/pro/images/qtpointer_small.gif" alt="pointer" width="10" height="13" border="0"><\/div><\/div><\/div><\/div><\/div>');
	}
}


/**************************************************
 * dom-drag
 * 09.25.2001
 * www.youngpup.net
 **************************************************
 * 10.28.2001 - fixed minor bug where events
 * sometimes fired off the handle, not the root.
 **************************************************/

var GalleryDrag = {

	obj : null,

	init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
	{
		o.onmousedown	= GalleryDrag.start;

		o.hmode			= bSwapHorzRef ? false : true ;
		o.vmode			= bSwapVertRef ? false : true ;

		o.root = oRoot && oRoot != null ? oRoot : o ;

		if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
		if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "-7px";
		if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
		if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";

		o.minX	= typeof minX != 'undefined' ? minX : null;
		o.minY	= typeof minY != 'undefined' ? minY : null;
		o.maxX	= typeof maxX != 'undefined' ? maxX : null;
		o.maxY	= typeof maxY != 'undefined' ? maxY : null;

		o.xMapper = fXMapper ? fXMapper : null;
		o.yMapper = fYMapper ? fYMapper : null;

		o.root.onDragStart	= new Function();
		o.root.onDragEnd	= new Function();
		o.root.onDrag		= new Function();
	},

	start : function(e)
	{
		clearTimeout(GalleryPro.timer1);
		var o = GalleryDrag.obj = this;
		e = GalleryDrag.fixE(e);
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		o.root.onDragStart(x, y);

		o.lastMouseX	= e.clientX;
		o.lastMouseY	= e.clientY;

		if (o.hmode) {
			if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
			if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
		} else {
			if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
			if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
		}

		if (o.vmode) {
			if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
			if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
		} else {
			if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
			if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
		}
		
		
		document.onmousemove	= GalleryDrag.drag;
		document.onmouseup		= GalleryDrag.end;

		return false;
	},

	drag : function(e)
	{
		e = GalleryDrag.fixE(e);
		var o = GalleryDrag.obj;

		var ey	= e.clientY;
		var ex	= e.clientX;
		var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		var nx, ny;

		if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
		if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
		if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
		if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);

		nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
		ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));

		if (o.xMapper)		nx = o.xMapper(y)
		else if (o.yMapper)	ny = o.yMapper(x)

		GalleryDrag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
		
		GalleryDrag.obj.root.style[o.vmode ? "top" : "bottom"] = -7 + "px";
		GalleryDrag.obj.lastMouseX	= ex;
		GalleryDrag.obj.lastMouseY	= ey;
		
		$('gallery_position').style.width = nx+5+"px";
		
		GalleryPro.QTMovie.obj.SetTime(((parseInt($('gallery_handle').style.left.split('px')[0])+5)/206)*GalleryPro.QTMovie.timeEnd);
		GalleryPro.Pause();
		
		GalleryDrag.obj.root.onDrag(nx, ny);
		return false;
	},

	end : function()
	{
		document.onmousemove = null;
		document.onmouseup   = null;
		GalleryDrag.obj.root.onDragEnd(parseInt(GalleryDrag.obj.root.style[GalleryDrag.obj.hmode ? "left" : "right"]), parseInt(GalleryDrag.obj.root.style[GalleryDrag.obj.vmode ? "top" : "bottom"]));
		GalleryDrag.obj = null;
		GalleryPro.ProcessDrag();
		GalleryPro.Play();
	},

	fixE : function(e)
	{
		if (typeof e == 'undefined') e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
		return e;
	}
};








/**************************************************
 * quicktime
 * 09.25.2001
 * www.youngpup.net
 **************************************************
 * 10.28.2001 - fixed minor bug where events
 * sometimes fired off the handle, not the root.
 **************************************************/

var GalleryPro = {
	hasQT: false,
	okQT: false,
	okBR: true,
	QTMovie: {
		timeNow: 0,
		timeEnd: 0,
		obj: null,
		isPlaying: false
	},
	interval: 50,
	tryCount: 0,
	timer1: null, 
	timer2: null,
	timer3: null,
	sliderPosition: 0,
	// set initmovie and firstplayed - strimble
	initmovie: true,
	firstplayed: false,
	Init: function() {
		var n = GalleryPro;
		n.QTTest();	
		//var oakland = $('gallery').getElementsByTagName('a');
		//for (i=0; i<oakland.length; i++) { addEventToObject(oakland[i],'onclick',GalleryPro.Swap); }
		n.btnPlay = ($('gallery_btnPlay')) ? new _btnPlayGallery($('gallery_btnPlay')) : false;
		n.btnPause = ($('gallery_btnPause')) ? new _btnPauseGallery($('gallery_btnPause')) : false;
		n.handle = $('gallery_handle');
		GalleryDrag.init(GalleryPro.handle, null, 0, 206, 0, 0);
		n.ffx = function() {
			var n = GalleryPro;
				
				try
				{ 
					var o = document.getElementById("gallery_pm"); 
					o.GetPluginStatus(); 
					n.QTMovie.obj = o; 
				}
				catch(e)
				{ 
					try 
					{ 
						var o = document.getElementById("gallery_pme"); 
						o.GetPluginStatus(); 
						n.QTMovie.obj = o; 
					}
					catch(e)
					{
						try 
						{ 
							var o = document['gallery_pm']
							o.GetPluginStatus(); 
							n.QTMovie.obj = o; 
						}
						catch(e)
						{
							n.QTMovie.obj = null;
						}
					}
				}
				try
				{
					if ((n.QTMovie.obj != null) && (n.QTMovie.obj.GetPluginStatus().toLowerCase() == "playable" 
						|| n.QTMovie.obj.GetPluginStatus().toLowerCase() == "complete"))
					{
						$('debug').innerHTML += 'passed. n.QTMovie.obj = '+n.QTMovie.obj+'<br>';
						clearTimeout(n.timer3);
						// check to see if this is the initial movie - strimble
						if(!n.initmovie) setTimeout('GalleryPro.Play();',1000);
						else if(n.initmovie) setTimeout('GalleryPro.StartGallery();',1000);
						return;
					}
				}
				catch(e)
				{
					n.timer3 = setTimeout("GalleryPro.ffx();",700);
				}
			n.timer3 = setTimeout("GalleryPro.ffx();",700);
		}
		n.timer3 = setTimeout("GalleryPro.ffx();",700);
	},
	Play: function() {
		Pro.Pause();
		var n = GalleryPro;
		n.QTMovie.isPlaying = true;
		// if a movie hasn't been played yet set time to 0 - strimble
		if(n.firstplayed == false) {
			n.QTMovie.obj.SetTime(0);
			n.firstplayed = true;
		}
		n.GetQTPosition();
		n.GetQTInfo();
		n.GetQTPosition();
		n.SetSliderPosition();
		try {n.QTMovie.obj.Play();}
		catch (err) {n.okQT = n.okBR = false;}
		return false;
	},
	StartGallery: function() {
		var n = GalleryPro;
		n.GetQTPosition();
		n.GetQTInfo();
		n.GetQTPosition();
		n.SetSliderPosition();
		// set movie time to display a certain frame - strimble
		n.QTMovie.obj.SetTime(64400);
		n.initmovie = false;
		return false;
	},
	Pause: function() {
		var n = GalleryPro;
		clearTimeout(n.timer1);
		clearTimeout(n.timer2);
		try {n.QTMovie.obj.Stop();}
		catch (err) {n.okQT = n.okBR = false;}
		n.QTMovie.isPlaying = false;
		n.GetQTPosition();
		n.SetSliderPosition();
		return false;
	},
	GetQTInfo: function() {var n = GalleryPro; n.QTMovie.timeEnd = n.QTMovie.obj.GetDuration();},
	GetQTPosition: function() {
		var n = GalleryPro;
		n.QTMovie.timeNow = n.QTMovie.obj.GetTime();
		if(n.QTMovie.isPlaying) {n.timer2 = setTimeout(GalleryPro.GetQTPosition,GalleryPro.interval);};
	},
	SetSliderPosition: function() {
		var n = GalleryPro;
		n.sliderPosition = Math.round((n.QTMovie.timeNow/n.QTMovie.timeEnd)*206);
		$('gallery_position').style.width = n.sliderPosition+"px";
		GalleryPro.handle.style.left = n.sliderPosition-5+"px";
		if(n.QTMovie.isPlaying) {n.timer1 = setTimeout(GalleryPro.SetSliderPosition,GalleryPro.interval);};
	},
	ProcessDrag: function() {
		var n = GalleryPro;
		clearTimeout(n.timer1);
		n.QTMovie.obj.SetTime(((parseInt($('gallery_handle').style.left.split('px')[0])+5)/206)*n.QTMovie.timeEnd);
		n.SetSliderPosition();
	},
	QTTest: function() {
		var n = GalleryPro;
		n.hasQT = false;
		if(navigator.plugins && navigator.plugins.length) {
			for (var i=0;i<navigator.plugins.length;i++) {
				if(navigator.plugins[i].name.indexOf('QuickTime') >= 0) {
					n.hasQT = true;
					
					n.okQT = (parseInt(navigator.plugins[i].name.substring(18))<7)?false:true;
					
				}
			}
		} else {
			execScript('on error resume next: GalleryPro.hasQT = IsObject(CreateObject("QuickTimeCheckObject.QuickTimeCheck.1"))','VBScript');
			execScript('on error resume next: GalleryPro.okQT = Hex(CreateObject("QuickTimeCheckObject.QuickTimeCheck.1").QuickTimeVersion)/1000000','VBScript');
			n.okQT = (n.okQT<7)?false:true;
		}
	},
	Swap: function(ev) {
		//Pro.Pause();
		var n = GalleryPro;
		if (!ev) ev = window.event;
		var clickedLink = (window.event) ? window.event.srcElement : ev.target;
		while (!clickedLink.tagName || clickedLink.tagName.toLowerCase() != "a") clickedLink = clickedLink.parentNode;
		var loc = document.location+"";
		var workingStr = clickedLink.getAttribute('target');
		n.QTMovie.obj.SetURL(workingStr);
		n.QTMovie.obj.SetControllerVisible(false);
		n.ffx();
		if ($('profileName')) $('profileName').innerHTML = clickedLink.title;
		(ev.stopPropagation) ? ev.stopPropagation() : ev.cancelBubble = true;
		(ev.preventDefault) ? ev.preventDefault() : ev.returnValue = false;
		return false;
	}
}
function _btnPlayGallery(obj) {
	addEventToObject(obj,'onmousedown',function(){obj.style.backgroundPosition="left -20px"})
	addEventToObject(obj,'onmouseup',function(){obj.style.backgroundPosition="left 0px"})
	addEventToObject(obj,'onclick',GalleryPro.Play)
}
function _btnPauseGallery(obj) {
	addEventToObject(obj,'onmousedown',function(){obj.style.backgroundPosition="left -20px"})
	addEventToObject(obj,'onmouseup',function(){obj.style.backgroundPosition="left 0px"})
	addEventToObject(obj,'onclick',GalleryPro.Pause)
}
function CurrentStyle(el,prop) {
	var viewCSS = (typeof document.defaultView=='function') ? document.defaultView() : document.defaultView;
	if (viewCSS && viewCSS.getComputedStyle){
		var s = viewCSS.getComputedStyle(el,null);
		return s && s.getPropertyValue(prop);
	}
	return el.currentStyle && (el.currentStyle[prop] || null) || null;
}
function getStyle(el,styleProp)
{
	var x = document.getElementById(el);
	if (x.currentStyle) var y = x.currentStyle[styleProp];
	else if (window.getComputedStyle) var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
  return y;
}
