var isDOM       = document.getElementById;                       //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
var isOpera     = isOpera5 = window.opera && isDOM;              //Opera 5+
var isOpera6    = isOpera && window.print;                       //Opera 6+
var isOpera7    = isOpera && document.readyState;                //Opera 7+
var isMSIE      = document.all && document.all.item && !isOpera; //Microsoft Internet Explorer 4+
var isMSIE5     = isDOM && isMSIE;                               //MSIE 5+
var isNetscape4 = document.layers;                               //Netscape 4.*
var isMozilla   = isDOM && navigator.appName == "Netscape";      //Mozilla или Netscape 6.*

var plugin;
var version = 6;
var flash = false;

function checkFlash() {
	if(navigator.plugins["Shockwave Flash"]) {
		plugin = navigator.plugins["Shockwave Flash"].description;
		flash = parseInt(plugin.charAt(plugin.indexOf('.') - 1)) >= version;
	}
	else {
		if ((navigator.userAgent.indexOf('MSIE') != -1)&&(navigator.userAgent.indexOf('Win') != -1)&&(navigator.userAgent.indexOf('Opera') == -1)) {
			checkFlashInExplorer ();
		}
	}
}

function loadFlash(flashPath,flashWidth,flashHeight) {
	if (flash) {
		document.write('<div style="text-align: center;">');
		document.write('	<div style="width: ' + flashWidth + 'px; height: ' + flashHeight + 'px;">');
		document.write('	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="100%">');
		document.write('		<param name="movie" value="../flash/' + flashPath + '.swf">');
		document.write('		<param name="menu" value="false">');
		document.write('		<param name="scale" value="noscale">');
		document.write('		<param name="quality" value="high">');
		document.write('		<embed src="../flash/' + flashPath + '.swf" menu="false" scale="noscale" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="100%"></embed>');
		document.write('	</object>');
		document.write('	</div>');
		document.write('</div>');
	}
	else {
		document.write('<table cellpadding="0" cellspacing="0" border="0">');
		document.write('<tr>');
		document.write('	<td valign="top"><img src="img/pixels/t.gif" width="1" height="55" alt="" border="0"></td>');
		document.write('	<td valign="top">');
		document.write('		<div style="margin: 1px 7px 0px 0px;"><a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="img/arrows/flash.gif" width="24" height="24" alt="" border="0"></a></div>');
		document.write('	</td>');
		document.write('	<td valign="top">');
		document.write('		<div class="mainvfix" style="color:#ADA78B;">Для просмотра анимации<br>скачать <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank" class="hboldvfix" style="color:#FF8143;text-decoration:underline;">Flash плеер</a></div>');
		document.write('	</td>');
		document.write('</tr>');
		document.write('</table>');
		document.write('<table cellpadding="0" cellspacing="0" border="0">');
		document.write('<tr><td valign="top"><img src="img/pixels/t.gif" width="180" height="1" alt="" border="0"></td></tr>');
		document.write('</table>');
	}
}
