var waves=Array(); 
waves["width"]=4000;
waves["height"]=492;
waves["screenWidth"]=document.documentElement.clientWidth;
waves["speed"]=waves["width"]*10;
waves["updateSpeed"]=10;


function animateBackground()
{
 go=false;

 if(version=navigator.userAgent.match(/Opera\/(\d+\.\d+)/))
 {
  if(version[1]>=7)
  {
   waves["updateSpeed"]=20;
   go=true;
  }
 }
 else if(version=navigator.userAgent.match(/SeaMonkey\/(\d+\.\d+)/))
 {
  if(version[1]>=1)
   go=true;
 }
 else if(version=navigator.userAgent.match(/Firefox\/(\d+\.\d+)/))
 {
  if(version[1]>=1)
   go=true;
 }
 else if(version=navigator.userAgent.match(/MSIE (\d+\.\d+)/))
 {
  if(version[1]>=7)
   go=true;
 }
 else if(version=navigator.userAgent.match(/(\d+\.\d+)\.\d+ Safari/))
 {
  if(version[1]>=3)
  {
 //  waves["updateSpeed"]=50;
 //  go=true;
  }
 }

 if(!go)
  return;

 tmp=document.createElement("div");
 tmp.id="waves";
 tmp.style.width=waves["screenWidth"]+"px";
 tmp.style.height=waves["height"]+"px";

 tmpb=document.createElement("div");
 tmpb.id="waveblue";
 tmpb.style.width=waves["width"]+"px";
 tmpb.style.height=waves["height"]+"px";

 tmpr=document.createElement("div");
 tmpr.id="wavered";
 tmpr.style.width=waves["width"]+"px";
 tmpr.style.height=waves["height"]+"px";

 tmp.appendChild(tmpb);
 tmp.appendChild(tmpr);

 document.body.appendChild(tmp);

 waves["blue"]=new Flash(document.getElementById("waveblue"));
 waves["red"]=new Flash(document.getElementById("wavered"));

 waves["blue"].updateSpeed=waves["updateSpeed"];
 waves["red"].updateSpeed=waves["updateSpeed"];

 loopBackground();
 document.body.style.backgroundImage="none";
}

function loopBackground()
{
 waves["blue"].backgroundMove(0, 0, 0);
 waves["blue"].backgroundMove(waves["width"], 0, waves["speed"]);
 waves["blue"].go();

 waves["red"].backgroundMove(waves["width"], 0, 0);
 waves["red"].backgroundMove(0, 0, waves["speed"]);
 waves["red"].end("loopBackground()");
 waves["red"].go();
}


