
var MCPPVideos = new Array;

var MCPPVideoCount = 0;

var MCPP_VIDEO_CONTROLLER_HEIGHT = 18;
var MCPP_VIDEO_BAR_HEIGHT = 12;
var MCPP_VIDEO_BUTTON_WIDTH = 12;
var MCPP_VIDEO_KNOB_WIDTH = 16;

var MCPP_VIDEO_LOGO_WIDTH = 438;
var MCPP_VIDEO_LOGO_HEIGHT = 80;

var MCPP_QT_UPGRADE_WIDTH = 480;
var MCPP_QT_UPGRADE_HEIGHT = 272;



window.setInterval("MCPPVideoUpdate()", 100);


function MCPPVideoInsert(url, title, width, height, id, option)
{
	var root;
	
	if (id)
	{
		root = document.getElementById(id);
		if (!root)
		{
			document.write('<div id="' + id + '"></div>');
			root = document.getElementById(id);
		}
	}
	else
	{
		id = 'MCPPVideoEmbed' + MCPPVideoCount;
		++MCPPVideoCount;
		
		document.write('<div id="' + id + '"></div>');
		root = document.getElementById(id);
	}
	
	var video = document.createElement('div');
	var controller = document.createElement('div');
	
	root.style.width = width + 'px';
	root.style.height = (height + MCPP_VIDEO_CONTROLLER_HEIGHT) + 'px';
	root.style.display = 'block';
	root.style.position = 'relative';

	root.appendChild(video);
	root.appendChild(controller);
	
	MCPPVideoControllerInsert(width, controller, id, option);
	MCPPVideos[MCPPVideos.length] = controller;
	
	if (!(PluginDetect.isMinVersion('QuickTime', '7,0,0') >= 0))
		MCPPVideoUpgradeInsert(url, title, width, height, video, controller, id)
	else if (title)
		MCPPVideoPlaceholderInsert(url, title, width, height, video, controller, id);
	else
		MCPPVideoPlayerInsert(url, width, height, video, controller, id);
}


function MCPPAudioInsert(url, width, id)
{
	var root;
	
	if (id)
	{
		root = document.getElementById(id);
		if (!root)
		{
			document.write('<div id="' + id + '"></div>');
			root = document.getElementById(id);
		}
	}
	else
	{
		id = 'MCPPAudioEmbed' + MCPPVideoCount;
		++MCPPVideoCount;
		
		document.write('<div id="' + id + '"></div>');
		root = document.getElementById(id);
	}
	
	root.innerHTML = MCPPAudioObjectHTML(url, width, id);
}


function MCPPVideoUpgradeInsert(url, title, width, height, div, controller, id)
{
	var prefix = 'http://www.mackinac.org';
	if (window.location.host == 'dev' ||
	    window.location.host == 'development' ||
	    window.location.host == 'www.mackinac.org')
		prefix = '';
	
	var container = document.createElement('a');
	var image = document.createElement('img');

	div.style.width = width + 'px';
	div.style.height = height + 'px';
	div.style.display = 'block';
	div.style.position = 'relative';
	
	container.style.width = width + 'px';
	container.style.height = height + 'px';
	container.style.display = 'block';
	container.style.position = 'relative';
	container.style.border = '0px';
	container.style.margin = '0px';
	container.style.padding = '0px';
	container.style.backgroundColor = '#FFFFFF';
	container.style.cursor = 'pointer';
	container.href = 'http://www.apple.com/quicktime/download/';
	
	var imageWidth = MCPP_QT_UPGRADE_WIDTH;
	var imageHeight = MCPP_QT_UPGRADE_HEIGHT;
	
	if (imageWidth > width)
	{
		imageHeight = imageHeight * (width / imageWidth);
		imageWidth = width;
	}
	
	if (imageHeight > height)
	{
		imageWidth = imageWidth * (height / imageHeight);
		imageHeight = height;
	}

	image.style.display = 'block';
	image.style.position = 'absolute';
	image.style.top = ((height / 2) - (imageHeight / 2)) + 'px';
	image.style.left = ((width / 2) - (imageWidth / 2)) + 'px';
	image.style['-ms-interpolation-mode'] = 'bicubic';
	image.width = imageWidth;
	image.height = imageHeight;
	image.style.border = '0px';
	image.style.margin = '0px';
	image.style.padding = '0px';
	image.src = prefix + '/media/images/common/VideoQuickTimeUpgrade.jpg'
	
	div.appendChild(container);
	container.appendChild(image);
}


