// --------------------------------------------------
// Flash Object

var Flash = new Object();

Flash.hasVersion = function (requiredVersion){
	if(navigator.plugins != null && navigator.plugins.length > 0){
		var version = 0;
		var plugin = navigator.plugins["Shockwave Flash"];
		if(typeof plugin == "object"){
			var description = plugin.description;
			version = parseInt(description.charAt(description.indexOf(".")-1));
		}
		return (version >= requiredVersion) ? true : false;
	}else if(navigator.appVersion.indexOf("Mac") == -1 && window.execScript){
		Flash.hasVersion_result = false;
		for(var i = requiredVersion; i <= requiredVersion+5 && Flash.hasVersion_result != true; i++){
			execScript('on error resume next: Flash.hasVersion_result=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
		}
		return Flash.hasVersion_result;
	}
	return null;
}
Flash.write = function (name, version, width, height, altimg){
	var html = "";
	if(this.hasVersion(parseInt(version))){
		html += '<object';
		html += ' width="'+width+'"';
		html += ' height="'+height+'"';
		html += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+',0,0,0">';
		html += '<param name="movie" value="'+name+'">';
		html += '<param name="menu" value="false">';
		html += '<embed src="'+name+'"';
		html += ' width="'+width+'"';
		html += ' height="'+height+'"';
		html += ' menu="false"';
		html += ' type="application/x-shockwave-flash"';
		html += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
		html += '<\/embed>';
		html += '<\/object>';
	}else{
		html = '<img src="'+altimg+'" width="'+width+'" height="'+height+'">';
	}
	document.write(html);
}

// --------------------------------------------------