// The function implement animation image for the main page
_showtime = 6000;
_imgnum = 9;
_curimgindex=0;
_running = true;
_nofocus = true;

var timer = 0;
var imgs = new Array(_imgnum);



img0 = ImageInfo("/images/animation/poseidon.jpg", "Poseidon", "250", "175");
img1 = ImageInfo("/images/animation/Athena.jpg", "Athena", "250", "175");
img2 = ImageInfo("/images/animation/DMM32X.jpg", "DMM-32X-AT", "250", "175");
img3 = ImageInfo("/images/animation/Elektra.jpg", "Elektra", "250", "175");
img4 = ImageInfo("/images/animation/EMM8P.jpg", "EMM-8P-XT", "250", "175");
img5 = ImageInfo("/images/animation/EMM8PLUS.jpg", "EMM-8PLUS", "250", "175");
img6 = ImageInfo("/images/animation/herculesii.jpg", "Hercules-EBX", "250", "175");
img7 = ImageInfo("/images/animation/JMM.jpg", "JMM-512-V512", "250", "175");
//img8 = ImageInfo("/images/animation/OMMDIO.jpg", "OMM-DIO-XT", "250", "175");
img8 = ImageInfo("/images/animation/gpio.jpg", "GPIO", "250", "175");
img9 = ImageInfo("/images/animation/Pandora.jpg", "Pandora", "250", "175");

imghref0 = "/products/poseidon";
imghref1 = "/products/athena";
imghref2 = "/products/dmm32x";
imghref3 = "/products/elektra";
imghref4 = "/products/emeraldmm8p";
imghref5 = "/products/emeraldmm8plus";
imghref6 = "/products/herculesebx";
imghref7 = "/products/jupitermm";
//imghref8 = "/products/onyxmmdio";
imghref8 = "/products/gpiomm";
imghref9 = "/products/pandora_generic";

imgcaption0 = "1.0Ghz - 2.0Ghz Epic SBC with on-board memory and data acquisition"
imgcaption1 = "Rugged compact PC/104 expandable CPU + data acquisition"
imgcaption2 = "Auto-Autocalibration analog I/O PC/104 module"
imgcaption3 = "Rugged compact PC/104 expandable CPU + data acquisition"
imgcaption4 = "8-port software programmable RS-232/422/485 serial port PC/104 module "
imgcaption5 = "High Performance PC/104-Plus 8 Port RS232/422/485 Serial I/O Module"
imgcaption6 = "Rugged EBX format CPU + data acquisition + DC/DC power supply"
imgcaption7 = "50 watt DC/DC power supply, +/-5V, +/-12V outputs"
//imgcaption8 = "48-line digital I/O PC/104 module"
imgcaption8 = "Reconfigurable 48-line digital I/O + counter/timer PC/104 module"
imgcaption9 = "Rugged, easy to assemble PC/104 enclosure"


function ImageInfo(imgsrc, imgalt, imgwidth, imgheight)
{
                 altimg = new Image();
                altimg.src = imgsrc;
                altimg.alt = imgalt;
                altimg.width = imgwidth;
                altimg.height = imgheight;
                return altimg;
}


function showimg(imgindex)
{
        return         imgs[imgindex];
}


function timeimgs(numb)
{
  // Reusable timer
  if ((_running)&&(_nofocus))
  {
            timer = setTimeout("imgturn('" + numb + "')", _showtime);
  }
  else
          return;
}