function MCPPVideoPlaceholderInsert(url, title, width, height, div, controller, id)
{
	var prefix = 'http://www.mackinac.org';
	if (window.location.host == 'dev' ||
	    window.location.host == 'development' ||
	    window.location.host == 'www.mackinac.org')
		prefix = '';
	
	var container = document.createElement('div');
	var image = document.createElement('img');
	var text = document.createElement('div');

	div.style.width = width + 'px';
	div.style.height = height + 'px';
	div.style.display = 'block';
	div.style.position = 'relative';
	
	container.style.width = width + 'px';
	container.style.height = height + 'px';
	container.style.display = 'block';
	container.style.position = 'relative';
	container.style.border = '0px';
	container.style.margin = '0px';
	container.style.padding = '0px';
	container.style.backgroundColor = '#00718F';
	container.style.cursor = 'pointer';
	
	var imageWidth = MCPP_VIDEO_LOGO_WIDTH;
	var imageHeight = MCPP_VIDEO_LOGO_HEIGHT;
	
	if (imageWidth > width)
	{
		imageHeight = imageHeight * (width / imageWidth);
		imageWidth = width;
	}
	
	if (imageHeight > height)
	{
		imageWidth = imageWidth * (height / imageHeight);
		imageHeight = height;
	}

	image.style.display = 'block';
	image.style.position = 'absolute';
	image.style.top = ((height / 2) - (imageHeight / 2)) + 'px';
	image.style.left = ((width / 2) - (imageWidth / 2)) + 'px';
	image.style['-ms-interpolation-mode'] = 'bicubic';
	image.width = imageWidth;
	image.height = imageHeight;
	image.style.border = '0px';
	image.style.margin = '0px';
	image.style.padding = '0px';
	image.src = prefix + '/media/images/common/VideoMackinacMedia.gif'
	
	text.style.display = 'block';
	text.style.width = (width - 40) + 'px';
	text.style.color = '#FFFFFF';
	text.style.margin = '0 20px';
	text.style.border = '0px';
	text.style.padding = '0px';
	text.style.fontFamily = 'Ariel, Helvetica, sans-sarif';
	text.style.fontStyle = 'italic';
	text.style.fontSize = '12pt';
	text.style.fontWeight = 'normal';
	text.style.textAlign = 'center';
	text.style.textDecoration = 'none';
	text.style.position = 'absolute';
	text.style.top = '70%';
	text.innerHTML = title;
	
	div.appendChild(container);
	container.appendChild(image);
	container.appendChild(text);
	
	this.playVideo = function()
	{
		MCPPVideoPlayerInsert(url, width, height, div, controller, id);
		return false;
	};
	
	controller.setProgress = this.playVideo;
	controller.setState = this.playVideo;
	container.onclick = this.playVideo;
}


