function flashVersion() 
{
	// Отдельно определяем Internet Explorer
	var ua = navigator.userAgent.toLowerCase();
	var isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1);
	// Стартовые переменные
	var version = 0;
	var lastVersion = 20; // На момент 2007 года с запасом
	var i;
	if (isIE) 
	{ // browser == IE
		try 
		{
			for (i = 3; i <= lastVersion; i++) 
			{
				if (eval('new ActiveXObject("ShockwaveFlash.ShockwaveFlash.'+i+'")')) 
				{
					version = i;
    			}
   			}
  		} catch(e) {}
 	} 
 	else 
 	{ // browser != IE
  		for (i = 0; i < navigator.plugins.length; i++) 
  		{
   			if (navigator.plugins[i].name.indexOf('Flash') > -1) 
   			{
    			version = (parseInt(navigator.plugins[i].description.charAt(16)) > version) ? parseInt(navigator.plugins[i].description.charAt(16)) : version;
   			}
  		}
 	}
 	return version;
}

function insFlash(path,fileid,filename,variabili,larghezza,altezza,colore,trasparente)
{
	var flashObject = "<object type=\"application/x-shockwave-flash\" data=\"" + path + filename + "\" id=\"" + fileid + "\" width=\"" + larghezza + "\" height=\"" + altezza + "\">";
	var flashVars = "    <param name=\"flashVars\" value=\"" + variabili +"\">";
	var movie = "    <param name=\"movie\" value=\"" +  path + filename + "\" />";
	var nome = "    <param name=\"name\" value=\"" + fileid + "\" />";

	document.writeln(flashObject);
	document.writeln(movie); 
	document.writeln(flashVars); 
	document.writeln("    <param name=\"loop\" value=\"false\" />");
	document.writeln("    <param name=\"menu\" value=\"false\" />"); 
	document.writeln("    <param name=\"quality\" value=\"high\" />"); 
	document.writeln("    <param name=\"bgcolor\" value=\"#" + colore + "\" />");
	document.writeln(nome);
	if (trasparente == true) 
	{
		document.writeln("    <param name=\"wmode\" value=\"transparent\">");
		var traspEmbed = " wmode=\"transparent\""
	} 
	else 
	{
		var traspEmbed = ""
	}
	var EMBED = "<EMBED src=\"" + path + filename + "\" flashVars=\"" + variabili + "\" loop=\"false\" menu=\"false\" quality=\"high\" bgcolor=\"" + colore + "\" WIDTH=\"" + larghezza + "\" HEIGHT=\"" + altezza + "\" NAME=\"" + fileid + "\"" + traspEmbed + " ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
	document.writeln (EMBED);
	document.writeln("</object>"); 
}

function mRandom(byte)
{
	result='';
	for (i=0;i<byte;i++)
		result+=Math.ceil(Math.random()*10)+'';
	return result;
}

function Unical()
{
	var date = new Date();
	return date.getDate()+''+date.getMonth()+''+date.getDay()+''+date.getFullYear()+''+date.getTime();
}
//-----------------------------------------------------------------------------------------
function Mot(eld)
{
	eld.style.backgroundColor='#dbdbdb';
}

function Mor(eld)
{
	eld.style.backgroundColor='#b6c5d1';
}

function Mot2(eld)
{
	eld.style.backgroundColor='#8A0B02';
}

function Mor2(eld)
{
	eld.style.backgroundColor='#b3180d';
}
//-----------------------------------------------------------------------------------------

function show_block(id)
{
	v1 = document.getElementById (id);
	v1.style.display = "block";
}

function hide_block(id)
{
	v1 = document.getElementById (id);
	v1.style.display = "none";
}


