
/*
	Flash Detection Object v 1.1
	
	Hand Crafted by Nevub -> [www.nevub.com || info@nevub.com]
	Copyright © 2002 Nevub.  All Rights Reserved.
--------------------------------------------------------------------------- */

var clientVer = 0;

var isIE = (navigator.appVersion.indexOf('MSIE') != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf('Windows') != -1) ? true : false;

if (isIE && isWin) {
	var vb = '';
	vb += '<scr' + 'ipt language="vbscript" type="text/vbscript"> \n';
	vb += 'dim is_flash, i \n';
	vb += 'is_flash = false \n';
	vb += 'i = 10 \n';
	vb += 'do while i >= 4 \n';
	vb += 'on error resume next \n';
	vb += 'is_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) \n';
	vb += 'if is_flash = true then exit do \n';
	vb += 'i = i - 1 \n';
	vb += 'loop \n';
	vb += 'clientVer = i \n';
	vb += '\n';
	//vb += 'sub swfObj_FSCommand(ByVal command, ByVal args) \n';
	//vb += 'call swfObj_DoFSCommand(command, args) \n';
	//vb += 'end sub \n';
	vb += '<\/scr' + 'ipt> \n';
	document.write(vb);
}

if (navigator.plugins) {
	if (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash']) {
		var isVersion2 = navigator.plugins['Shockwave Flash 2.0'] ? ' 2.0' : '';
		var flashDescription = navigator.plugins['Shockwave Flash' + isVersion2].description;
		clientVer = parseInt(flashDescription.charAt(flashDescription.indexOf('.') - 1));
	}
}

function FlashObj() {
	this.startHTML = '';
	this.endHTML = '';
	this.minVer = 5;
	this.alt = '';
	this.movie = '';
	this.id = 'swfObj';
	this.width = '760';
	this.height = '400';
	this.menu = 'false';
	this.flashvars = '';
	this.quality = '';
	this.scale = '';
	this.bgcolor = '';
	this.wmode = '';
	this.deviceFont = '';
	this.LiveConnect = '';
	this.cabVer = '#version=5,0,0,0';
	this.render = getSrc;
}

function checkFlash(mV) {
	this.flash = false;
	if (clientVer >= mV) this.flash = true;
}

function getSrc() {
	var src = '';
	var cF = new checkFlash(this.minVer);
	if (cF.flash) {
		src += this.startHTML;
		src += '<object id="' + this.id + '" width="' + this.width + '" height="' + this.height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' + this.cabVer + '">';
		src += '<param name="movie" value="' + this.movie + '" />';
		if (this.menu != '') src += '<param name="menu" value="' + this.menu + '" />';
		if (this.flashvars != '') src += '<param name="flashvars" value="' + this.flashvars + '" />';
		if (this.quality != '') src += '<param name="quality" value="' + this.quality + '" />';
		if (this.scale != '') src += '<param name="scale" value="' + this.scale + '" />';
		if (this.bgcolor != '') src += '<param name="bgcolor" value="' + this.bgcolor + '" />';
		if (this.wmode != '') src += '<param name="wmode" value="' + this.wmode + '" />';
		if (this.deviceFont != '') src += '<param name="devicefont" value="' + this.devicefont + '" />';
		src += '<embed id="' + this.id + '" name="' + this.id + '" src="' + this.movie + '" width="' + this.width + '" height="' + this.height + '" ';
		if (this.menu != '') src += 'menu="' + this.menu + '" ';
		if (this.flashvars != '') src += 'flashvars="' + this.flashvars + '" ';
		if (this.quality != '') src += 'quality="' + this.quality + '" ';
		if (this.scale != '') src += 'scale="' + this.scale + '" ';
		if (this.bgcolor != '') src += 'bgcolor="' + this.bgcolor + '" ';
		if (this.deviceFont != '') src += 'devicefont="' + this.deviceFont + '" ';
		if (this.LiveConnect != '') src += 'swliveconnect="' + this.LiveConnect + '" ';
		src += 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
		src += '</object>';
		src += this.endHTML;
	} 
	else {
		if (this.alt) src = this.startHTML + this.alt + this.endHTML;
	}
	return src;
}