function MCPPVideoPlayerInsert(url, width, height, div, controller, id)
{
	div.style.width = width + 'px';
	div.style.height = height + 'px';
	div.style.display = 'block';
	div.style.position = 'relative';
	div.style.overflow = 'hidden';
	div.style.backgroundColor = 'white';
	
	div.innerHTML = MCPPVideoObjectHTML(url, width, height, id);
	
	var videoObject = document.getElementById('MCPP' + id + 'Video');
	var videoObjectInner = document.getElementById('MCPP' + id + 'VideoInner');
	
	function video()
	{
		try
		{
			videoObject.GetPluginStatus();
			return videoObject;
		}
		catch (exception)
		{
			var temp = videoObject;
			videoObject = videoObjectInner;
			videoObjectInner = temp
		
			return videoObject;
		}
	}
	
	controller.getProgress = function()
	{
		try
		{
			var duration = video().GetDuration();
			if (duration < 0)
				return 0.0;
		
			var time = video().GetTime();
			if (time <= 0)
				return 0.0;
			
			return (video().GetTime() / duration) * 100;
		}
		catch (exception)
		{
			return 0.0;
		}
	};
	
	controller.setProgress = function(newProgress)
	{
		try
		{
			var duration = video().GetDuration();
			if (duration < 0)
				duration = 0;
			
			video().SetTime(duration * (newProgress / 100));
		}
		catch (exception)
		{
		}
	};
	
	controller.getLoad = function()
	{
		try
		{
			var duration = video().GetDuration();
			if (duration < 0)
				return 0.0;
		
			var time = video().GetMaxTimeLoaded();
			if (time <= 0)
				return 0.0;
			
			return (video().GetMaxTimeLoaded() / duration) * 100;
		}
		catch (exception)
		{
			return 0.0;
		}
	};
	
	controller.getState = function()
	{
		try
		{
			switch (video().GetPluginStatus())
			{
				case 'Playable':
				case 'Complete':
					if (video().GetRate() > 0)
						return 1;
				default:
					return 0;
			}
		}
		catch (exception)
		{
			return 0;
		}
	};
	
	controller.setState = function(newState)
	{
		try
		{
			if (newState == 1)
				video().SetRate(1);
			else
				video().SetRate(0);
		}
		catch (exception)
		{
		}
	};
	
	controller.update();
}