// Reusable image turner
function imgturn(numb)
{

  // This will loop the image
   if ((_running)&&(_nofocus))
   {
           if (numb == "9")
           {
             _curimgindex = 9;
           document.getElementById("demo").src = eval("img9.src");
           document.getElementById("demo").alt = eval("img9.alt");
             document.getElementById("imghref").href = eval("imghref9");
           //document.getElementById("imgcaption").innerHTML = eval("imgcaption9");
           timeimgs('0');

             }
            else
            {
           document.getElementById("demo").src = eval("img" + numb + ".src");
           document.getElementById("demo").alt = eval("img" + numb + ".alt");
           document.getElementById("imghref").href = eval("imghref" + numb);
           //document.getElementById("imgcaption").innerHTML = eval("imgcaption" + numb);
           _curimgindex = numb;
           numb++;
           timeimgs(numb);
          }
         }
 }

 function GetFocus()
 {
        _running = false;
        _nofocus = false;
        document.getElementById("demo").src = eval("img" + _curimgindex + ".src");
        document.getElementById("demo").alt = eval("img" + _curimgindex + ".alt");
        document.getElementById("imghref").href = eval("imghref" + _curimgindex);
        //document.getElementById("imgcaption").innerHTML = eval("imgcaption" + _curimgindex);
     if(timer)
     {
              clearTimeout(timer);
               timer  = 0;
     }

 }

 function LostFocus()
 {

        if(_curimgindex==8)
        {
         _curimgindex=0;
        }
        else
        {
          _curimgindex++;
        }
        _running = true;
        _nofocus = true;
        timeimgs(_curimgindex);
 }


 ///////////////////////////Press Animated //////////////////////////
 var timer2 = 0
var showtime = 6000

var titles = ["Earthquake Research Satellite Demonstrates Value of PC/104", "Custom PC/104 CPU Facilitates Military Upgrade Program", "Electric Vehicle Aided by PC/104 System Sets Land Speed Record", "Air-Launched Decoy Features Diamond Systems' PC/104 and Custom Form Factor Boards", "Diamond Systems’ Ruggedization Services Succeed Where Competitors Fail"];

var urls = ["/press/quakesat", "/press/military.php", "/press/buckeye.php3", "/press/mald.php", "/press/dlos.php3"];

var images = ["/images/qsmall.jpg", "/images/press/tank_small.jpg", "/images/press/buckeye_bullet_smaller.jpg", "/images/press/mald_cover_small.gif", "/images/press/dlos4.gif" ];

var copy = ["<p>Small size, light weight, lower power consumption, and high integration are key to realizing ultra-miniature data collection satellite</p>", "<p>A sensor systems manufacturer uses Diamond Systems technology in an upgrade program that enhances the performance of a vehicle fleet.</p>", "<p>Ohio State’s “Buckeye Bullet” Uses Diamond Systems’ Prometheus PC/104 CPU to Monitor Critical On-Board Systems</p>", "<p>Diamond Systems  provided design and manufacturing services for a total of 10 circuit boards used to control the launch and flight of the Northtrop Grumman Miniature Air-Launched Decoy (MALD), designed and built for the U.S. Air Force.</p>", "<p>Diamond Systems leverages its ruggedization experience to create a custom CPU for a vehicle mounted weapons station.</p>"];

//pick = Math.round(Math.random() * (titles.length - 1));


function times(numb)
{
  // Reusable timer
  timer2 = setTimeout("animatedturn('" + numb + "')", showtime);

}


// Reusable image turner
function animatedturn(numb)
{

  // This will loop the image
     pick= numb;


         x=document.getElementById("animatedtext")
          x.innerHTML = "<table>\n<tr>\n<td>\n<table border=0 cellpadding=0 cellspacing=3>\n<tr>\n<td colspan=2><span class=\"sideMenuTitle\"><a href=\"" + urls[pick] + "\" class=\"sideMenuLink\">" + titles[pick] + "</a></span></td>\n</tr>\n<tr>\n<td valign=top><img src=\"/images/diamond_bullet.gif\"></td>\n<td><div class=\"homeMenuItem\">\n<p>" + copy[pick] + "</p>\n</div></td>\n</tr>\n</table>\n</td>\n<td>\n<a href=\"" + urls[pick] + "\"><img border=0 src=\"" + images[pick] + "\"></a>\n</td>\n</tr>\n</table>"
     if (numb == "4")
           {
        numb=0;
            }
            else
            {

                numb++;
                //alert(numb);
          }
          times(numb);
 }

function change_Location()
{
        window.location='http://www.diamondsystems.com/products';
}
