<!-- Beginning of JavaScript - // Slideshow with zoom-in-zoom-out-animation 		
// The width of your images (pixels). All pictures should have the same width.
var imgwidth=224

// The name of your images. You may add as many images as you like.
var imgname=new Array()
imgname[0]="Images/Index/Navy.gif"
imgname[1]="Images/Index/Army.gif"
imgname[2]="Images/Index/Air%20Force.gif"
imgname[3]="Images/Index/National%20Guard.gif"
imgname[4]="Images/Index/Marines.gif"
imgname[5]="Images/Index/Coast%20Guard.gif"

nbrImages = imgname.length;

// Add init position arrays
imgx = new Array();
// imgx[0] = 20;
// imgx[1] = 200; 
// imgx[2] = 380;
// imgx[3] = 560;
// imgx[4] = 740;
// imgx[5] = 920;

imgx[0] = 10;
imgx[1] = 25; 
imgx[2] = 40;
imgx[3] = 55;
imgx[4] = 70;
imgx[5] = 85;

// Image Container HTML Text
var imgTxt = "";

// This block will preload your images. Do not edit this block.
var imgpreload=new Array()
for (i=0;i<=imgname.length-1;i++) {
	imgpreload[i]=new Image()
	imgpreload[i].src=imgname[i]
}

// Standstill-time between the images (microseconds).
var pause=1000

// Speed of the stretching and shrinking effect. More means slower.
var speed=50

// This variable also affects the speed (the length of the step between each inmage-frame measured in pixels). More means faster.
var step=8

// Do not edit the variables below
var i_loop=64
var i_image=0

function createHTML() {
  var index = 0;
  var margin_left = 0; // margin-left: -XXpx;

  imgTxt = "<a target='_blank'>";
  for (index = 0; index < nbrImages; index++) {
    if (index != i_image) {
      imgTxt += "<img class='top' width='64' src='"+imgname[index]+"' style='position:absolute;left:"+imgx[index]+"%;' border='0'>"
    }  
    margin_left=(i_loop - 64) * i_image / nbrImages
    imgTxt += "<img class='top' width='"+i_loop+"' src='"+imgname[i_image]+"' style='position:absolute;left:"+imgx[i_image]+"%; margin-left: -"+margin_left+"px;' border='0'>"
  }
  imgTxt += "</a>";

  return imgTxt
}

function stretchimage() {
	if (i_loop<=imgwidth) {
          imgcontainer.innerHTML = createHTML()
	  i_loop=i_loop+step
	  var timer=setTimeout("stretchimage()",speed)
  	} else {
	  clearTimeout(timer)
	  var timer=setTimeout("shrinkimage()",pause)
	}
}

function shrinkimage() {
	if (i_loop >= 64) {
          imgcontainer.innerHTML = createHTML();
	  i_loop=i_loop-step
	  var timer=setTimeout("shrinkimage()",speed)
  	} else {
	  clearTimeout(timer)
	  changeimage()
	}
}

function changeimage() {
	i_loop=64
	i_image++
	if (i_image>imgname.length-1) {i_image=0}
   	var timer=setTimeout("stretchimage()",pause)
}

function initiate() {
  try {
    changeimage()
  } catch (err) {
    alert("Error: " + err.description);
  }
}

document.write("<div id=\"roof\" style=\"position:relative\">")
// - End of JavaScript - -->