function MCPPVideoControllerInsert(width, div, id, option)
{
	var prefix = 'http://www.mackinac.org';
	if (window.location.host == 'dev' ||
	    window.location.host == 'development' ||
	    window.location.host == 'www.mackinac.org')
		prefix = '';

	var button = document.createElement('div');
	var bar = document.createElement('div');
	var barRight = document.createElement('div');
	var load = document.createElement('div');
	var knob = document.createElement('div');
	var accessory = null;
	var accessoryWidth = 0;
	
	if (option && option['accessory'])
	{
		var accessoryWidth = option['accessory-width'] ;
		accessory = option['accessory-div'];
		
		accessory.style.width = accessoryWidth + 'px';
		accessory.style.height = MCPP_VIDEO_BAR_HEIGHT + 'px';
		accessory.style.marginTop = (MCPP_VIDEO_CONTROLLER_HEIGHT - MCPP_VIDEO_BAR_HEIGHT) + 'px';
		accessory.style.display = 'block';
		accessory.style.position = 'absolute';
		accessory.style.right = '0px';
		
		accessoryWidth += (MCPP_VIDEO_CONTROLLER_HEIGHT / 3);
	}

	div.style.width = width + 'px';
	div.style.height = MCPP_VIDEO_CONTROLLER_HEIGHT + 'px';
	div.style.display = 'block';
	div.style.position = 'relative';

	button.style.width = MCPP_VIDEO_BUTTON_WIDTH + 'px';
	button.style.height = MCPP_VIDEO_BAR_HEIGHT + 'px';
	button.style.marginTop = (MCPP_VIDEO_CONTROLLER_HEIGHT - MCPP_VIDEO_BAR_HEIGHT) + 'px';
	button.style.display = 'block';
	button.style.position = 'absolute';
	button.style.left = '0';
	button.style.cursor = 'pointer';
	button.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoPlay.gif)';
	button.style.backgroundRepeat = 'no-repeat';

	bar.style.width = (width - MCPP_VIDEO_CONTROLLER_HEIGHT - accessoryWidth) + 'px';
	bar.style.height = MCPP_VIDEO_BAR_HEIGHT + 'px';
	bar.style.marginTop = (MCPP_VIDEO_CONTROLLER_HEIGHT - MCPP_VIDEO_BAR_HEIGHT) + 'px';
	bar.style.display = 'block';
	bar.style.position = 'absolute';
	bar.style.right = accessoryWidth + 'px';
	bar.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoBarLeft.gif)';
	bar.style.backgroundRepeat = 'no-repeat';

	barRight.style.width = (MCPP_VIDEO_BAR_HEIGHT / 2.0) + 'px';
	barRight.style.height = MCPP_VIDEO_BAR_HEIGHT + 'px';
	barRight.style.display = 'block';
	barRight.style.position = 'absolute';
	barRight.style.right = '0';
	barRight.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoBarRight.gif)';
	barRight.style.backgroundRepeat = 'no-repeat';

	load.style.width = MCPP_VIDEO_KNOB_WIDTH + 'px';
	load.style.height = MCPP_VIDEO_BAR_HEIGHT + 'px';
	load.style.display = 'block';
	load.style.position = 'absolute';
	load.style.left = '0';
	load.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoLoad.gif)';
	load.style.backgroundRepeat = 'no-repeat';
	
	knob.style.width = MCPP_VIDEO_KNOB_WIDTH + 'px';
	knob.style.height = MCPP_VIDEO_BAR_HEIGHT + 'px';
	knob.style.display = 'block';
	knob.style.position = 'absolute';
	knob.style.left = '0';
	knob.style.cursor = 'pointer';
	knob.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoKnob.gif)';
	knob.style.backgroundRepeat = 'no-repeat';
	
	div.appendChild(button);
	div.appendChild(bar);
	if (accessory)
		div.appendChild(accessory);
	bar.appendChild(barRight);
	bar.appendChild(load);
	bar.appendChild(knob);
	
	
	var _state = 0;
	var _left = 0;
	var _x = 0;
	var _adjusted_width = parseInt(bar.style.width) - MCPP_VIDEO_KNOB_WIDTH;
	var _mousedown = false;
	
	
	div.getProgress = function() { return 0.0 };
	div.setProgress = function(newProgress) { };
	div.getLoad = function() { return 100.0 };
	div.getState = function() { return 0 };
	div.setState = function(newState) { };
	
	div.update = function()
	{
		if (!_mousedown)
		{
			if (div.getState() == 1)
				button.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoPause.gif)';
			else
				button.style.backgroundImage = 'url(' + prefix + '/media/images/common/VideoPlay.gif)';
		}
		
		var left;
		
		left = div.getProgress() * (_adjusted_width / 100);
		knob.style.left = left + 'px';
		
		if (div.getLoad() < 100.0)
		{
			left = div.getLoad() * (_adjusted_width / 100);
			load.style.left = left + 'px';
			load.style.display = 'block';
		}
		else
		{
			load.style.display = 'none';
		}
	};
	
	
	MCPPVideoEventRegister(button, "click", function(theEvent)
	{
		MCPPVideoEventStopPropagation(theEvent);
		
		if (div.getState() == 1)
			div.setState(0);
		else
			div.setState(1);
		
		div.update();
	});
	
	MCPPVideoEventRegister(knob, "mousedown", function(theEvent)
	{
		MCPPVideoEventStopPropagation(theEvent);
		
		_mousedown = true;
		
		_state = div.getState();
		div.setState(0);
			
		_left = parseInt(knob.style.left);
		_x = theEvent.screenX;
		
		div.update();
	});
	
	MCPPVideoEventRegister(document, "mouseup", function(theEvent)
	{
		if (_mousedown)
		{
			MCPPVideoEventStopPropagation(theEvent);
			
			div.setState(_state);
			
			_mousedown = false;

			div.update();
		}
	});
	
	MCPPVideoEventRegister(document, "mousemove", function(theEvent)
	{
		if (_mousedown)
		{
			MCPPVideoEventStopPropagation(theEvent);
			
			var newLeft = (_left + theEvent.screenX - _x);
			
			if (newLeft < 0)
				newLeft = 0;
			else if (newLeft > _adjusted_width)
				newLeft = _adjusted_width;
			
			div.setProgress((newLeft / _adjusted_width) * 100);
		
			div.update();
		}
	});
	
	MCPPVideoEventRegister(bar, "mousedown", function(theEvent)
	{
		MCPPVideoEventStopPropagation(theEvent);
		
		if (!_mousedown)
		{
			_mousedown = true;
			
			_state = div.getState();
			div.setState(0);
			
			_x = theEvent.offsetX ? theEvent.offsetX : theEvent.pageX - MCPPVideoPositionX(bar);
			_left = _x - (MCPP_VIDEO_KNOB_WIDTH / 2);
			_x = theEvent.screenX;
	    
			div.setProgress((_left / _adjusted_width) * 100);
	    
			div.update();
		}
	});
}


