var image1 = 0;
var image2 = 0;
var inc1 = 1;
var inc2 = 0;
var height0 = 20;
var width0 = 21;
var height1 = 20;
var width1 = 21;
var sizeinc = 0;
var imageno = 0;
var count1 = 0;
var imageno = 0;
var index1 = 1;
var sizeinc = 0;

function animate ()
{
if (sizeinc == 0) {
height0 += 2;
width0 = 2 * Math.floor(height0 * 102/200);
document.images[0].height = height0;
document.images[0].width = width0;
if (height0 > 99) {height1 = 20;
sizeinc = 1;
    }
  }
else {height1 += 2;
width1 = 2 * Math.floor(height1 * 102/200);
document.images[1].height = height1;
document.images[1].width = width1;
if (height1 > 99) {height0 = 20;
sizeinc = 0;
    }
  }
}

function homenext ()
{
count1 += 1;
if (count1 == 5) {count1 = 0; imageno += 1};
if (imageno == 4) {imageno = 0; index1 += 1};
if (index1 == 4) {index1 = 0};
document.images[2 + imageno].src = "homepic" + ((4 * imageno) + index1 + 1) + ".jpg";
animate ()

window.setTimeout("homenext();",200);

}

function next ()
{
animate()

window.setTimeout("next();",200);

}


function showImg(name, wid, ht, imag)
{
  document.images[imag].height = ht;
  document.images[imag].width = wid;
  document.images[imag].src = name + "b.jpg";
  document.images[imag].src = name + "a.jpg";
}

