// |||||||||||||||||||||||||||||||||||||||||||||||||| Travis Beckham |||| www.squidfingers.com ||||
xBrowser = function(){
	this.agent = navigator.userAgent.toLowerCase();
	this.mac = this.agent.indexOf("mac")!=-1;
	this.win = this.agent.indexOf("win")!=-1;
	this.win32 = this.win && this.agent.indexOf("16bit")==-1;
	this.w3c = document.getElementById ?true:false;
	this.iex = document.all ?true:false;
	this.ns4 = document.layers ?true:false;
};
xBrowser = new xBrowser();

xFlash = {};
xFlash.currentVersion = 9;// This variable will need to be updated as new Flash versions are released.
xFlash.versionInstalled = 0;
xFlash.getVersion = function(){
	if(navigator.plugins != null && navigator.plugins.length > 0){
		var plugin = navigator.plugins["Shockwave Flash"];
		if(typeof plugin == "object"){
			for(i=3; i<= this.currentVersion; i++){
				if(plugin.description.indexOf(i+".") != -1){
					this.versionInstalled = i;
				}
			}
		}else if(navigator.plugins["Shockwave Flash 2.0"]){
			this.versionInstalled = 2;
		}
	}else if(xBrowser.iex && xBrowser.win32){
		document.write('<'+'script language="VBScript"'+'> \n');
			document.write('set xFlashObj = Nothing \n');
			document.write('on error resume next \n');
			document.write('For i = '+this.currentVersion+' to 3 step -1 \n');
				document.write('set xFlashObj = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n');
				document.write('If (Not(xFlashObj is Nothing)) Then \n');
					document.write('xFlash.versionInstalled = i \n');
					document.write('Exit For \n');
				document.write('End If \n');
			document.write('Next \n');
		document.write('<'+'\/script'+'> \n');

	}else if(xBrowser.agent.indexOf("webtv/2.5") != -1){
		this.versionInstalled = 3;
	}else if(xBrowser.agent.indexOf("webtv") != -1){
		this.versionInstalled = 2;
	}else{
		this.versionInstalled = -1;
	}
};
xFlash.getVersion();

xFlash.sniff = function(required, name, width, height, bgcolor, quality, menu, noFlash){
	if(this.versionInstalled >= required){
		var swf = '';
		swf += '<object';
		swf += ' width="'+width+'"';
		swf += ' height="'+height+'"';
		swf += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		swf += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+required+',0,0,0">';
		swf += '<param name="movie" value="'+name+'">';
		swf += '<param name="bgcolor" value="'+bgcolor+'">';
		swf += '<param name="quality" value="'+quality+'">';
		swf += '<param name="menu" value="'+menu+'">';
			swf += '<embed src="'+name+'"';
			swf += ' width="'+width+'"';
			swf += ' height="'+height+'"';
			swf += ' bgcolor="'+bgcolor+'"';
			swf += ' quality="'+quality+'"';
			swf += ' menu="'+menu+'"';
			swf += ' type="application/x-shockwave-flash"';
			swf += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
			swf += '<\/embed>';
		swf += '<\/object>';
		document.write(swf);
	}else{
		document.write(noFlash);
	}
};
// ||||||||||||||||||||||||||||||||||||||||||||||||||