function MCPPVideoObjectHTML(url, width, height, id)
{
	var videoObjectHTML = '';
	
	videoObjectHTML += '<!--[if IE]>\n'; // IE Only
	
	videoObjectHTML += '<object type="video/quicktime" ';
	videoObjectHTML +=   'id="MCPP' + id + 'Video' + '" ';
	videoObjectHTML +=   'style="BEHAVIOR: url(#qt_event_source)" '
	videoObjectHTML +=   'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ';
	videoObjectHTML +=   'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
	videoObjectHTML +=   'width="' + width + '" height="' + height + '">\n';
	
	videoObjectHTML += '<![endif]-->\n'; // End IE Only
	videoObjectHTML += '<![if !IE]>\n'; // Everybody Else
	
	videoObjectHTML += '<object type="video/quicktime" ';
	videoObjectHTML +=   'id="MCPP' + id + 'Video' + '" ';
	videoObjectHTML +=   'data="' + url + '" ';
	videoObjectHTML +=   'width="' + width + '" height="' + height + '">\n';
	
	videoObjectHTML += '<![endif]>\n'; // End Everybody Else
	
	videoObjectHTML += '  <param value="' + url + '" name="src">\n';
	
	videoObjectHTML += '  <param value="false" name="controller">\n';
	videoObjectHTML += '  <param value="true" name="showlogo">\n';
	videoObjectHTML += '  <param value="true" name="autostart">\n';
	videoObjectHTML += '  <param value="true" name="cache">\n';
	videoObjectHTML += '  <param value="true" name="saveembedtags">\n';
	videoObjectHTML += '  <param value="true" name="postdomevents">\n';
	videoObjectHTML += '  <param value="white" name="bgcolor"/>\n';
	
	videoObjectHTML += '</object>'
	
	return videoObjectHTML;
}


function MCPPAudioObjectHTML(url, width, id)
{
	var audioObjectHTML = '';
	
	audioObjectHTML += '<object id="MCPP' + id + 'Audio' + '" ';
	audioObjectHTML += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" ';
	audioObjectHTML += 'width="' + width + '" height= ';
	audioObjectHTML += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">\n';
	
	audioObjectHTML += '  <param value="/media/flash/player.swf" name="src">\n';
	audioObjectHTML += '  <param value="high" name="quality">\n';
	audioObjectHTML += '  <param value="false" name="menu">\n';
	audioObjectHTML += '  <param value="transparent" name="wmode">\n';
	audioObjectHTML += '  <param value="playerID=' + id + '&amp;sound?File=' + url + '" name="FlashVars">\n';
	audioObjectHTML += '  <param value="MCPP' + id + 'Audio' + '" name="id">\n';
	
	audioObjectHTML += '  <embed type="application/x-shockwave-flash" ';
	audioObjectHTML +=   'data="' + url + '" ';
	audioObjectHTML +=   'id="MCPP' + id + 'AudioInner' + '" ';
	audioObjectHTML +=   'src="' + url + '" ';
	audioObjectHTML +=   'wmode="transparent" ';
	audioObjectHTML +=   'menu="false" ';
	audioObjectHTML +=   'quality="high" ';
	audioObjectHTML +=   'flashvars="playerID=' + id + '&amp;sound?File=' + url + '" ';
	audioObjectHTML +=   'width="' + width + '" height="24">\n';
	audioObjectHTML += '  </embed>'
	
	audioObjectHTML += '</object>';
	
	return audioObjectHTML;
}


