﻿//<![CDATA[

var plugin;
function wrtFlash(swf,swfid,img,msg,clik,fVars,w,h,div) {
	plugin = 0;
	var oSwf;
	var type = 'application/x-shockwave-flash';
	
	if (navigator.mimeTypes && navigator.mimeTypes[type] && navigator.mimeTypes[type].enabledPlugin && navigator.mimeTypes[type].enabledPlugin.description) {
		if(parseInt(navigator.mimeTypes[type].enabledPlugin.description.replace("Shockwave Flash ", "").slice(0, 1)) >= 9) plugin = 1;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && (navigator.userAgent.indexOf("Windows 95") >= 0 || navigator.userAgent.indexOf("Windows 98") >= 0 || navigator.userAgent.indexOf("Windows NT") >= 0)) {
		document.write('<SCRIPT LANGUAGE=VBScript>\n');
		document.write('on error resume next \n');
		document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
		document.write('</SCR' + 'IPT> \n');
	}
	if ( plugin ) {
		if (document.all) {
			wrtContent = '<object id="' + swfid + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" Width = "' + w + '" Height = "' + h + '" align="top"><param name="movie" value="' + swf + '"><param name="FlashVars" Value="' + fVars + '"><param name="quality" value="high"><param name="wmode" value="opaque"><param name="menu" value="false"><param name="allowScriptAccess" value="always"></object>';
		}
		else {
			wrtContent = '<embed id="' + swfid + '" src="' + swf + '" FlashVars="' + fVars + '" Width = "' + w + '" Height = "' + h + '" align="top" quality="high" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowScriptAccess="always"></embed>';
		}
	}
	else {
		wrtContent = '<a href="' + clik + '"><img src="' + img + '" border="0" style="border:none;"/></a><div>' + msg + '</div>'
	}
	if (document.getElementById(div)) {
		document.getElementById(div).innerHTML = wrtContent;
		oSwf = document.getElementById(swfid);
	}

	return oSwf;
}

function createFlashvars(objVars) {
	var nm;
	var arr = [];
	for(nm in objVars)
		arr.push(nm + "=" + escape(objVars[nm]));
	return arr.join("&amp;");
}

//]]>
