function Animate(divId)
{
var oThis = this;
var aImg  = document.getElementById(divId).getElementsByTagName('img');
var m1 = 100, m2 = 0, nextImage = 0, t = "";
var oImg1 = '', oImg2 = '';
this.next = function()
{
if (t != "") return;
m1 = 100;
m2 = 0;
oImg1 = aImg[nextImage];
nextImage++;
if (nextImage == aImg.length) { nextImage = 0; }  
oImg2 = aImg[nextImage];
oThis.changeSlide();
}
this.changeSlide = function()
{
m1--; m2++;
oImg1.style.opacity = m1/100;
oImg1.style.filter="alpha(opacity="+m1+")";
oImg2.style.opacity = m2/100;
oImg2.style.filter="alpha(opacity="+m2+")";
t = setTimeout(oThis.changeSlide,5);
if (m2 == 100) {
clearTimeout(t); t = ""; 
setTimeout(oThis.next,4000);
}
}
setTimeout(oThis.next,1000);
}
function SmeRis()
{
new Animate('park');
}

function PiShem()
{
document.write("E-mail <a style='border-bottom:1px solid #000000; color:#000000; text-decoration:none' href='mailto:bmz@bogorodskmash.ru'>bmz@bogorodskmash.ru</a>")
}

function DiRek()
{
document.write("e-mail &nbsp;<a style='border-bottom:1px solid #000000; color:#000000; text-decoration:none' href='mailto:bmz@bogorodskmash.ru'>bmz@bogorodskmash.ru</a>")
}

function KoMerc()
{
document.write("e-mail &nbsp;<a style='border-bottom:1px solid #000000; color:#000000; text-decoration:none' href='mailto:sales@bogorodskmash.ru'>sales@bogorodskmash.ru</a>")
}

function FP_swapImgRestore()
{
 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
  doc.$imgSwaps=null; }
}

function FP_swapImg()
{
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs()
{
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_changePropRestore()
{
var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}

function FP_getObjectByID(id,o)
{
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}

function FP_changeProp()
{
var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
if(s) eval(s+"=v"); }
}

function noRis()
{
var nr = window.close()
}