function MCPPVideoEventStopPropagation(videoEvent)
{
	if (videoEvent.stopPropagation)
		videoEvent.stopPropagation();
	else
		videoEvent.cancelBubbel = true;
	
	if (videoEvent.preventDefault)
		videoEvent.preventDefault();
	else
		videoEvent.returnValue = false;
}

function MCPPVideoEventRegister(object, eventName, handler)
{
	if (object)
	{
		if (object.addEventListener)
			object.addEventListener(eventName, handler, false);
		else if (object.attachEvent)
			object.attachEvent('on' + eventName, handler);
	}
}

function MCPPVideoEventUnregister(object, eventName, handler, capture)
{
	if (object)
	{
		if (object.removeEventListener)
			object.removeEventListener(eventName, handler, capture);
		else if (object.detachEvent)
			object.detachEvent('on' + eventName, handler);
	}
}

function MCPPVideoUpdate()
{
	for (var i = 0; i < MCPPVideos.length; ++i)
	{
		MCPPVideos[i].update();
	}
}

function MCPPVideoPositionX(object)
{
	var positionX = 0;
	
	if (object.offsetParent)
	{
		while (1) 
		{
			positionX += object.offsetLeft;
			
			if(! object.offsetParent)
				break;
			
			object = object.offsetParent;
		}
	}
	else if (object.x)
	{
		positionX += obj.x;
	}
	
	return positionX;
}

function MCPPVideoPositionY(object)
{
	var positionY = 0;
	
	if (object.offsetParent)
	{
		while (1)
		{
			positionY += object.offsetTop;
			
			if(! object.offsetParent)
				break;
			
			object = object.offsetParent;
		}
	}
	else if(object.y)
	{
		positionY += object.y;
	}
	
	return positionY;
}



/*
If you want to detect the QuickTime plugin, you can use the following code:
var QTInstalled = PluginDetect.isMinVersion('QuickTime', '0') >= 0 ? true : false;
var QTVersion = PluginDetect.getVersion('QuickTime');

if (PluginDetect.isMinVersion('QuickTime', '7,5,0') >= 0)
{
}
*/



