xBrowser = function(){
	this.agent = navigator.userAgent.toLowerCase();
	// Platform
	this.mac = this.agent.indexOf("mac")!=-1;
	this.win = this.agent.indexOf("win")!=-1;
	this.win32 = this.win && this.agent.indexOf("16bit")==-1;
	this.unix = this.agent.indexOf("x11")!=-1 || this.agent.indexOf("linux")!=-1;
	// Browser
	this.w3c = document.getElementById ?true:false;
	this.iex = document.all ?true:false;
	this.ie4 = this.iex && !this.w3c;
	this.ie5up = this.iex && this.w3c;
	this.ns4 = document.layers ?true:false;
	this.ns6up = !this.iex && !this.ns4 && this.w3c;
	this.nsx = this.ns4 || this.ns6up;
};
xBrowser.prototype.dump = function(){
	var html = "";
	for(i in this) if(typeof(this[i]) != "function") html += i+" = "+this[i]+"<br>";
	document.write(html);
};
xBrowser = new xBrowser();

if(typeof(xBrowser) == "undefined") alert("xBrowser Required");



if(typeof(xFlash) == "undefined") xFlash = {};

xFlash.currentVersion = 8;
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.redirect = function(required, upgradeFlash, noFlash, failedCheck){
	if(this.versionInstalled < required  && location.search.indexOf("skipcheck=true") == -1){
		var url;
		if(this.versionInstalled == -1){
			if(!failedCheck) failedCheck = upgradeFlash;
			url = failedCheck;
		}else if(this.versionInstalled == 0){
			if(!noFlash) noFlash = upgradeFlash;
			url = noFlash;
		}else{
			url = upgradeFlash;
		}
		window.location.href = url;
	}
};

xFlash.replace = function(required, name, width, height, bgcolor, quality, menu, noFlash, flashVars){
	if(this.versionInstalled >= required){
		flashVars = flashVars!=null ? flashVars : "";
		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+'?'+flashVars+'">';
		swf += '<param name="FlashVars" value="'+flashVars+'">';
		swf += '<param name="bgcolor" value="'+bgcolor+'">';
		swf += '<param name="quality" value="'+quality+'">';
		swf += '<param name="menu" value="'+menu+'">';
			swf += '<embed src="'+name+'?'+flashVars+'"';
			swf += ' FlashVars="'+flashVars+'"';
			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);
	}
};