function lib_bwcheck(){ 
	this.ver=navigator.appVersion
	this.name=navigator.appName
	this.agent=navigator.userAgent

	this.major = parseInt(this.ver);
	this.minor = parseFloat(this.name);

	this.dom=document.getElementById?1:0;

	this.opera=(navigator.userAgent.indexOf("Opera")>-1 && !this.ie6)?1:0

	this.ie4=(document.all && !this.dom)?1:0;
	this.ie6=(this.agent.indexOf("MSIE 5")>-1 || this.agent.indexOf("MSIE 6")>-1)?1:0;
 	this.ie=(this.ie4 || this.ie6);

	this.moz=(this.agent.indexOf("Gecko")>-1 && this.dom)?1:0;
	this.ns6=(this.name.match("Netscape") && this.dom)?1:0;
	this.ns4=(document.layers)?1:0;

	this.mac=  (this.ver.indexOf("Mac") != -1) ? 1:0;
	this.win = (this.ver.indexOf("Win") != -1) ? 1:0;
	this.linux = (this.ver.indexOf("X11") != -1) ? 1:0;

	this.old = (this.ver.indexOf("2")>-1 || this.ver.indexOf("3")>-1);

	this._flash_currentver = 10;
	this._checkflashinstalled = BrowserCheckFlashInstalled;	
	this.flash6 = this._checkflashinstalled(6);
	this.flash5 = this._checkflashinstalled(5);
	this.flash4 = this._checkflashinstalled(4);

  return this
}


		function BrowserCheckFlashInstalled(version) {
			if(this.mac && this.ie4) return true;
			if(this.opera) return true;
			
			flashinstalled = 'false';
			if(this.ie && this.win) {
				var str = "";
				for(var i=version; i<=this._flash_currentver; i++)
				{
					str += 'IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.' + version + '\"))';
					if(i!=this._flash_currentver) str += " Or ";
				}
				document.writeln('<script language=\"VBscript\">');
				document.writeln('on error resume next');
				document.writeln('flashinstalled = ' + str);
				document.writeln('<\/script>');
			/*
			} else if(
				navigator.mimeTypes["application/x-director"] != null &&
				navigator.plugins["Shockwave for Director"] != null) {
					navigator.mimeTypes["application/x-director"] != null &&
					navigator.plugins["Shockwave for Director"] != null) {
					var desc = navigator.plugins["Shockwave for Director"].description;
					if(eval(desc.charAt(desc.indexOf("version",0)+"version ".length)) >= 7) flashinstalled  = 'true';
			*/
			} else {
				for(var i=0; i<navigator.plugins.length; i++)
					if(navigator.plugins[i].name == 'Shockwave Flash')
					{
						var desc = navigator.plugins["Shockwave Flash"].description;
						if(eval(desc.charAt(desc.indexOf("Flash",0)+"Flash ".length)) >= version) flashinstalled  = 'true';
					}
			}
			return eval(flashinstalled);
		}

bw=new lib_bwcheck()



function writeSW(filename , Bg , Width , Height , nonFlashimg , Alt , CookieUSE , CookieName){

		if (CookieUSE == 1){
			var C = readCookie(CookieName);
			flashObj = filename + ".swf?visit=" + C;
		} else {
			flashObj = filename + ".swf";
		}

		document.open();
			document.write('<div>');
			if (bw.flash6){
				document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"' + Width + '\" height=\"' + Height + '\">');
				document.write('<param name=\"movie\" value=\"' + flashObj + '\">');
				document.write('<param name=\"quality\" value=\"high\">');
				document.write('<param name=\"bgcolor\" value=\"#'+ Bg +'\">');
				document.write('<param name=\"scale\" value=\"noscale\">');
				document.write('<param name=\"menu\" value=\"false\">');
				document.write('<embed src=\"' + flashObj + '\" quality=\"high\" bgcolor=\"#'+ Bg +'\"  width=\"' + Width + '\" height=\"' + Height + '\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" menu=\"false\"></embed>');
				document.write('</object>');
			} else if(!bw.flash6 && nonFlashimg == 1){
				document.write('<img src=\"img/dl.jpg\" width=\"' + Width + '\" height=\"' + Height + '\" border=\"0\" alt=\"'+ Alt +'\" usemap=\"#Map\">');
			} else if(!bw.flash6 && nonFlashimg == 0){
				document.write('<img src=\"'+ UIdir+'s.gif\" width=\"' + Width + '\" height=\"'+ Height +'\" border=\"0\" alt="" /></a>');
			}
		document.write('</div>' + '\n');
		document.close();
}