/* PluginDetect v0.5.0 [ QT ] by Eric Gerds www.pinlady.net/PluginDetect */ 
if(!PluginDetect){
var PluginDetect={getNum:function(A,_2){
if(!this.num(A)){
return null;
}
var m;
if(typeof _2=="undefined"){
m=/[\d][\d\.\_,-]*/.exec(A);
}else{
m=(new RegExp(_2)).exec(A);
}
return m?m[0].replace(/[\.\_-]/g,","):null;
},hasMimeType:function(_4){
if(PluginDetect.isIE){
return null;
}
var s,t,z,M=_4.constructor==String?[_4]:_4;
for(z=0;z<M.length;z++){
s=navigator.mimeTypes[M[z]];
if(s&&s.enabledPlugin){
t=s.enabledPlugin;
if(t.name||t.description){
return s;
}
}
}
return null;
},findNavPlugin:function(N,_7){
var _8=N.constructor==String?N:N.join(".*"),numS=_7===false?"":"\\d";
var i,re=new RegExp(_8+".*"+numS+"|"+numS+".*"+_8,"i");
var _a=navigator.plugins;
for(i=0;i<_a.length;i++){
if(re.test(_a[i].description)||re.test(_a[i].name)){
return _a[i];
}
}
return null;
},getAXO:function(_b){
var _c,e;
try{
_c=new ActiveXObject(_b);
return _c;
}
catch(e){
}
return null;
},num:function(A){
return (typeof A!="string"?false:(/\d/).test(A));
},compareNums:function(_e,_f){
if(!this.num(_e)||!this.num(_f)){
return 0;
}
if(this.plugin&&this.plugin.compareNums){
return this.plugin.compareNums(_e,_f);
}
var m1=_e.split(","),m2=_f.split(","),x,p=parseInt;
for(x=0;x<Math.min(m1.length,m2.length);x++){
if(p(m1[x],10)>p(m2[x],10)){
return 1;
}
if(p(m1[x],10)<p(m2[x],10)){
return -1;
}
}
return 0;
},formatNum:function(num){
if(!this.num(num)){
return null;
}
var x,n=num.replace(/\s/g,"").replace(/[\.\_]/g,",").split(",").concat(["0","0","0","0"]);
for(x=0;x<4;x++){
if(/^(0+)(.+)$/.test(n[x])){
n[x]=RegExp.$2;
}
}
return n[0]+","+n[1]+","+n[2]+","+n[3];
},initScript:function(){
var $=this,IE;
$.isIE=/*@cc_on!@*/false;
$.IEver=-1;
$.ActiveXEnabled=false;
if($.isIE){
IE=(/msie\s*\d\.{0,1}\d*/i).exec(navigator.userAgent);
if(IE){
$.IEver=parseFloat((/\d.{0,1}\d*/i).exec(IE[0]),10);
}
var _14,x;
_14=["ShockwaveFlash.ShockwaveFlash","Msxml2.XMLHTTP","Microsoft.XMLDOM","Msxml2.DOMDocument","TDCCtl.TDCCtl","Shell.UIHelper","Scripting.Dictionary","wmplayer.ocx"];
for(x=0;x<_14.length;x++){
if($.getAXO(_14[x])){
$.ActiveXEnabled=true;
break;
}
}
}
if($.isIE){
$.head=typeof document.getElementsByTagName!="undefined"?document.getElementsByTagName("head")[0]:null;
}
},init:function(_15){
if(typeof _15!="string"){
return -3;
}
_15=_15.toLowerCase().replace(/\s/g,"");
var $=this,IE,p;
if(typeof $[_15]=="undefined"){
return -3;
}
p=$[_15];
$.plugin=p;
if(typeof p.installed=="undefined"){
p.installed=null;
p.version=null;
p.getVersionDone=null;
}
$.garbage=false;
if($.isIE&&!$.ActiveXEnabled){
return -2;
}
return 1;
},isMinVersion:function(_17,_18,_19){
;
var $=PluginDetect,i=$.init(_17);
if(i<0){
return i;
}
if(typeof _18=="undefined"||_18==null){
_18="0";
}
if(typeof _18=="number"){
_18=_18.toString();
}
if(!$.num(_18)){
return -3;
}
_18=$.formatNum(_18);
if(typeof _19=="undefined"){
_19=null;
}
var _1b=-1,p=$.plugin;
if(p.getVersionDone!=1){
;
;
p.getVersion(_18,_19);
if(p.getVersionDone==null||p.version!=null){
p.getVersionDone=1;
}
}
if(p.version!=null||p.installed!=null){
if(p.installed<=0.5){
_1b=p.installed;
}else{
_1b=(p.version==null?0:($.compareNums(p.version,_18)>=0?1:-1));
}
}
$.cleanup();
return _1b;
;
return -3;
},getVersion:function(_1c,_1d){
;
var $=PluginDetect,i=$.init(_1c);
if(i<0){
return null;
}
var p=$.plugin;
if(typeof _1d=="undefined"){
_1d=null;
}
if(p.getVersionDone!=1){
p.getVersion(null,_1d);
if(p.getVersionDone==null||p.version!=null){
p.getVersionDone=1;
}
}
$.cleanup();
return p.version;
;
return null;
},cleanup:function(){
;
var $=this;
if($.garbage&&typeof window.CollectGarbage!="undefined"){
window.CollectGarbage();
}
;
},isActiveXObject:function(_21){
;
var $=this,result,e,s="<object width=\"1\" height=\"1\" "+"style=\"display:none\" "+$.plugin.getCodeBaseVersion(_21)+">"+$.plugin.HTML+"</object>";
if($.head.firstChild){
$.head.insertBefore(document.createElement("object"),$.head.firstChild);
}else{
$.head.appendChild(document.createElement("object"));
}
$.head.firstChild.outerHTML=s;
try{
$.head.firstChild.classid=$.plugin.classID;
}
catch(e){
}
result=false;
try{
if($.head.firstChild.object){
result=true;
}
}
catch(e){
}
try{
if(result&&$.head.firstChild.readyState<4){
$.garbage=true;
}
}
catch(e){
}
$.head.removeChild($.head.firstChild);
return result;
;
},codebaseSearch:function(min){
var $=this;
if(typeof min!="undefined"){
return $.isActiveXObject(min);
}
;
var _25=[0,0,0,0],x,y,A=$.plugin.digits,t=function(x,y){
var _28=(x==0?y:_25[0])+","+(x==1?y:_25[1])+","+(x==2?y:_25[2])+","+(x==3?y:_25[3]);
return $.isActiveXObject(_28);
};
var _29,tmp;
var _2a=false;
for(x=0;x<A.length;x++){
_29=A[x]*2;
_25[x]=0;
for(y=0;y<20;y++){
if(_29==1&&x>0&&_2a){
break;
}
if(_29-_25[x]>1){
tmp=Math.round((_29+_25[x])/2);
if(t(x,tmp)){
_25[x]=tmp;
_2a=true;
}else{
_29=tmp;
}
}else{
if(_29-_25[x]==1){
_29--;
if(!_2a&&t(x,_29)){
_2a=true;
}
break;
}else{
if(!_2a&&t(x,_29)){
_2a=true;
}
break;
}
}
}
if(!_2a){
return null;
}
}
return _25.join(",");
;
},dummy1:0};
}
PluginDetect.initScript();
PluginDetect.onJavaDetectionDone=function(f,jar){
var $=this,j=$.java,z;
if(j.getVersionDone!=1){
z=$.isMinVersion("Java","0",jar);
if(z==-3){
z=$.getVersion("Java",jar);
}
}
if(j.installed!=null&&j.installed!=-0.5&&j.installed!=0.5){
if(typeof f=="function"){
f();
}
return;
}
;
};
PluginDetect.onWindowLoaded=function(f){
;
};
;
PluginDetect.quicktime={mimeType:["video/quicktime","application/x-quicktimeplayer","image/x-macpaint","image/x-quicktime"],progID:"QuickTimeCheckObject.QuickTimeCheck.1",progID0:"QuickTime.QuickTime",classID:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",minIEver:7,HTML:"<param name=\"src\" value=\"A14999.mov\" /><param name=\"controller\" value=\"false\" />",getCodeBaseVersion:function(v){
var r=v.replace(/[\.\_]/g,",").split(","),$=PluginDetect;
if($.compareNums(v,"7,5,0,0")>=0){
v=r[0]+","+r[1]+r[2]+","+r[3];
}
return "codebase=\"#version="+v+"\"";
},digits:[16,16,16,0],clipTo3digits:function(v){
if(v==null||typeof v=="undefined"){
return null;
}
var t;
t=v.split(",");
return t[0]+","+t[1]+","+t[2]+",0";
},getVersion:function(){
var _35=null,p,$=PluginDetect;
var _36=true;
if(!$.isIE){
if(navigator.platform&&(/linux/i).test(navigator.platform)){
_36=false;
}
if(_36){
p=$.findNavPlugin(["QuickTime","(Plug-in|Plugin)"]);
if(p&&p.name&&$.hasMimeType(this.mimeType)){
_35=$.getNum(p.name);
}
}
this.installed=_35?1:-1;
}else{
var obj;
if($.IEver>=this.minIEver&&$.getAXO(this.progID0)){
_35=$.codebaseSearch();
}else{
obj=$.getAXO(this.progID);
if(obj&&obj.QuickTimeVersion){
_35=obj.QuickTimeVersion.toString(16);
_35=_35.charAt(0)+"."+_35.charAt(1)+"."+_35.charAt(2);
}
}
this.installed=_35?1:($.getAXO(this.progID0)?0:-1);
}
this.version=this.clipTo3digits($.formatNum(_35));
}};
