function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function getinfoU(ie,nn,button)
{
	var ie4, nn4, nn6
	ie4 = nn4 = nn6
	if (document.all)
		{ie4 = 1}
	if (document.layers)
		{nn4 = 1}
	if (document.getElementById&&!ie4)
		{nn6 = 1}	
buttonname = "infobutton" + button
if (ie4)
	{
	if (document.all.item(ie).style.display == '') 
	  {
	  document.all.item(ie).style.display = 'none'
	  document.all.item(buttonname).value = '>>'
	  document.all.item(buttonname).title = 'посмотреть подробную информацию'
	  }
	  else
	  {
	  document.all.item(ie).style.display = ''
	  document.all.item(buttonname).value = '<<'
	  document.all.item(buttonname).title = 'убрать подробную информацию'
	  }
	}
if (nn6)
	{
	if (document.getElementById(ie).style.display == '') 
	  {
	  document.getElementById(ie).style.display = 'none'
	  document.all.item(buttonname).value = '>>'
	  document.all.item(buttonname).title = 'посмотреть подробную информацию'
	  }
	  else
	  {
      document.getElementById(ie).style.display = ''
	  document.all.item(buttonname).value = '<<'
	  document.all.item(buttonname).title = 'убрать подробную информацию'
	  }
	}	

}
function ItsEmpty(StringValue) 
{
   if (StringValue == "" || StringValue == null) { return true }
   var Flag=true
   for (var counter = 0; counter < StringValue.length; counter++) 
   {
		if(StringValue.charAt(counter)!=" ") { Flag=false }
   }
   return Flag
}
function RoundDec(OriginalNum, Decimals)
{
	if(OriginalNum<0) OriginalNum=0
	return (Math.round(OriginalNum * Math.pow(10,  Decimals)) / Math.pow(10,  Decimals))
}
function ValidNumber(NumValue, Length)
{
	if(NumValue.length!=Length)	return false
	for(var i=0;i<Length;i++)
	{
		if(isNaN(NumValue.charAt(i))) return false
	}
	return true
}
function ValidEmail(EmailAddress) 
{
    if (EmailAddress.length < 5) 
	{
        return false
    }
    at_location = EmailAddress.indexOf("@")
    dot_location = EmailAddress.lastIndexOf(".")
    if (at_location == -1 || dot_location == -1 || at_location > dot_location ) {
        return false
    }
    if (at_location == 0) {
        return false
    }
    if (dot_location - at_location < 2 ) {
        return false
    }
    if (EmailAddress.length - dot_location < 2) {
        return false
    }
    return true
}
function GetKeyPres(KeyEvent)
{
	if(document.all)
	{
		return KeyEvent.keyCode
	}	
	else if(document.getElementById || document.layers)
	{	
		return KeyEvent.which
	}
	return KeyEvent.keyCode
}
//Проверка цифровых значений
function ItsDigit(KeyEvent, MyForm) {
	var KeyPresed = GetKeyPres(KeyEvent)
	if (KeyPresed==32) {return false}
	if ((KeyPresed==16)||(KeyPresed==17)||(KeyPresed==45)) {return true}
	if ( ((MyForm.value.length - (MyForm.value.indexOf(".")==-1?100:MyForm.value.indexOf(".")))<3)&&
		  ((((KeyPresed>=48) && (KeyPresed<=57)) ||
		  ((KeyPresed>=96) && (KeyPresed<=105)))) ||
		  (KeyPresed<40) || (KeyPresed==46)
		) { return true }
	return false
}

function ItsFloatDigit(KeyEvent, MyForm)
{
	var	Flag = ItsDigit(KeyEvent, MyForm)
	var KeyPresed = GetKeyPres(KeyEvent)
	if( (Flag) || ((MyForm.value.indexOf(".") == -1) && ((KeyPresed==110)||(KeyPresed==190)||(KeyPresed==188)))  )
	{
		if ((KeyPresed==190) ||(KeyPresed==188) ||(KeyPresed==110) )
		{
			MyForm.value = MyForm.value+ "."
			return false		
		}
		return true
	}
	return false
}